Imported Upstream version 2.30.0
[platform/upstream/git.git] / perl / Git / SVN / Log.pm
index 3cc1c6f..cc8b484 100644 (file)
@@ -1,8 +1,12 @@
 package Git::SVN::Log;
 use strict;
-use warnings;
+use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
 use Git::SVN::Utils qw(fatal);
-use Git qw(command command_oneline command_output_pipe command_close_pipe);
+use Git qw(command
+           command_oneline
+           command_output_pipe
+           command_close_pipe
+           get_tz_offset);
 use POSIX qw/strftime/;
 use constant commit_log_separator => ('-' x 72) . "\n";
 use vars qw/$TZ $limit $color $pager $non_recursive $verbose $oneline
@@ -112,14 +116,15 @@ sub run_pager {
                return;
        }
        open STDIN, '<&', $rfd or fatal "Can't redirect stdin: $!";
-       $ENV{LESS} ||= 'FRSX';
+       $ENV{LESS} ||= 'FRX';
+       $ENV{LV} ||= '-c';
        exec $pager or fatal "Can't run pager: $! ($pager)";
 }
 
 sub format_svn_date {
        my $t = shift || time;
        require Git::SVN;
-       my $gmoff = Git::SVN::get_tz($t);
+       my $gmoff = get_tz_offset($t);
        return strftime("%Y-%m-%d %H:%M:%S $gmoff (%a, %d %b %Y)", localtime($t));
 }
 
@@ -280,7 +285,7 @@ sub cmd_show_log {
        my (@k, $c, $d, $stat);
        my $esc_color = qr/(?:\033\[(?:(?:\d+;)*\d*)?m)*/;
        while (<$log>) {
-               if (/^${esc_color}commit (?:- )?($::sha1_short)/o) {
+               if (/^${esc_color}commit (?:- )?($::oid_short)/o) {
                        my $cmt = $1;
                        if ($c && cmt_showable($c) && $c->{r} != $r_last) {
                                $r_last = $c->{r};
@@ -293,7 +298,7 @@ sub cmd_show_log {
                        get_author_info($c, $1, $2, $3);
                } elsif (/^${esc_color}(?:tree|parent|committer) /o) {
                        # ignore
-               } elsif (/^${esc_color}:\d{6} \d{6} $::sha1_short/o) {
+               } elsif (/^${esc_color}:\d{6} \d{6} $::oid_short/o) {
                        push @{$c->{raw}}, $_;
                } elsif (/^${esc_color}[ACRMDT]\t/) {
                        # we could add $SVN->{svn_path} here, but that requires