Skip to content

Commit

Permalink
git p4: rearrange and simplify hasOrigin handling
Browse files Browse the repository at this point in the history
Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Pete Wyckoff authored and Junio C Hamano committed Jan 15, 2013
1 parent 46738bd commit 991a2de
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions git-p4.py
Original file line number Diff line number Diff line change
Expand Up @@ -2748,23 +2748,23 @@ def run(self, args):
self.changeRange = ""
self.initialParent = ""
self.previousDepotPaths = []
self.hasOrigin = False

# map from branch depot path to parent branch
self.knownBranches = {}
self.initialParents = {}
self.hasOrigin = originP4BranchesExist()
if not self.syncWithOrigin:
self.hasOrigin = False

if self.importIntoRemotes:
self.refPrefix = "refs/remotes/p4/"
else:
self.refPrefix = "refs/heads/p4/"

if self.syncWithOrigin and self.hasOrigin:
if not self.silent:
print "Syncing with origin first by calling git fetch origin"
system("git fetch origin")
if self.syncWithOrigin:
self.hasOrigin = originP4BranchesExist()
if self.hasOrigin:
if not self.silent:
print 'Syncing with origin first, using "git fetch origin"'
system("git fetch origin")

if len(self.branch) == 0:
self.branch = self.refPrefix + "master"
Expand Down

0 comments on commit 991a2de

Please sign in to comment.