summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f7d63b0)
raw | patch | inline | side by side (parent: f7d63b0)
author | Simon Hausmann <simon@lst.de> | |
Sun, 11 Feb 2007 17:04:39 +0000 (18:04 +0100) | ||
committer | Simon Hausmann <simon@lst.de> | |
Sun, 11 Feb 2007 17:04:39 +0000 (18:04 +0100) |
Signed-off-by: Simon Hausmann <simon@lst.de>
contrib/fast-import/p4-fast-export.py | patch | blob | history |
index 1f19cbc5605ea9ae71b1555431271848d2326e64..989513888a026fe303ee23da01e20b3e9b1e0e27 100755 (executable)
try:
sout, sin, serr = popen2.popen3("git-name-rev --tags `git-rev-parse %s`" % branch)
output = sout.read()
+ if output.endswith("\n"):
+ output = output[:-1]
tagIdx = output.index(" tags/p4/")
- caretIdx = output.index("^")
- rev = int(output[tagIdx + 9 : caretIdx]) + 1
+ caretIdx = output.find("^")
+ endPos = len(output)
+ if caretIdx != -1:
+ endPos = caretIdx
+ rev = int(output[tagIdx + 9 : endPos]) + 1
changeRange = "@%s,#head" % rev
initialParent = os.popen("git-rev-parse %s" % branch).read()[:-1]
initialTag = "p4/%s" % (int(rev) - 1)
print ""
-gitStream.write("tag p4/%s\n" % lastChange)
-gitStream.write("from %s\n" % branch);
-gitStream.write("tagger %s\n" % lastCommitter);
-gitStream.write("data 0\n\n")
+gitStream.write("reset refs/tags/p4/%s\n" % lastChange)
+gitStream.write("from %s\n\n" % branch);
+
gitStream.close()
gitOutput.close()