diff options
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 bdd6a2210ce..f145da19c4a 100755 --- a/admin/revdiff +++ b/admin/revdiff | |||
| @@ -27,13 +27,18 @@ if (@ARGV < 3) | |||
| 27 | revdiff FILE OLD NEW | 27 | revdiff FILE OLD NEW |
| 28 | 28 | ||
| 29 | Get a diff of FILE between revisions OLD and NEW. Store the | 29 | Get a diff of FILE between revisions OLD and NEW. Store the |
| 30 | diff in a file named FILE-OLD-NEW.diff. If NEW is +<number> | 30 | diff in a file named FILE-OLD-NEW.diff. |
| 31 | or -<number>, build diffs between revisions OLD and OLD +/- <number>. | 31 | |
| 32 | OLD being `-' means use FILE's current revision. | 32 | If OLD is `-' use FILE's current revision for OLD. If OLD is |
| 33 | `-<number>', use the Nth revision before the current one for OLD. | ||
| 34 | |||
| 35 | If NEW is +<number> or -<number>, build diffs between revisions OLD | ||
| 36 | and OLD +/- <number>. | ||
| 33 | 37 | ||
| 34 | Examples: | 38 | Examples: |
| 35 | 39 | ||
| 36 | revdiff FILE - -1 get the latest change of FILE | 40 | revdiff FILE - -1 get the latest change of FILE |
| 41 | revdiff FILE -1 +1 also gets the latest change of FILE | ||
| 37 | revdiff FILE 1.500 +2 get diffs 1.500-1.501 and 1.501-1.502. | 42 | revdiff FILE 1.500 +2 get diffs 1.500-1.501 and 1.501-1.502. |
| 38 | 43 | ||
| 39 | USAGE | 44 | USAGE |
| @@ -73,9 +78,17 @@ sub current_revision ($) | |||
| 73 | } | 78 | } |
| 74 | 79 | ||
| 75 | if ($old eq "-") | 80 | if ($old eq "-") |
| 76 | { | 81 | { |
| 77 | $old = current_revision ($file); | 82 | $old = current_revision ($file); |
| 78 | } | 83 | } |
| 84 | elsif ($old =~ /^-(\d+)$/) | ||
| 85 | { | ||
| 86 | my $offset = $1; | ||
| 87 | $old = current_revision ($file); | ||
| 88 | die "Internal error" unless $old =~ /(.*)\.(\d+)$/; | ||
| 89 | my $minor = $2 - $offset; | ||
| 90 | $old = sprintf ("%d.%d", $1, $minor); | ||
| 91 | } | ||
| 79 | 92 | ||
| 80 | while (@ARGV) | 93 | while (@ARGV) |
| 81 | { | 94 | { |