- ($baseargf = $argf) =~ s/^.*\///;
- my @args = ();
- push(@args, "-L", $argf . " (" . $rev . ")");
- push(@args, "-L", $argf . " (local copy)");
- open(FI, "git show $rev:po/$baseargf|");
- open(FO, '>', $tmpfile);
- while(my $l = <FI>) {
- print FO $l;
+ my $filedir;
+ if ($argf =~ /^(.*)\/([^\/]+)$/) {
+ $baseargf = $2;
+ $filedir = $1;
+ }
+ else {
+ $baseargf = $argf;
+ $filedir = ".";
+ }
+ if (-d "$filedir/../.git") {
+ my @args = ();
+ push(@args, "-L", $argf . " (" . $rev . ")");
+ push(@args, "-L", $argf . " (local copy)");
+ open(FI, "git show $rev:po/$baseargf|");
+ open(FO, '>', $tmpfile);
+ while(my $l = <FI>) {
+ print FO $l;
+ }
+ close(FI);
+ close(FO);
+ push(@args, $tmpfile, $argf);
+ print "===================================================================\n";
+ &diff_po(@args);
+ }
+ elsif (-d "$filedir/.svn") {
+ # call it again indirectly
+ my @cmd = ("svn", "diff", "-r$rev", "--diff-cmd", $0, $argf);
+ print "cmd = " . join(' ', @cmd) . "\n";
+ system(@cmd);