git-p4: cope with labels with empty descriptions
authorLuke Diamand <luke@diamand.org>
Thu, 19 Jan 2012 09:52:26 +0000 (09:52 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 20 Jan 2012 22:47:35 +0000 (14:47 -0800)
Use an explicit length for the data in a label, rather
than EOT, so that labels with empty descriptions are
passed through correctly.

Signed-off-by: Luke Diamand <luke@diamand.org>
Acked-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/fast-import/git-p4

index e8c586e24217862f4740fe325c3a49748599d0e6..8aa84f2cafbe7cd1664398fbc25233a83595c82a 100755 (executable)
@@ -1741,9 +1741,11 @@ class P4Sync(Command, P4UserMap):
                     else:
                         tagger = "%s <a@b> %s %s" % (owner, epoch, self.tz)
                     self.gitStream.write("tagger %s\n" % tagger)
-                    self.gitStream.write("data <<EOT\n")
-                    self.gitStream.write(labelDetails["Description"])
-                    self.gitStream.write("EOT\n\n")
+
+                    description = labelDetails["Description"]
+                    self.gitStream.write("data %d\n" % len(description))
+                    self.gitStream.write(description)
+                    self.gitStream.write("\n")
 
                 else:
                     if not self.silent: