|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /usr/share/doc/subversion-1.6.11/tools/client-side/ |
Upload File : |
#!/usr/bin/perl -w
use strict;
# ====================================================================
# Show the log message and diff for a revision.
#
# $ showchange.pl REVISION [WC_PATH|URL]
if ((scalar(@ARGV) == 0)
or ($ARGV[0] eq '-?')
or ($ARGV[0] eq '-h')
or ($ARGV[0] eq '--help')) {
print <<EOF;
Show the log message and diff for a revision.
usage: $0 REVISION [WC_PATH|URL]
EOF
exit 0;
}
my $revision = shift || die ("Revision argument required.\n");
if ($revision =~ /r([0-9]+)/) {
$revision = $1;
}
my $url = shift || "";
my $svn = "svn";
my $prev_revision = $revision - 1;
if (not $url) {
# If no URL was provided, use the repository root from the current
# directory's working copy. We want the root, rather than the URL
# of the current dir, because when someone's asking for a change
# by name (that is, by revision number), they generally don't want
# to have to cd to a particular working copy directory to get it.
my @info_lines = `${svn} info`;
foreach my $info_line (@info_lines) {
if ($info_line =~ s/^Repository Root: (.*)$/$1/e) {
$url = $info_line;
}
}
}
system ("${svn} log -v --incremental -r${revision} $url");
system ("${svn} diff -r${prev_revision}:${revision} $url");