summaryrefslogtreecommitdiff
path: root/contrib/fast-import/p4-fast-export.py
diff options
context:
space:
mode:
authorLibravatar Simon Hausmann <simon@lst.de>2007-02-12 21:44:02 +0100
committerLibravatar Simon Hausmann <simon@lst.de>2007-02-12 21:44:02 +0100
commit53b03239aa899677bcadf69f757354b72797e457 (patch)
treeedb48582c7ebbeae2f536f294270e465f9e65771 /contrib/fast-import/p4-fast-export.py
parentMore fixes in heuristic p4 branch detection based on common path components. (diff)
downloadtgif-53b03239aa899677bcadf69f757354b72797e457.tar.xz
After marking a p4 branch as merged don't ever merge it in git again.
Signed-off-by: Simon Hausmann <simon@lst.de>
Diffstat (limited to 'contrib/fast-import/p4-fast-export.py')
-rwxr-xr-xcontrib/fast-import/p4-fast-export.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/fast-import/p4-fast-export.py b/contrib/fast-import/p4-fast-export.py
index f9653f1344..5838ca3c68 100755
--- a/contrib/fast-import/p4-fast-export.py
+++ b/contrib/fast-import/p4-fast-export.py
@@ -171,6 +171,8 @@ def commit(details, files, branch, branchPrefix):
gitStream.write("from %s\n" % initialParent)
initialParent = ""
+ mergedBranches = set()
+
for file in files:
path = file["path"]
if not path.startswith(branchPrefix):
@@ -202,8 +204,9 @@ def commit(details, files, branch, branchPrefix):
relPath = source[len(globalPrefix):]
for branch in knownBranches:
- if relPath.startswith(branch):
+ if relPath.startswith(branch) and branch not in mergedBranches:
gitStream.write("merge refs/heads/%s\n" % branch)
+ mergedBranches.add(branch)
break
for file in files: