@matheusbsbs / matheus-bagliano / commits / 71f7c0d0bb
Fork 0

Create a git tag for every changeset imported from perforce.

Signed-off-by: Simon Hausmann <hausmann@kde.org>

Simon Hausmann committed Jan 31, 2007 at 23:03 UTC 71f7c0d0bb20936fc831e49bbfc9355f1e5ca211
1 file changed +13 -2
contrib/fast-import/p4-fast-export.py
+13 -2
@@ -98,12 +98,17 @@ for change in changes:
98 author = description["user"]
99
100 gitStream.write("commit refs/heads/master\n")
101 + committer = ""
102 if author in users:
102 - gitStream.write("committer %s %s %s\n" % (users[author], epoch, tz))
103 + committer = "%s %s %s" % (users[author], epoch, tz)
104 else:
104 - gitStream.write("committer %s <a@b> %s %s\n" % (author, epoch, tz))
105 + committer = "%s <a@b> %s %s" % (author, epoch, tz)
106 +
107 + gitStream.write("committer %s\n" % committer)
108 +
109 gitStream.write("data <<EOT\n")
110 gitStream.write(description["desc"])
111 + gitStream.write("\n[ imported from %s; change %s ]\n" % (prefix, change))
112 gitStream.write("EOT\n\n")
113
114 fnum = 0
@@ -137,6 +142,12 @@ for change in changes:
142
143 gitStream.write("\n")
144
145 + gitStream.write("tag p4/%s\n" % change)
146 + gitStream.write("from refs/heads/master\n");
147 + gitStream.write("tagger %s\n" % committer);
148 + gitStream.write("data 0\n\n")
149 +
150 +
151 gitStream.close()
152 gitOutput.close()
153 gitError.close()