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>
Pete Wyckoff committed
Jan 14, 2013 at 19:46 UTC
3b650fc9869a51190578aed8014d906f01f510a9
1 file changed
+6
-8
git-p4.py
+6
-8
@@ -2512,13 +2512,6 @@ class P4Sync(Command, P4UserMap):
2512
branch = branch[len(self.projectName):]
2513
self.knownBranches[branch] = branch
2514
2515
- def listExistingP4GitBranches(self):
2516
- # branches holds mapping from name to commit
2517
- branches = p4BranchesInGit(self.importIntoRemotes)
2518
- self.p4BranchesInGit = branches.keys()
2519
- for branch in branches.keys():
2520
- self.initialParents[self.refPrefix + branch] = branches[branch]
2521
-
2515
def updateOptionDict(self, d):
2516
option_keys = {}
2517
if self.keepRepoPath:
@@ -2799,7 +2792,12 @@ class P4Sync(Command, P4UserMap):
2792
if args == []:
2793
if self.hasOrigin:
2794
createOrUpdateBranchesFromOrigin(self.refPrefix, self.silent)
2802
- self.listExistingP4GitBranches()
2795
+
2796
+ # branches holds mapping from branch name to sha1
2797
+ branches = p4BranchesInGit(self.importIntoRemotes)
2798
+ self.p4BranchesInGit = branches.keys()
2799
+ for branch in branches.keys():
2800
+ self.initialParents[self.refPrefix + branch] = branches[branch]
2801
2802
if len(self.p4BranchesInGit) > 1:
2803
if not self.silent: