File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -281,6 +281,19 @@ def createOrUpdateBranchesFromOrigin(localRefPrefix = "refs/remotes/p4/", silent
281281def originP4BranchesExist ():
282282 return gitBranchExists ("origin" ) or gitBranchExists ("origin/p4" ) or gitBranchExists ("origin/p4/master" )
283283
284+ def p4ChangesForPaths (depotPaths , changeRange ):
285+ assert depotPaths
286+ output = read_pipe_lines ("p4 changes " + ' ' .join (["%s...%s" % (p , changeRange )
287+ for p in depotPaths ]))
288+
289+ changes = []
290+ for line in output :
291+ changeNum = line .split (" " )[1 ]
292+ changes .append (int (changeNum ))
293+
294+ changes .sort ()
295+ return changes
296+
284297class Command :
285298 def __init__ (self ):
286299 self .usage = "usage: %prog [options]"
@@ -1322,15 +1335,7 @@ class P4Sync(Command):
13221335 if self .verbose :
13231336 print "Getting p4 changes for %s...%s" % (', ' .join (self .depotPaths ),
13241337 self .changeRange )
1325- assert self .depotPaths
1326- output = read_pipe_lines ("p4 changes " + ' ' .join (["%s...%s" % (p , self .changeRange )
1327- for p in self .depotPaths ]))
1328-
1329- for line in output :
1330- changeNum = line .split (" " )[1 ]
1331- changes .append (int (changeNum ))
1332-
1333- changes .sort ()
1338+ changes = p4ChangesForPaths (self .depotPaths , self .changeRange )
13341339
13351340 if len (self .maxChanges ) > 0 :
13361341 changes = changes [:min (int (self .maxChanges ), len (changes ))]
You can’t perform that action at this time.
0 commit comments