[PATCH 04/14] git p4: inline listExistingP4GitBranches

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx>
---
 git-p4.py | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/git-p4.py b/git-p4.py
index 03680b0..8814049 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -2518,13 +2518,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:
@@ -2805,7 +2798,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:
-- 
1.8.1.350.gdbf6fd0

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]