Fix updating/creating remotes/p4/* heads from origin/p4/*
Signed-off-by: Simon Hausmann <simon@lst.de>
Simon Hausmann committed
Jun 10, 2007 at 10:57 UTC
cae7b732d859b06a4f560271099891f15c5700f6
1 file changed
+6
-4
contrib/fast-import/git-p4
+6
-4
@@ -960,14 +960,16 @@ class P4Sync(Command):
960
print ("Creating/updating branch(es) in %s based on origin branch(es)"
961
% self.refPrefix)
962
963
+ originPrefix = "origin/p4/"
964
+
965
for line in read_pipe_lines("git rev-parse --symbolic --remotes"):
966
line = line.strip()
965
- if (not line.startswith("origin/")) or line.endswith("HEAD"):
967
+ if (not line.startswith(originPrefix)) or line.endswith("HEAD"):
968
continue
969
968
- headName = line[len("origin/"):]
970
+ headName = line[len(originPrefix):]
971
remoteHead = self.refPrefix + headName
970
- originHead = "origin/" + headName
972
+ originHead = line
973
974
original = extractSettingsGitLog(extractLogMessageFromGitCommit(originHead))
975
if (not original.has_key('depot-paths')
@@ -1020,7 +1022,7 @@ class P4Sync(Command):
1022
# map from branch depot path to parent branch
1023
self.knownBranches = {}
1024
self.initialParents = {}
1023
- self.hasOrigin = gitBranchExists("origin")
1025
+ self.hasOrigin = gitBranchExists("origin") or gitBranchExists("origin/p4") or gitBranchExists("origin/p4/master")
1026
1027
if self.importIntoRemotes:
1028
self.refPrefix = "refs/remotes/p4/"