create lightweight tags instead of full tag objects for the incremental import

This commit is contained in:
Simon Hausmann
2007-02-11 18:04:39 +01:00
parent 55cb3cb611
commit 00f20aa0e5

View File

@@ -170,9 +170,14 @@ if len(changeRange) == 0:
try: try:
sout, sin, serr = popen2.popen3("git-name-rev --tags `git-rev-parse %s`" % branch) sout, sin, serr = popen2.popen3("git-name-rev --tags `git-rev-parse %s`" % branch)
output = sout.read() output = sout.read()
if output.endswith("\n"):
output = output[:-1]
tagIdx = output.index(" tags/p4/") tagIdx = output.index(" tags/p4/")
caretIdx = output.index("^") caretIdx = output.find("^")
rev = int(output[tagIdx + 9 : caretIdx]) + 1 endPos = len(output)
if caretIdx != -1:
endPos = caretIdx
rev = int(output[tagIdx + 9 : endPos]) + 1
changeRange = "@%s,#head" % rev changeRange = "@%s,#head" % rev
initialParent = os.popen("git-rev-parse %s" % branch).read()[:-1] initialParent = os.popen("git-rev-parse %s" % branch).read()[:-1]
initialTag = "p4/%s" % (int(rev) - 1) initialTag = "p4/%s" % (int(rev) - 1)
@@ -247,10 +252,9 @@ else:
print "" print ""
gitStream.write("tag p4/%s\n" % lastChange) gitStream.write("reset refs/tags/p4/%s\n" % lastChange)
gitStream.write("from %s\n" % branch); gitStream.write("from %s\n\n" % branch);
gitStream.write("tagger %s\n" % lastCommitter);
gitStream.write("data 0\n\n")
gitStream.close() gitStream.close()
gitOutput.close() gitOutput.close()