зеркало из https://github.com/microsoft/git.git
git p4: rearrange and simplify hasOrigin handling
Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Родитель
46738bd7e9
Коммит
991a2de45a
14
git-p4.py
14
git-p4.py
|
@ -2748,23 +2748,23 @@ class P4Sync(Command, P4UserMap):
|
||||||
self.changeRange = ""
|
self.changeRange = ""
|
||||||
self.initialParent = ""
|
self.initialParent = ""
|
||||||
self.previousDepotPaths = []
|
self.previousDepotPaths = []
|
||||||
|
self.hasOrigin = False
|
||||||
|
|
||||||
# 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 = originP4BranchesExist()
|
|
||||||
if not self.syncWithOrigin:
|
|
||||||
self.hasOrigin = False
|
|
||||||
|
|
||||||
if self.importIntoRemotes:
|
if self.importIntoRemotes:
|
||||||
self.refPrefix = "refs/remotes/p4/"
|
self.refPrefix = "refs/remotes/p4/"
|
||||||
else:
|
else:
|
||||||
self.refPrefix = "refs/heads/p4/"
|
self.refPrefix = "refs/heads/p4/"
|
||||||
|
|
||||||
if self.syncWithOrigin and self.hasOrigin:
|
if self.syncWithOrigin:
|
||||||
if not self.silent:
|
self.hasOrigin = originP4BranchesExist()
|
||||||
print "Syncing with origin first by calling git fetch origin"
|
if self.hasOrigin:
|
||||||
system("git fetch origin")
|
if not self.silent:
|
||||||
|
print 'Syncing with origin first, using "git fetch origin"'
|
||||||
|
system("git fetch origin")
|
||||||
|
|
||||||
if len(self.branch) == 0:
|
if len(self.branch) == 0:
|
||||||
self.branch = self.refPrefix + "master"
|
self.branch = self.refPrefix + "master"
|
||||||
|
|
Загрузка…
Ссылка в новой задаче