git-svn: cleanup remove unused function
Also move tz_to_s_offset into Git::SVN::Log since that's the only place it's used now. Signed-off-by: Eric Wong <normalperson@yhbt.net>
Eric Wong committed
Jan 27, 2007 at 14:38 UTC
21819a370839fdae818975967cef384510e4a8cd
1 file changed
+8
-25
git-svn.perl
+8
-25
@@ -679,29 +679,6 @@ sub cmt_metadata {
679
command(qw/cat-file commit/, shift)))[-1]);
680
}
681
682
-sub get_commit_time {
683
- my $cmt = shift;
684
- my $fh = command_output_pipe(qw/rev-list --pretty=raw -n1/, $cmt);
685
- while (<$fh>) {
686
- /^committer\s(?:.+) (\d+) ([\-\+]?\d+)$/ or next;
687
- my ($s, $tz) = ($1, $2);
688
- if ($tz =~ s/^\+//) {
689
- $s += tz_to_s_offset($tz);
690
- } elsif ($tz =~ s/^\-//) {
691
- $s -= tz_to_s_offset($tz);
692
- }
693
- close $fh;
694
- return $s;
695
- }
696
- die "Can't get commit time for commit: $cmt\n";
697
-}
698
-
699
-sub tz_to_s_offset {
700
- my ($tz) = @_;
701
- $tz =~ s/(\d\d)$//;
702
- return ($1 * 60) + ($tz * 3600);
703
-}
704
-
682
package Git::SVN;
683
use strict;
684
use warnings;
@@ -2496,6 +2473,12 @@ sub run_pager {
2473
exec $pager or ::fatal "Can't run pager: $! ($pager)\n";
2474
}
2475
2476
+sub tz_to_s_offset {
2477
+ my ($tz) = @_;
2478
+ $tz =~ s/(\d\d)$//;
2479
+ return ($1 * 60) + ($tz * 3600);
2480
+}
2481
+
2482
sub get_author_info {
2483
my ($dest, $author, $t, $tz) = @_;
2484
$author =~ s/(?:^\s*|\s*$)//g;
@@ -2512,9 +2495,9 @@ sub get_author_info {
2495
$dest->{a} = $au;
2496
# Date::Parse isn't in the standard Perl distro :(
2497
if ($tz =~ s/^\+//) {
2515
- $t += ::tz_to_s_offset($tz);
2498
+ $t += tz_to_s_offset($tz);
2499
} elsif ($tz =~ s/^\-//) {
2517
- $t -= ::tz_to_s_offset($tz);
2500
+ $t -= tz_to_s_offset($tz);
2501
}
2502
$dest->{t_utc} = $t;
2503
}