Patchwork D9555: docs: prefer `hg diff --from/--to` over `-r`

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

Comments

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

REVISION SUMMARY
  This patch includes updating away from the broken `hg diff -r
  'date(...)'` (see not in previous patch).

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2509,11 +2509,11 @@ 
 
       - compare two historical versions of a directory, with rename info::
 
-          hg diff --git -r 1.0:1.2 lib/
+          hg diff --git --from 1.0 --to 1.2 lib/
 
       - get change stats relative to the last change on some date::
 
-          hg diff --stat -r "date('may 2')"
+          hg diff --stat --from "date('may 2')"
 
       - diff all newly-added files that contain a keyword::
 
@@ -2521,9 +2521,9 @@ 
 
       - compare a revision and its parents::
 
-          hg diff -c 9353         # compare against first parent
-          hg diff -r 9353^:9353   # same using revset syntax
-          hg diff -r 9353^2:9353  # compare against the second parent
+          hg diff -c 9353                  # compare against first parent
+          hg diff --from 9353 --to 9353    # same using revset syntax
+          hg diff --from 9353^2 --to 9353  # compare against the second parent
 
     Returns 0 on success.
     """
@@ -2962,7 +2962,7 @@ 
 
       is thus pretty much the same as::
 
-        hg diff -r 234 -r 345 | hg import
+        hg diff --from 234 --to 345 | hg import
 
       but using merge to resolve conflicts and track moved files.