Skip to content

Commit

Permalink
git-svn: cleanup remove unused function
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Wong committed Feb 23, 2007
1 parent 6139535 commit 21819a3
Showing 1 changed file with 8 additions and 25 deletions.
33 changes: 8 additions & 25 deletions git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -679,29 +679,6 @@ sub cmt_metadata {
command(qw/cat-file commit/, shift)))[-1]);
}

sub get_commit_time {
my $cmt = shift;
my $fh = command_output_pipe(qw/rev-list --pretty=raw -n1/, $cmt);
while (<$fh>) {
/^committer\s(?:.+) (\d+) ([\-\+]?\d+)$/ or next;
my ($s, $tz) = ($1, $2);
if ($tz =~ s/^\+//) {
$s += tz_to_s_offset($tz);
} elsif ($tz =~ s/^\-//) {
$s -= tz_to_s_offset($tz);
}
close $fh;
return $s;
}
die "Can't get commit time for commit: $cmt\n";
}

sub tz_to_s_offset {
my ($tz) = @_;
$tz =~ s/(\d\d)$//;
return ($1 * 60) + ($tz * 3600);
}

package Git::SVN;
use strict;
use warnings;
Expand Down Expand Up @@ -2496,6 +2473,12 @@ sub run_pager {
exec $pager or ::fatal "Can't run pager: $! ($pager)\n";
}

sub tz_to_s_offset {
my ($tz) = @_;
$tz =~ s/(\d\d)$//;
return ($1 * 60) + ($tz * 3600);
}

sub get_author_info {
my ($dest, $author, $t, $tz) = @_;
$author =~ s/(?:^\s*|\s*$)//g;
Expand All @@ -2512,9 +2495,9 @@ sub get_author_info {
$dest->{a} = $au;
# Date::Parse isn't in the standard Perl distro :(
if ($tz =~ s/^\+//) {
$t += ::tz_to_s_offset($tz);
$t += tz_to_s_offset($tz);
} elsif ($tz =~ s/^\-//) {
$t -= ::tz_to_s_offset($tz);
$t -= tz_to_s_offset($tz);
}
$dest->{t_utc} = $t;
}
Expand Down

0 comments on commit 21819a3

Please sign in to comment.