Author: hmbrand
Date: Wed Sep 16 03:50:31 2009
New Revision: 13345

Modified:
   dbi/trunk/git-svn-vsn.pl

Log:
Also remove blib copy of .pm, as otherwise the changes have no effect at all

Modified: dbi/trunk/git-svn-vsn.pl
==============================================================================
--- dbi/trunk/git-svn-vsn.pl    (original)
+++ dbi/trunk/git-svn-vsn.pl    Wed Sep 16 03:50:31 2009
@@ -12,7 +12,9 @@
     -f $_ && $_ =~ m/\.pm$/ or return;
     my $f = $_;
     my $pm = do { local (@ARGV, $/) = ($_); scalar <> };
+    #print STDERR "$File::Find::name (@{[length $pm]})\n";
     $pm =~ m/\$(Id|Revision)\$/ or return;
+    #print STDERR "$File::Find::name ...\n";
     open my $gl, "-|", "git log -1 $f";
     my ($svn_id, $svn_date, $svn_author) = ("", "");
     while (<$gl>) {
@@ -20,6 +22,7 @@
        m/^Date:\s*(.*)/                        and $svn_date   = $1;
        m/^Author:\s*(\S+)/                     and $svn_author = $1;
        }
+    #print STDERR "  + $svn_id, $svn_author, $svn_date\n";
     $svn_id or return;
 
     my $dt = DateTime::Format::DateParse->parse_datetime ($svn_date);
@@ -28,7 +31,7 @@
     $pm =~ s/\$Id\$/\$Id: $f $svn_id $dt $svn_author \$/g;
 
     my @st = stat $f;
-    unlink $f;
+    unlink $f, "b$f";  # Remove both lib and blib version
     open my $fh, ">", $f or die "Cannot update $File::Find::name: $!\n";
     print $fh $pm;
     close $fh;

Reply via email to