Could you add pod or a comment block to dbi/trunk/git-svn-vsn.pl to
explain what it's for and how/when to use it? That'll save people having
to stare at the code to work it out. Thanks.

Tim.

On Mon, Sep 14, 2009 at 05:17:15AM -0700, [email protected] wrote:
> Author: hmbrand
> Date: Mon Sep 14 05:17:13 2009
> New Revision: 13336
> 
> Added:
>    dbi/trunk/git-svn-vsn.pl   (contents, props changed)
> Modified:
>    dbi/trunk/Makefile.PL
>    dbi/trunk/dbiprof.PL
>    dbi/trunk/dbiproxy.PL
>    dbi/trunk/t/01basics.t
>    dbi/trunk/t/41prof_dump.t
>    dbi/trunk/t/pod-coverage.t
> 
> Log:
> Merijn uses git. These changes should not affect anyone else ...
> 
> Modified: dbi/trunk/Makefile.PL
> ==============================================================================
> --- dbi/trunk/Makefile.PL     (original)
> +++ dbi/trunk/Makefile.PL     Mon Sep 14 05:17:13 2009
> @@ -24,7 +24,7 @@
>  my $osvers = $Config{osvers};
>  $osvers =~ s/^\s*(\d+\.\d+).*/$1/;  # drop sub-sub-version: 2.5.1 -> 2.5
>  my $ext_pl = $^O eq 'VMS' ? '.pl' : '';
> -my $is_developer = (-d ".svn" && -f "MANIFEST.SKIP");
> +my $is_developer = ((-d ".svn" || -d ".git") && -f "MANIFEST.SKIP");
>  
>  $::opt_v = 0;
>  $::opt_thread = 1;   # thread if we can, use "-nothread" to disable
> @@ -189,7 +189,7 @@
>  
>  sub libscan {
>      my($self, $path) = @_;
> -    ($path =~ /\~$|\B\.svn\b/) ? undef : $path;
> +    ($path =~ /\~$|\B\.(svn|git)\b/) ? undef : $path;
>  }
>  
>  sub const_cccmd {
> 
> Modified: dbi/trunk/dbiprof.PL
> ==============================================================================
> --- dbi/trunk/dbiprof.PL      (original)
> +++ dbi/trunk/dbiprof.PL      Mon Sep 14 05:17:13 2009
> @@ -283,5 +283,5 @@
>  print "Extracted $file from ",__FILE__," with variable substitutions.\n";
>  
>  # syntax check resulting file, but only for developers
> -exit 1 if -d ".svn" and system($^X, '-wc', '-Mblib', $file) != 0;
> +exit 1 if -d ".svn"|| -d ".git" and system($^X, '-wc', '-Mblib', $file) != 0;
>  
> 
> Modified: dbi/trunk/dbiproxy.PL
> ==============================================================================
> --- dbi/trunk/dbiproxy.PL     (original)
> +++ dbi/trunk/dbiproxy.PL     Mon Sep 14 05:17:13 2009
> @@ -204,5 +204,5 @@
>  print "Extracted $file from ",__FILE__," with variable substitutions.\n";
>  
>  # syntax check resulting file, but only for developers
> -exit 1 if -d ".svn" and system($^X, '-wc', '-Mblib', $file) != 0;
> +exit 1 if -d ".svn" || -d ".git" and system($^X, '-wc', '-Mblib', $file) != 
> 0;
>  
> 
> Added: dbi/trunk/git-svn-vsn.pl
> ==============================================================================
> --- (empty file)
> +++ dbi/trunk/git-svn-vsn.pl  Mon Sep 14 05:17:13 2009
> @@ -0,0 +1,35 @@
> +#!/pro/bin/perl
> +
> +use strict;
> +use warnings;
> +
> +use File::Find;
> +#use DateTime;
> +use DateTime::Format::DateParse;
> +
> +find (sub {
> +    -f $_ && $_ =~ m/\.pm$/ or return;
> +    my $f = $_;
> +    my $pm = do { local (@ARGV, $/) = ($_); scalar <> };
> +    $pm =~ m/\$(Id|Revision)\$/ or return;
> +    open my $gl, "-|", "git log -1 $f";
> +    my ($svn_id, $svn_date, $svn_author) = ("", "");
> +    while (<$gl>) {
> +     m/git-svn-id:.*?trunk\@([0-9]+)/        and $svn_id     = $1;
> +     m/^Date:\s*(.*)/                        and $svn_date   = $1;
> +     m/^Author:\s*(\S+)/                     and $svn_author = $1;
> +     }
> +    $svn_id or return;
> +
> +    my $dt = DateTime::Format::DateParse->parse_datetime ($svn_date);
> +    $dt = $dt->ymd . " " . $dt->hms . "Z";
> +    $pm =~ s/\$Revision\$/\$Revision: $svn_id \$/g;
> +    $pm =~ s/\$Id\$/\$Id: $f $svn_id $dt $svn_author \$/g;
> +
> +    my @st = stat $f;
> +    unlink $f;
> +    open my $fh, ">", $f or die "Cannot update $File::Find::name: $!\n";
> +    print $fh $pm;
> +    close $fh;
> +    utime $st[8], $st[9], $f;
> +    }, "lib");
> 
> Modified: dbi/trunk/t/01basics.t
> ==============================================================================
> --- dbi/trunk/t/01basics.t    (original)
> +++ dbi/trunk/t/01basics.t    Mon Sep 14 05:17:13 2009
> @@ -288,7 +288,7 @@
>  # restrict this test to just developers
>  
>  SKIP: {
> -     skip 'developer tests', 4 unless -d ".svn";
> +     skip 'developer tests', 4 unless -d ".svn" || -d ".git";
>  
>       print "Test DBI->installed_versions (for @drivers)\n";
>       print "(If one of those drivers, or the configuration for it, is bad\n";
> 
> Modified: dbi/trunk/t/41prof_dump.t
> ==============================================================================
> --- dbi/trunk/t/41prof_dump.t (original)
> +++ dbi/trunk/t/41prof_dump.t Mon Sep 14 05:17:13 2009
> @@ -91,7 +91,7 @@
>  # this also naturally checks for syntax errors etc.
>  SKIP: {
>      skip "developer-only test", 1
> -        unless -d ".svn" && -f "MANIFEST.SKIP";
> +        unless (-d ".svn" || -d ".git") && -f "MANIFEST.SKIP";
>      skip "Apache module not installed", 1
>          unless eval { require Apache };
>      require_ok('DBI::ProfileDumper::Apache')
> 
> Modified: dbi/trunk/t/pod-coverage.t
> ==============================================================================
> --- dbi/trunk/t/pod-coverage.t        (original)
> +++ dbi/trunk/t/pod-coverage.t        Mon Sep 14 05:17:13 2009
> @@ -3,6 +3,6 @@
>  use Test::More;
>  eval "use Test::Pod::Coverage 1.04";
>  plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD 
> coverage" if $@;
> -plan skip_all => "Currently a developer-only test" unless -d '.svn';
> +plan skip_all => "Currently a developer-only test" unless -d '.svn' || -d 
> ".git";
>  plan skip_all => "Currently FAILS FOR MANY MODULES!";
>  all_pod_coverage_ok();

Reply via email to