From: Pete Wyckoff Date: Tue, 15 Jan 2013 00:46:58 +0000 (-0500) Subject: git p4: inline listExistingP4GitBranches X-Git-Tag: v1.8.2-rc0~101^2~10 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/3b650fc9869a51190578aed8014d906f01f510a9 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 Signed-off-by: Junio C Hamano --- diff --git a/git-p4.py b/git-p4.py index de88680f2c..2443f79e07 100755 --- a/git-p4.py +++ b/git-p4.py @@ -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: