Patchwork [1,of,5] help: apply the section headings from revsets to filesets

login
register
mail settings
Submitter Matt Harbison
Date Jan. 8, 2017, 7:55 p.m.
Message ID <ee55c68a5e4af49f0bbf.1483905339@Envy>
Download mbox | patch
Permalink /patch/18137/
State Accepted
Headers show

Comments

Matt Harbison - Jan. 8, 2017, 7:55 p.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1483861236 18000
#      Sun Jan 08 02:40:36 2017 -0500
# Node ID ee55c68a5e4af49f0bbf5a131d62200550f16940
# Parent  f088609398c37176c0d085216899cb3452f1e85a
help: apply the section headings from revsets to filesets

This has the nice property of visually breaking up the wall of text.  It also
allows specific smaller sections to be called out.  For example,
`hg help filesets.predicates` now prints just the predicate section.  At the
moment, the revset headings are a superset of the fileset headings, so there is
consistency in how example, predicate and operator help is called out.

The reference to `hg help patterns` was moved to the overview section, so that
it isn't stuck in the examples section.

Patch

diff --git a/mercurial/help/filesets.txt b/mercurial/help/filesets.txt
--- a/mercurial/help/filesets.txt
+++ b/mercurial/help/filesets.txt
@@ -15,11 +15,19 @@ 
 e.g., ``\n`` is interpreted as a newline. To prevent them from being
 interpreted, strings can be prefixed with ``r``, e.g. ``r'...'``.
 
+See also :hg:`help patterns`.
+
+Prefix
+======
+
 There is a single prefix operator:
 
 ``not x``
   Files not in x. Short form is ``! x``.
 
+Infix
+=====
+
 These are the supported infix operators:
 
 ``x and y``
@@ -32,10 +40,16 @@ 
 ``x - y``
   Files in x but not in y.
 
+Predicates
+==========
+
 The following predicates are supported:
 
 .. predicatesmarker
 
+Examples
+========
+
 Some sample queries:
 
 - Show status of files that appear to be binary in the working directory::
@@ -61,5 +75,3 @@ 
 - Remove files listed in foo.lst that contain the letter a or b::
 
     hg remove "set: 'listfile:foo.lst' and (**a* or **b*)"
-
-See also :hg:`help patterns`.