After marking a p4 branch as merged don't ever merge it in git again.
Signed-off-by: Simon Hausmann <simon@lst.de>
Simon Hausmann committed
Feb 12, 2007 at 21:44 UTC
53b03239aa899677bcadf69f757354b72797e457
1 file changed
+4
-1
contrib/fast-import/p4-fast-export.py
+4
-1
@@ -171,6 +171,8 @@ def commit(details, files, branch, branchPrefix):
171
gitStream.write("from %s\n" % initialParent)
172
initialParent = ""
173
174
+ mergedBranches = set()
175
+
176
for file in files:
177
path = file["path"]
178
if not path.startswith(branchPrefix):
@@ -202,8 +204,9 @@ def commit(details, files, branch, branchPrefix):
204
relPath = source[len(globalPrefix):]
205
206
for branch in knownBranches:
205
- if relPath.startswith(branch):
207
+ if relPath.startswith(branch) and branch not in mergedBranches:
208
gitStream.write("merge refs/heads/%s\n" % branch)
209
+ mergedBranches.add(branch)
210
break
211
212
for file in files: