diff options
author | Gerd Moellmann <[email protected]> | 2001-09-05 08:02:18 +0000 |
---|---|---|
committer | Gerd Moellmann <[email protected]> | 2001-09-05 08:02:18 +0000 |
commit | 13bc4e1a3ddf840eb3a8095d9564b136ebe839da (patch) | |
tree | b540e8f6d872d54d61476a05340342f4a3a626bd /admin | |
parent | 134d928342e69cebb6682a199629efaca0c6c821 (diff) |
Allow -<number> for OLD.
Diffstat (limited to 'admin')
-rwxr-xr-x | admin/revdiff | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/admin/revdiff b/admin/revdiff index bdd6a2210c..f145da19c4 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 +<number> -or -<number>, build diffs between revisions OLD and OLD +/- <number>. -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 +`-<number>', use the Nth revision before the current one for OLD. + +If NEW is +<number> or -<number>, build diffs between revisions OLD +and OLD +/- <number>. 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) { |