Patchwork [5,of,5] help: explain that revsets can be used where 1 or 2 revs are wanted

login
register
mail settings
Submitter via Mercurial-devel
Date Jan. 12, 2017, 7:24 a.m.
Message ID <a997378ca98dad8fd8da.1484205874@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/18193/
State Accepted
Headers show

Comments

via Mercurial-devel - Jan. 12, 2017, 7:24 a.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1484205180 28800
#      Wed Jan 11 23:13:00 2017 -0800
# Node ID a997378ca98dad8fd8daed6cc4e73b5c2badcef6
# Parent  f4f54de30261c007dd9565c5b0007d2d6a9c3665
help: explain that revsets can be used where 1 or 2 revs are wanted

We did not seem to document that one can do things like "hg up :@"
where the last revision of the revset ":@".
Pierre-Yves David - Jan. 12, 2017, 11:14 a.m.
On 01/12/2017 08:24 AM, Martin von Zweigbergk via Mercurial-devel wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1484205180 28800
> #      Wed Jan 11 23:13:00 2017 -0800
> # Node ID a997378ca98dad8fd8daed6cc4e73b5c2badcef6
> # Parent  f4f54de30261c007dd9565c5b0007d2d6a9c3665
> help: explain that revsets can be used where 1 or 2 revs are wanted

Pushed, Thanks for the clean up.

Cheers,

Patch

diff -r f4f54de30261 -r a997378ca98d mercurial/help/revisions.txt
--- a/mercurial/help/revisions.txt	Wed Jan 11 22:46:07 2017 -0800
+++ b/mercurial/help/revisions.txt	Wed Jan 11 23:13:00 2017 -0800
@@ -29,6 +29,12 @@ 
 uncommitted merge is in progress, "." is the revision of the first
 parent.
 
+Finally, commands that expect a single revision (like ``hg update``) also
+accept revsets (see below for details). When given a revset, they use the
+last revision of the revset. A few commands accept two single revisions
+(like ``hg diff``). When given a revset, they use the first and the last
+revisions of the revset.
+
 Specifying multiple revisions
 =============================
 
@@ -188,3 +194,13 @@ 
   release::
 
     hg log -r "(keyword(bug) or keyword(issue)) and not ancestors(tag())"
+
+- Update to commit that bookmark @ is pointing too, without activating the
+  bookmark (this works because the last revision of the revset is used)::
+
+    hg update :@
+
+- Show diff between tags 1.3 and 1.5 (this works because the first and the
+  last revisions of the revset are used)::
+
+    hg diff -r 1.3::1.5
diff -r f4f54de30261 -r a997378ca98d tests/test-extension.t
--- a/tests/test-extension.t	Wed Jan 11 22:46:07 2017 -0800
+++ b/tests/test-extension.t	Wed Jan 11 23:13:00 2017 -0800
@@ -731,14 +731,14 @@ 
   $ echo "multirevs = multirevs.py" >> $HGRCPATH
 
   $ hg help multirevs | tail
+        bookmark (this works because the last revision of the revset is used):
   
-      - Changesets committed in May 2008, sorted by user:
+          hg update :@
   
-          hg log -r "sort(date('May 2008'), user)"
+      - Show diff between tags 1.3 and 1.5 (this works because the first and the
+        last revisions of the revset are used):
   
-      - Changesets mentioning "bug" or "issue" that are not in a tagged release:
-  
-          hg log -r "(keyword(bug) or keyword(issue)) and not ancestors(tag())"
+          hg diff -r 1.3::1.5
   
   use 'hg help -c multirevs' to see help for the multirevs command