summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorSimon Hausmann <simon@lst.de>2007-05-25 06:44:41 (GMT)
committerSimon Hausmann <simon@lst.de>2007-05-25 06:44:41 (GMT)
commit65c5f3e3f2dfb470c16628032235222a492e3239 (patch)
treec09539aeca287d44d92bac9aecd35c962554e615 /contrib
parent10f880f8d4e2c6390928a0bcc8b43161b5f845b2 (diff)
downloadgit-65c5f3e3f2dfb470c16628032235222a492e3239.zip
git-65c5f3e3f2dfb470c16628032235222a492e3239.tar.gz
git-65c5f3e3f2dfb470c16628032235222a492e3239.tar.bz2
Avoid creating non-p4 branches in remotes/p4 off of remotes/origin
Signed-off-by: Simon Hausmann <simon@lst.de>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/fast-import/git-p48
1 files changed, 6 insertions, 2 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 08af23f..1cce38a 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -802,19 +802,23 @@ class P4Sync(Command):
for line in mypopen("git rev-parse --symbolic --remotes"):
if (not line.startswith("origin/")) or line.endswith("HEAD\n"):
continue
+
headName = line[len("origin/"):-1]
remoteHead = self.refPrefix + headName
originHead = "origin/" + headName
+ [originPreviousDepotPath, originP4Change] = extractDepotPathAndChangeFromGitLog(extractLogMessageFromGitCommit(originHead))
+ if len(originPreviousDepotPath) == 0 or len(originP4Change) == 0:
+ continue
+
update = False
if not os.path.exists(gitdir + "/" + remoteHead):
if self.verbose:
print "creating %s" % remoteHead
update = True
else:
- [originPreviousDepotPath, originP4Change] = extractDepotPathAndChangeFromGitLog(extractLogMessageFromGitCommit(originHead))
[p4PreviousDepotPath, p4Change] = extractDepotPathAndChangeFromGitLog(extractLogMessageFromGitCommit(remoteHead))
- if len(originPreviousDepotPath) > 0 and len(originP4Change) > 0 and len(p4Change) > 0:
+ if len(p4Change) > 0:
if originPreviousDepotPath == p4PreviousDepotPath:
originP4Change = int(originP4Change)
p4Change = int(p4Change)