提交 3b650fc9 编写于 作者: P Pete Wyckoff 提交者: Junio C Hamano

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: NPete Wyckoff <pw@padd.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 2c8037ed
......@@ -2512,13 +2512,6 @@ def getBranchMappingFromGitBranches(self):
branch = branch[len(self.projectName):]
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):
option_keys = {}
if self.keepRepoPath:
......@@ -2799,7 +2792,12 @@ def run(self, args):
if args == []:
if self.hasOrigin:
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 not self.silent:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册