summaryrefslogtreecommitdiff
path: root/git-p4.py
diff options
context:
space:
mode:
authorPete Wyckoff <pw@padd.com>2013-01-15 00:46:58 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-01-15 17:46:29 (GMT)
commit3b650fc9869a51190578aed8014d906f01f510a9 (patch)
treec946c63db3edb1ae59bf046df435dce78fb938c9 /git-p4.py
parent2c8037edeef9ae6f510335587c04081e58564758 (diff)
downloadgit-3b650fc9869a51190578aed8014d906f01f510a9.zip
git-3b650fc9869a51190578aed8014d906f01f510a9.tar.gz
git-3b650fc9869a51190578aed8014d906f01f510a9.tar.bz2
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>
Diffstat (limited to 'git-p4.py')
-rwxr-xr-xgit-p4.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/git-p4.py b/git-p4.py
index de88680..2443f79 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -2512,13 +2512,6 @@ class P4Sync(Command, P4UserMap):
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 @@ class P4Sync(Command, P4UserMap):
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: