Avoid creating non-p4 branches in remotes/p4 off of remotes/origin
Signed-off-by: Simon Hausmann <simon@lst.de>
Simon Hausmann committed
May 25, 2007 at 08:44 UTC
65c5f3e3f2dfb470c16628032235222a492e3239
1 file changed
+6
-2
contrib/fast-import/git-p4
+6
-2
@@ -802,19 +802,23 @@ class P4Sync(Command):
802
for line in mypopen("git rev-parse --symbolic --remotes"):
803
if (not line.startswith("origin/")) or line.endswith("HEAD\n"):
804
continue
805
+
806
headName = line[len("origin/"):-1]
807
remoteHead = self.refPrefix + headName
808
originHead = "origin/" + headName
809
810
+ [originPreviousDepotPath, originP4Change] = extractDepotPathAndChangeFromGitLog(extractLogMessageFromGitCommit(originHead))
811
+ if len(originPreviousDepotPath) == 0 or len(originP4Change) == 0:
812
+ continue
813
+
814
update = False
815
if not os.path.exists(gitdir + "/" + remoteHead):
816
if self.verbose:
817
print "creating %s" % remoteHead
818
update = True
819
else:
815
- [originPreviousDepotPath, originP4Change] = extractDepotPathAndChangeFromGitLog(extractLogMessageFromGitCommit(originHead))
820
[p4PreviousDepotPath, p4Change] = extractDepotPathAndChangeFromGitLog(extractLogMessageFromGitCommit(remoteHead))
817
- if len(originPreviousDepotPath) > 0 and len(originP4Change) > 0 and len(p4Change) > 0:
821
+ if len(p4Change) > 0:
822
if originPreviousDepotPath == p4PreviousDepotPath:
823
originP4Change = int(originP4Change)
824
p4Change = int(p4Change)