Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 159393 Details for
Bug 249572
commit message not perfectly respecting commit template
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch
clipboard.txt (text/plain), 4.02 KB, created by
Shawn Minto
on 2010-02-17 19:36:24 EST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Shawn Minto
Created:
2010-02-17 19:36:24 EST
Size:
4.02 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.team.ui >Index: src/org/eclipse/mylyn/internal/team/ui/templates/CommitTemplateManager.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.team.ui/src/org/eclipse/mylyn/internal/team/ui/templates/CommitTemplateManager.java,v >retrieving revision 1.15 >diff -u -r1.15 CommitTemplateManager.java >--- src/org/eclipse/mylyn/internal/team/ui/templates/CommitTemplateManager.java 7 Dec 2009 19:53:47 -0000 1.15 >+++ src/org/eclipse/mylyn/internal/team/ui/templates/CommitTemplateManager.java 18 Feb 2010 00:35:05 -0000 >@@ -179,11 +179,12 @@ > value = processKeyword(task, keyword); > } > >+ String trailingCharacters = segment.substring(brace + 1); > if (value != null) { > evaluated.add(value); >- evaluated.add(segment.substring(brace + 1)); >+ evaluated.add(trailingCharacters); > } else if (!evaluated.isEmpty()) { >- evaluated.pop(); >+ evaluated.add(trailingCharacters); > } > // else { > // buffer.append("${"); >@@ -195,7 +196,9 @@ > buffer.append(string); > } > >- return buffer.toString(); >+ // remove duplicate whitespace >+ String commitTemplate = buffer.toString(); >+ return commitTemplate.replaceAll("[ ]+", " "); //$NON-NLS-1$ //$NON-NLS-2$ > } > > private String processKeyword(ITask task, String keyword) { >#P org.eclipse.mylyn.team.tests >Index: src/org/eclipse/mylyn/team/tests/CommitTemplateTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.team.tests/src/org/eclipse/mylyn/team/tests/CommitTemplateTest.java,v >retrieving revision 1.11 >diff -u -r1.11 CommitTemplateTest.java >--- src/org/eclipse/mylyn/team/tests/CommitTemplateTest.java 13 Jan 2009 07:05:14 -0000 1.11 >+++ src/org/eclipse/mylyn/team/tests/CommitTemplateTest.java 18 Feb 2010 00:35:06 -0000 >@@ -44,6 +44,54 @@ > > } > >+ public void testTemplateNullKeyTrailingCharacters() { >+ String template = "${task.status} - ${connector.task.prefix} ${task.key}: ${task.description}"; >+ >+ String taskId = "12345678"; >+ TaskTask testTask = new TaskTask("no url", taskId, "summary"); >+ testTask.setTaskKey(null); >+ testTask.setSummary("TestSummary"); >+ >+ String commitComment = FocusedTeamUiPlugin.getDefault().getCommitTemplateManager().generateComment(testTask, >+ template); >+ assertTrue(commitComment.contains(testTask.getSummary())); >+ >+ assertTrue(commitComment.contains(":")); >+ assertEquals("Incomplete - : TestSummary", commitComment); >+ } >+ >+ public void testTemplateCollapseWhitespace() { >+ String template = "${task.status} - ${connector.task.prefix} ${task.key} ${task.key} : ${task.description}"; >+ >+ String taskId = "12345678"; >+ TaskTask testTask = new TaskTask("no url", taskId, "summary"); >+ testTask.setTaskKey(null); >+ testTask.setSummary("TestSummary"); >+ >+ String commitComment = FocusedTeamUiPlugin.getDefault().getCommitTemplateManager().generateComment(testTask, >+ template); >+ assertTrue(commitComment.contains(testTask.getSummary())); >+ >+ assertFalse(commitComment.contains(" ")); >+ assertEquals("Incomplete - : TestSummary", commitComment); >+ } >+ >+ public void testTemplateWithTab() { >+ String template = "${task.status} - \t${connector.task.prefix} ${task.key} ${task.key} : ${task.description}"; >+ >+ String taskId = "12345678"; >+ TaskTask testTask = new TaskTask("no url", taskId, "summary"); >+ testTask.setTaskKey(null); >+ testTask.setSummary("TestSummary"); >+ >+ String commitComment = FocusedTeamUiPlugin.getDefault().getCommitTemplateManager().generateComment(testTask, >+ template); >+ assertTrue(commitComment.contains(testTask.getSummary())); >+ >+ assertTrue(commitComment.contains("\t")); >+ assertEquals("Incomplete - \t : TestSummary", commitComment); >+ } >+ > public void testRepositoryTaskCommentParsing() { > String template = FocusedTeamUiPlugin.getDefault().getPreferenceStore().getString( > FocusedTeamUiPlugin.COMMIT_TEMPLATE);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 249572
:
159339
|
159391
| 159393