/[scripts]/trunk/svn2git.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/svn2git.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 121 - (show annotations)
Mon Sep 14 21:53:10 2009 UTC (14 years, 6 months ago) by dpavlin
File MIME type: text/plain
File size: 736 byte(s)
added -a to git commit
1 #!/usr/bin/perl
2
3 use warnings;
4 use strict;
5
6 # svn2git.pl
7 #
8 # 09/12/2009 09:27:10 PM CEST Dobrica Pavlinusic <dpavlin@rot13.org>
9
10 use File::Slurp;
11
12 my ( $repo, $rev ) = split(/\s+/, read_file '.svn2git' );
13
14 warn "# $repo $rev\n";
15
16 system("svn export -r $rev --force $repo .") == 0
17 or die "can't checkout revision $rev: $?";
18
19 my $log = `svn log $repo -r $rev`;
20 $log =~ s/^-{72}$//gm;
21
22 write_file '/tmp/log', $log;
23
24 system "git diff > /tmp/$rev.diff";
25
26 die "no changes in revision $rev" if -z "/tmp/$rev.diff";
27
28 system "vi -R -o /tmp/log /tmp/$rev.diff";
29
30 print "\nenter to commit changes or CTRL+C to abort\n";
31 <STDIN>;
32
33 $rev++;
34 write_file '/tmp/.svn2git', "$repo $rev";
35 system "git commit -F /tmp/log -a && mv /tmp/.svn2git .svn2git";
36

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26