]> source.dussan.org Git - gitblit.git/commitdiff
Create ticket/N branch on pt start N 61/61/1
authorJames Moger <james.moger@gitblit.com>
Mon, 5 May 2014 17:40:57 +0000 (13:40 -0400)
committerJames Moger <james.moger@gitblit.com>
Mon, 5 May 2014 17:40:57 +0000 (13:40 -0400)
src/main/java/pt.py

index 02c4168ad65ca63b9423f9bc9bffd45efd1537e5..f45baded0bbab7e5a392065be326d94c6218290a 100644 (file)
@@ -206,6 +206,12 @@ def start(args):
             branches.append(branch.strip())
 
     branch = 'topic/' + args.topic
+    try:
+        int(args.topic)
+        branch = 'ticket/' + args.topic
+    except ValueError:
+        pass
+
     illegals = set(branches) & {'topic', branch}
 
     # ensure there are no local branch names that will interfere with branch creation
@@ -246,6 +252,13 @@ def propose(args):
                         push_ref = topic
                     except ValueError:
                         pass
+                if curr_branch.startswith('ticket/'):
+                    topic = curr_branch[7:].strip()
+                    try:
+                        int(topic)
+                        push_ref = topic
+                    except ValueError:
+                        pass
         if push_ref is None:
             push_ref = 'new'
     else: