summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6139535)
raw | patch | inline | side by side (parent: 6139535)
author | Eric Wong <normalperson@yhbt.net> | |
Sat, 27 Jan 2007 22:38:10 +0000 (14:38 -0800) | ||
committer | Eric Wong <normalperson@yhbt.net> | |
Fri, 23 Feb 2007 08:57:10 +0000 (00:57 -0800) |
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>
the only place it's used now.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
git-svn.perl | patch | blob | history |
diff --git a/git-svn.perl b/git-svn.perl
index 4f7ebaf58ba86d195d548eaf6278228713871286..7249d6f41706e7d72cae0fedc33e3213170e2e08 100755 (executable)
--- a/git-svn.perl
+++ b/git-svn.perl
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;
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;
$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;
}