Shortcut the case where we have no origin branch
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
This commit is contained in:
@ -844,6 +844,7 @@ class P4Sync(Command):
|
|||||||
# map from branch depot path to parent branch
|
# map from branch depot path to parent branch
|
||||||
self.knownBranches = {}
|
self.knownBranches = {}
|
||||||
self.initialParents = {}
|
self.initialParents = {}
|
||||||
|
self.hasOrigin = gitBranchExists("origin")
|
||||||
|
|
||||||
if self.importIntoRemotes:
|
if self.importIntoRemotes:
|
||||||
self.refPrefix = "refs/remotes/p4/"
|
self.refPrefix = "refs/remotes/p4/"
|
||||||
@ -851,7 +852,7 @@ class P4Sync(Command):
|
|||||||
self.refPrefix = "refs/heads/"
|
self.refPrefix = "refs/heads/"
|
||||||
|
|
||||||
if self.syncWithOrigin:
|
if self.syncWithOrigin:
|
||||||
if gitBranchExists("origin"):
|
if self.hasOrigin:
|
||||||
if not self.silent:
|
if not self.silent:
|
||||||
print "Syncing with origin first by calling git fetch origin"
|
print "Syncing with origin first by calling git fetch origin"
|
||||||
system("git fetch origin")
|
system("git fetch origin")
|
||||||
@ -868,7 +869,8 @@ class P4Sync(Command):
|
|||||||
createP4HeadRef = True
|
createP4HeadRef = True
|
||||||
|
|
||||||
if len(args) == 0:
|
if len(args) == 0:
|
||||||
self.createOrUpdateBranchesFromOrigin()
|
if self.hasOrigin:
|
||||||
|
self.createOrUpdateBranchesFromOrigin()
|
||||||
self.listExistingP4GitBranches()
|
self.listExistingP4GitBranches()
|
||||||
|
|
||||||
if len(self.p4BranchesInGit) > 1:
|
if len(self.p4BranchesInGit) > 1:
|
||||||
|
Reference in New Issue
Block a user