Skip to content

Commit

Permalink
Avoid creating non-p4 branches in remotes/p4 off of remotes/origin
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Hausmann <simon@lst.de>
  • Loading branch information
Simon Hausmann committed May 25, 2007
1 parent 10f880f commit 65c5f3e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions contrib/fast-import/git-p4
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 65c5f3e

Please sign in to comment.