[PATCH] Correct example concerning "hg purge" alias in "hgrc.5"

Dr Rainer Woitok rainer.woitok at gmail.com
Sat Feb 20 12:37:21 EST 2016


Yuya,

On Saturday, 2016-02-20 12:52:45 +0900, you wrote:

> ...
> You could make status output relative.
> 
>     status --no-status --unknown -0 re:

Nice trick that evaded me for years :-)

> https://selenic.com/repo/hg/help/status

This contains  this example, yes.   But doesn't care  to explain  why it
works.  What's probably  missing in "hg.1"  is some hint that when files
are specified on the command line,  they will be listed  relative to the
current directory in the output.

Anyway, below's the new patch.

Sincerely,
  Rainer

# HG changeset patch
# User Rainer Woitok <Rainer.Woitok at Gmail.Com>
# Date 1455985946 -3600
#      Sat Feb 20 17:32:26 2016 +0100
# Branch stable
# Node ID d9d9844f921c0712f8b9d6da7017328168af20df
# Parent  4c6053a6b17d682b34fb88bbeb5e94ed9085d900
doc: correct example concerning "hg purge" alias in man page "hgrc.5"

The "hg purge" alias as currently described in "hgrc.5" only works, if
the caller's current working directory is identical to the repository's
root directory.

This patch slightly modifies the example by adding an empty pattern as a
file argument to the "hg status" command, thus forcing this command to
list the affected files relative to the current directory.

diff --git a/mercurial/help/config.txt b/mercurial/help/config.txt
--- a/mercurial/help/config.txt
+++ b/mercurial/help/config.txt
@@ -276,7 +276,7 @@
 will let you do ``hg echo foo`` to have ``foo`` printed in your
 terminal. A better example might be::
 
-   purge = !$HG status --no-status --unknown -0 | xargs -0 rm
+   purge = !$HG status --no-status --unknown -0 re: | xargs -0 rm
 
 which will make ``hg purge`` delete all unknown files in the
 repository in the same manner as the purge extension.


More information about the Mercurial-devel mailing list