File: showchange.pl

package info (click to toggle)
subversion 1.4.2dfsg1-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 37,268 kB
  • ctags: 32,888
  • sloc: ansic: 406,472; python: 38,378; sh: 15,248; cpp: 9,604; ruby: 8,313; perl: 5,308; java: 4,576; lisp: 3,860; xml: 3,298; makefile: 856
file content (34 lines) | stat: -rwxr-xr-x 732 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/perl -w

use strict;

# ====================================================================
# Show the log message and diff for a revision.
#
#    $ showchange.pl REVISION [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 [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;

system ("${svn} log -v --incremental -r${revision} $url");
system ("${svn} diff -r${prev_revision}:${revision} $url");