Patchwork D9564: diff: deprecate -r option

login
register
mail settings
Submitter phabricator
Date Dec. 10, 2020, 11:01 p.m.
Message ID <differential-rev-PHID-DREV-hdlls5txkmetl373zj4u-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47862/
State Superseded
Headers show

Comments

phabricator - Dec. 10, 2020, 11:01 p.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The new `--from`/`--to` options should be enough to support all the
  uses cases and are easier to understand, so there is no reason that
  I'm aware of to use `-r` anymore.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9564

AFFECTED FILES
  mercurial/commands.py
  relnotes/next
  tests/test-help.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-help.t b/tests/test-help.t
--- a/tests/test-help.t
+++ b/tests/test-help.t
@@ -665,7 +665,6 @@ 
   
   options ([+] can be repeated):
   
-   -r --rev REV [+]         revision
       --from REV1           revision to diff from
       --to REV2             revision to diff to
    -c --change REV          change made by revision
diff --git a/relnotes/next b/relnotes/next
--- a/relnotes/next
+++ b/relnotes/next
@@ -21,7 +21,8 @@ 
    debugstrip`. The extension remains for compatibility.
 
  * `hg diff` now supports `--from <rev>` and `--to <rev>` arguments as
-   clearer alternatives to `-r <revs>`.
+   clearer alternatives to `-r <revs>`. `-r <revs>` has been
+   deprecated.
 
  * The memory footprint per changeset during pull/unbundle
    operations has been further reduced.
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2455,7 +2455,7 @@ 
 @command(
     b'diff',
     [
-        (b'r', b'rev', [], _(b'revision'), _(b'REV')),
+        (b'r', b'rev', [], _(b'revision (DEPRECATED)'), _(b'REV')),
         (b'', b'from', b'', _(b'revision to diff from'), _(b'REV1')),
         (b'', b'to', b'', _(b'revision to diff to'), _(b'REV2')),
         (b'c', b'change', b'', _(b'change made by revision'), _(b'REV')),