mirror of
https://github.com/git/git.git
synced 2024-05-21 10:26:08 +02:00
git p4: inline listExistingP4GitBranches
It is four lines of code used in only one place. Simplify by including it where it is used. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
2c8037edee
commit
3b650fc986
14
git-p4.py
14
git-p4.py
|
@ -2512,13 +2512,6 @@ def getBranchMappingFromGitBranches(self):
|
||||||
branch = branch[len(self.projectName):]
|
branch = branch[len(self.projectName):]
|
||||||
self.knownBranches[branch] = branch
|
self.knownBranches[branch] = branch
|
||||||
|
|
||||||
def listExistingP4GitBranches(self):
|
|
||||||
# branches holds mapping from name to commit
|
|
||||||
branches = p4BranchesInGit(self.importIntoRemotes)
|
|
||||||
self.p4BranchesInGit = branches.keys()
|
|
||||||
for branch in branches.keys():
|
|
||||||
self.initialParents[self.refPrefix + branch] = branches[branch]
|
|
||||||
|
|
||||||
def updateOptionDict(self, d):
|
def updateOptionDict(self, d):
|
||||||
option_keys = {}
|
option_keys = {}
|
||||||
if self.keepRepoPath:
|
if self.keepRepoPath:
|
||||||
|
@ -2799,7 +2792,12 @@ def run(self, args):
|
||||||
if args == []:
|
if args == []:
|
||||||
if self.hasOrigin:
|
if self.hasOrigin:
|
||||||
createOrUpdateBranchesFromOrigin(self.refPrefix, self.silent)
|
createOrUpdateBranchesFromOrigin(self.refPrefix, self.silent)
|
||||||
self.listExistingP4GitBranches()
|
|
||||||
|
# branches holds mapping from branch name to sha1
|
||||||
|
branches = p4BranchesInGit(self.importIntoRemotes)
|
||||||
|
self.p4BranchesInGit = branches.keys()
|
||||||
|
for branch in branches.keys():
|
||||||
|
self.initialParents[self.refPrefix + branch] = branches[branch]
|
||||||
|
|
||||||
if len(self.p4BranchesInGit) > 1:
|
if len(self.p4BranchesInGit) > 1:
|
||||||
if not self.silent:
|
if not self.silent:
|
||||||
|
|
Loading…
Reference in New Issue