Skip to content

Commit 2bfcc7d

Browse files
committed
Merge branch 'master' into stable-4.4
* master: Add missing attributes to CommitComment Fix auto-filled issue task URL Change-Id: I70776c197d1d3059c5b93700efb860c45c526ffd Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2 parents f60993d + f698a68 commit 2bfcc7d

File tree

3 files changed

+58
-4
lines changed

3 files changed

+58
-4
lines changed

org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/CommitComment.java

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,16 @@ public class CommitComment extends Comment {
2222

2323
private int position;
2424

25+
private int originalPosition;
26+
2527
private String commitId;
2628

29+
private String originalCommitId;
30+
2731
private String path;
2832

33+
private String diffHunk;
34+
2935
/**
3036
* @return line
3137
*/
@@ -58,6 +64,22 @@ public CommitComment setPosition(int position) {
5864
return this;
5965
}
6066

67+
/**
68+
* @return originalPosition
69+
*/
70+
public int getOriginalPosition() {
71+
return originalPosition;
72+
}
73+
74+
/**
75+
* @param originalPosition
76+
* @return this commit comment
77+
*/
78+
public CommitComment setOriginalPosition(int originalPosition) {
79+
this.originalPosition = originalPosition;
80+
return this;
81+
}
82+
6183
/**
6284
* @return commitId
6385
*/
@@ -74,6 +96,22 @@ public CommitComment setCommitId(String commitId) {
7496
return this;
7597
}
7698

99+
/**
100+
* @return originalCommitId
101+
*/
102+
public String getOriginalCommitId() {
103+
return originalCommitId;
104+
}
105+
106+
/**
107+
* @param originalCommitId
108+
* @return this commit comment
109+
*/
110+
public CommitComment setOriginalCommitId(String originalCommitId) {
111+
this.originalCommitId = originalCommitId;
112+
return this;
113+
}
114+
77115
/**
78116
* @return path
79117
*/
@@ -89,4 +127,20 @@ public CommitComment setPath(String path) {
89127
this.path = path;
90128
return this;
91129
}
130+
131+
/**
132+
* @return diffHunk
133+
*/
134+
public String getDiffHunk() {
135+
return diffHunk;
136+
}
137+
138+
/**
139+
* @param diffHunk
140+
* @return this commit comment
141+
*/
142+
public CommitComment setDiffHunk(String diffHunk) {
143+
this.diffHunk = diffHunk;
144+
return this;
145+
}
92146
}

org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/issue/IssueConnector.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ public TaskData getTaskData(TaskRepository repository, String taskId,
377377
public String getRepositoryUrlFromTaskUrl(String taskFullUrl) {
378378
if (taskFullUrl != null) {
379379
Matcher matcher = Pattern.compile(
380-
"(http://.+?)/issues/issue/([^/]+)").matcher(taskFullUrl); //$NON-NLS-1$
380+
"(http://.+?)/issues/([^/]+)").matcher(taskFullUrl); //$NON-NLS-1$
381381
if (matcher.matches())
382382
return matcher.group(1);
383383
}
@@ -388,7 +388,7 @@ public String getRepositoryUrlFromTaskUrl(String taskFullUrl) {
388388
public String getTaskIdFromTaskUrl(String taskFullUrl) {
389389
if (taskFullUrl != null) {
390390
Matcher matcher = Pattern
391-
.compile(".+?/issues/issue/([^/]+)").matcher(taskFullUrl); //$NON-NLS-1$
391+
.compile(".+?/issues/([^/]+)").matcher(taskFullUrl); //$NON-NLS-1$
392392
if (matcher.matches())
393393
return matcher.group(1);
394394
}
@@ -397,7 +397,7 @@ public String getTaskIdFromTaskUrl(String taskFullUrl) {
397397

398398
@Override
399399
public String getTaskUrl(String repositoryUrl, String taskId) {
400-
return repositoryUrl + "/issues/issue/" + taskId; //$NON-NLS-1$
400+
return repositoryUrl + "/issues/" + taskId; //$NON-NLS-1$
401401
}
402402

403403
@Override

org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueConnectorUi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public IHyperlink[] findHyperlinks(TaskRepository repository, String text,
160160
} else if (user != null && project != null) {
161161
Region region = createRegion(textOffset, matcher);
162162
String url = GitHub.createGitHubUrl(user, project)
163-
+ "/issues/issue/" + taskId;
163+
+ "/issues/" + taskId;
164164
hyperlinks.add(new URLHyperlink(region, url));
165165
}
166166
}

0 commit comments

Comments
 (0)