From 30944790224238a2efa3f7dc8fdb749e2dd63ed2 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Tue, 17 Apr 2007 00:29:34 +0000 Subject: [PATCH] implemented #469 "Allow more than one tags on the same build" git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@3133 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/scm/CVSSCM.java | 13 ++-- .../scm/CVSSCM/TagAction/alreadyTagged.jelly | 34 ---------- .../hudson/scm/CVSSCM/TagAction/tagForm.jelly | 62 +++++++++++++++++-- 3 files changed, 66 insertions(+), 43 deletions(-) delete mode 100644 core/src/main/resources/hudson/scm/CVSSCM/TagAction/alreadyTagged.jelly diff --git a/core/src/main/java/hudson/scm/CVSSCM.java b/core/src/main/java/hudson/scm/CVSSCM.java index bdc54eadc7..74a63071a1 100644 --- a/core/src/main/java/hudson/scm/CVSSCM.java +++ b/core/src/main/java/hudson/scm/CVSSCM.java @@ -1017,6 +1017,7 @@ public class CVSSCM extends AbstractCVSFamilySCM implements Serializable { /** * If non-null, that means the build is already tagged. + * If multiple tags are created, those are whitespace-separated. */ private volatile String tagName; @@ -1047,8 +1048,9 @@ public class CVSSCM extends AbstractCVSFamilySCM implements Serializable { return "tagBuild"; } - public String getTagName() { - return tagName; + public String[] getTagNames() { + if(tagName==null) return new String[0]; + return tagName.split(" "); } public TagWorkerThread getWorkerThread() { @@ -1065,8 +1067,6 @@ public class CVSSCM extends AbstractCVSFamilySCM implements Serializable { } private synchronized String chooseAction() { - if(tagName!=null) - return "alreadyTagged.jelly"; if(workerThread!=null) return "inProgress.jelly"; return "tagForm.jelly"; @@ -1207,7 +1207,10 @@ public class CVSSCM extends AbstractCVSFamilySCM implements Serializable { * Atomically set the tag name and then be done with {@link TagWorkerThread}. */ private synchronized void onTagCompleted(String tagName) { - this.tagName = tagName; + if(this.tagName!=null) + this.tagName += ' '+tagName; + else + this.tagName = tagName; this.workerThread = null; } } diff --git a/core/src/main/resources/hudson/scm/CVSSCM/TagAction/alreadyTagged.jelly b/core/src/main/resources/hudson/scm/CVSSCM/TagAction/alreadyTagged.jelly deleted file mode 100644 index 2747012b26..0000000000 --- a/core/src/main/resources/hudson/scm/CVSSCM/TagAction/alreadyTagged.jelly +++ /dev/null @@ -1,34 +0,0 @@ - - - - -

Build #${it.build.number}

-

- This build is already tagged as ${it.tagName} -

- - - -

Upstream tags

- - - - - - - - - - - -
BuildTag
- ${up.key.name} - - - - ${h.ifThenElse(tag==null,'Not tagged',tag)} -
-
-
-
-
\ No newline at end of file diff --git a/core/src/main/resources/hudson/scm/CVSSCM/TagAction/tagForm.jelly b/core/src/main/resources/hudson/scm/CVSSCM/TagAction/tagForm.jelly index 1ecf24c4cf..85adce2b4d 100644 --- a/core/src/main/resources/hudson/scm/CVSSCM/TagAction/tagForm.jelly +++ b/core/src/main/resources/hudson/scm/CVSSCM/TagAction/tagForm.jelly @@ -4,10 +4,9 @@ This belongs to a build view. --> - - - -

Build #${it.build.number}

+ + +
@@ -31,6 +30,61 @@
+
+
+ + + + +

Build #${it.build.number}

+ + + + +

+ This build is already tagged as + + + ${t} + +

+ +

+ +

+ + + + + +

Upstream tags

+ + + + + + + + + + + +
BuildTag
+ ${up.key.name} + + + + ${h.ifThenElse(tag==null,'Not tagged',tag)} +
+
+
+ + + +
\ No newline at end of file