From 13bc4e1a3ddf840eb3a8095d9564b136ebe839da Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Wed, 5 Sep 2001 08:02:18 +0000 Subject: [PATCH] Allow - for OLD. --- admin/revdiff | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/admin/revdiff b/admin/revdiff index bdd6a2210ce..f145da19c4a 100755 --- a/admin/revdiff +++ b/admin/revdiff @@ -27,13 +27,18 @@ if (@ARGV < 3) revdiff FILE OLD NEW Get a diff of FILE between revisions OLD and NEW. Store the -diff in a file named FILE-OLD-NEW.diff. If NEW is + -or -, build diffs between revisions OLD and OLD +/- . -OLD being `-' means use FILE's current revision. +diff in a file named FILE-OLD-NEW.diff. + +If OLD is `-' use FILE's current revision for OLD. If OLD is +`-', use the Nth revision before the current one for OLD. + +If NEW is + or -, build diffs between revisions OLD +and OLD +/- . Examples: revdiff FILE - -1 get the latest change of FILE +revdiff FILE -1 +1 also gets the latest change of FILE revdiff FILE 1.500 +2 get diffs 1.500-1.501 and 1.501-1.502. USAGE @@ -73,9 +78,17 @@ sub current_revision ($) } if ($old eq "-") -{ - $old = current_revision ($file); -} + { + $old = current_revision ($file); + } +elsif ($old =~ /^-(\d+)$/) + { + my $offset = $1; + $old = current_revision ($file); + die "Internal error" unless $old =~ /(.*)\.(\d+)$/; + my $minor = $2 - $offset; + $old = sprintf ("%d.%d", $1, $minor); + } while (@ARGV) { -- 2.39.2