summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 77083da)
raw | patch | inline | side by side (parent: 77083da)
author | Simon Hausmann <simon@lst.de> | |
Mon, 12 Feb 2007 21:05:21 +0000 (22:05 +0100) | ||
committer | Simon Hausmann <simon@lst.de> | |
Mon, 12 Feb 2007 21:05:21 +0000 (22:05 +0100) |
Signed-off-by: Simon Hausmann <simon@lst.de>
contrib/fast-import/p4-fast-export.py | patch | blob | history |
index 488533b07e094d5f94e0ae516d9c657ef76a25a4..0a3e5c993448e6094d18ac8639ff1ed7c3853a59 100755 (executable)
gitStream.write("from %s\n" % initialParent)
initialParent = ""
- mergedBranches = set()
+ #mergedBranches = set()
+ merge = 0
for file in files:
path = file["path"]
if source.startswith(branchPrefix):
continue
- relPath = source[len(globalPrefix):]
+ lastSourceRev = log["erev0,0"]
- for branch in knownBranches:
- if relPath.startswith(branch) and branch not in mergedBranches:
- gitStream.write("merge refs/heads/%s\n" % branch)
- mergedBranches.add(branch)
- break
+ sourceLog = p4CmdList("filelog -m 1 \"%s%s\"" % (source, lastSourceRev))
+ if len(sourceLog) != 1:
+ print "eek! I got confused by the source filelog of %s%s" % (source, lastSourceRev)
+ sys.exit(1);
+ sourceLog = sourceLog[0]
+
+ change = int(sourceLog["change0"])
+ if change > merge:
+ merge = change
+
+# relPath = source[len(globalPrefix):]
+#
+# for branch in knownBranches:
+# if relPath.startswith(branch) and branch not in mergedBranches:
+# gitStream.write("merge refs/heads/%s\n" % branch)
+# mergedBranches.add(branch)
+# break
+
+ if merge != 0:
+ gitStream.write("merge :%s\n" % merge)
for file in files:
path = file["path"]