git-p4: Allow filtering Perforce branches by user
[gitweb.git] / contrib / fast-import / git-p4
index 72a5b6c1830aef015ad1c371d365d593ffab4be0..6314c20ac1780e652d69143949b14b7e761e3917 100755 (executable)
@@ -1455,7 +1455,13 @@ class P4Sync(Command, P4UserMap):
     def getBranchMapping(self):
         lostAndFoundBranches = set()
 
-        for info in p4CmdList("branches"):
+        user = gitConfig("git-p4.branchUser")
+        if len(user) > 0:
+            command = "branches -u %s" % user
+        else:
+            command = "branches"
+
+        for info in p4CmdList(command):
             details = p4Cmd("branch -o %s" % info["branch"])
             viewIdx = 0
             while details.has_key("View%s" % viewIdx):