import-trac: strip out ^M from newlines
authorGreg Price <price@mit.edu>
Sun, 1 Feb 2009 06:25:35 +0000 (01:25 -0500)
committerGreg Price <price@mit.edu>
Sun, 1 Feb 2009 06:25:35 +0000 (01:25 -0500)
import-trac

index 3ecfe35c0ac9a17d6278243b49cd80001ab219b5..aadee09f336345ea2119acee7e8d05c73e3c6b96 100755 (executable)
@@ -16,8 +16,10 @@ foreach $row (@$rows) {
   next if $row->{author} eq 'trac';
   print "Processing revision $row->{version} of $row->{name} by $row->{author}...";
 
+  ($text = $row->{text}) =~ s/\r\n/\n/g;
+
   $pid = open2(OUT, IN, qw(git hash-object -w --stdin));
-  print IN $row->{text};
+  print IN $text;
   close(IN);
   chomp($blob = <OUT>);
   waitpid $pid, 0;