From a502d96a860456ec5e8c96761db70f7cabb74751 Mon Sep 17 00:00:00 2001
From: Paul Martin <paul@paulsputer.com>
Date: Sat, 30 Apr 2016 04:19:14 -0400
Subject: [PATCH] Merge pull request #1073 from gitblit/1062-DocEditorUpdates

---
 src/main/java/pt.py |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/src/main/java/pt.py b/src/main/java/pt.py
index fcfe500..f45bade 100644
--- a/src/main/java/pt.py
+++ b/src/main/java/pt.py
@@ -54,9 +54,9 @@
         # 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)
@@ -206,6 +206,12 @@
             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
@@ -241,6 +247,13 @@
                 curr_branch = branch[1:].strip()
                 if curr_branch.startswith('topic/'):
                     topic = curr_branch[6:].strip()
+                    try:
+                        int(topic)
+                        push_ref = topic
+                    except ValueError:
+                        pass
+                if curr_branch.startswith('ticket/'):
+                    topic = curr_branch[7:].strip()
                     try:
                         int(topic)
                         push_ref = topic
@@ -288,7 +301,7 @@
         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
 

--
Gitblit v1.9.1