summaryrefslogtreecommitdiff
path: root/git-p4.py
diff options
context:
space:
mode:
authorPete Wyckoff <pw@padd.com>2013-01-14 19:46:56 -0500
committerJunio C Hamano <gitster@pobox.com>2013-01-15 09:46:29 -0800
commit991a2de45af713ad6476c3d03aefb30ba5599bfe (patch)
treecd43a17abf87db7707d6a4fb1077255ea899c11e /git-p4.py
parent46738bd7e9209e9a636dfddb46e32fd606386d81 (diff)
downloadgit-991a2de45af713ad6476c3d03aefb30ba5599bfe.tar.gz
git p4: rearrange and simplify hasOrigin handling
Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-p4.py')
-rwxr-xr-xgit-p4.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/git-p4.py b/git-p4.py
index 551aec9417..e9127319d4 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -2748,23 +2748,23 @@ class P4Sync(Command, P4UserMap):
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"