From d69d73e5da5a12f279d5c0c38c871801739f33d6 Mon Sep 17 00:00:00 2001 From: James Moger Date: Mon, 5 May 2014 13:31:56 -0400 Subject: Switch to -u from deprecated --set-upstream --- src/main/java/pt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/pt.py') diff --git a/src/main/java/pt.py b/src/main/java/pt.py index 3b35c167..fcfe5006 100644 --- a/src/main/java/pt.py +++ b/src/main/java/pt.py @@ -289,7 +289,7 @@ def propose(args): # set the upstream branch configuration args.id = int(fields[1].strip()[len('--> #'):]) __call(['git', 'fetch', args.remote]) - __call(['git', 'branch', '--set-upstream-to={}/ticket/{:d}'.format(args.remote, args.id)]) + __call(['git', 'branch', '-u', '{}/ticket/{:d}'.format(args.remote, args.id)]) break return -- cgit v1.2.3 From 021c70877c889528c0629cac11cb5932f1126eb8 Mon Sep 17 00:00:00 2001 From: James Moger Date: Mon, 5 May 2014 13:37:46 -0400 Subject: Prune deleted branches on fetch --- src/main/java/pt.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java/pt.py') diff --git a/src/main/java/pt.py b/src/main/java/pt.py index fcfe5006..02c4168a 100644 --- a/src/main/java/pt.py +++ b/src/main/java/pt.py @@ -54,9 +54,9 @@ def fetch(args): # fetch all current ticket patchsets print("Fetching ticket patchsets from the '{}' repository".format(args.remote)) if args.quiet: - __call(['git', 'fetch', args.remote, '--quiet']) + __call(['git', 'fetch', '-p', args.remote, '--quiet']) else: - __call(['git', 'fetch', args.remote]) + __call(['git', 'fetch', '-p', args.remote]) else: # fetch specific patchset __resolve_patchset(args) @@ -288,7 +288,7 @@ def propose(args): if fields[0] == 'remote' and fields[1].strip().startswith('--> #'): # set the upstream branch configuration args.id = int(fields[1].strip()[len('--> #'):]) - __call(['git', 'fetch', args.remote]) + __call(['git', 'fetch', '-p', args.remote]) __call(['git', 'branch', '-u', '{}/ticket/{:d}'.format(args.remote, args.id)]) break -- cgit v1.2.3 From a806d728a60525720e0ef6c5bcb7e7062a4835ad Mon Sep 17 00:00:00 2001 From: James Moger Date: Mon, 5 May 2014 13:40:57 -0400 Subject: Create ticket/N branch on pt start N --- src/main/java/pt.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/main/java/pt.py') 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: -- cgit v1.2.3