From a806d728a60525720e0ef6c5bcb7e7062a4835ad Mon Sep 17 00:00:00 2001 From: James Moger Date: Mon, 5 May 2014 13:40:57 -0400 Subject: [PATCH] Create ticket/N branch on pt start N --- src/main/java/pt.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/pt.py b/src/main/java/pt.py index 02c4168a..f45baded 100644 --- a/src/main/java/pt.py +++ b/src/main/java/pt.py @@ -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: -- 2.39.5