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

Dr Rainer Woitok rainer.woitok at gmail.com
Mon Feb 15 11:58:34 UTC 2016


# HG changeset patch
# User Rainer Woitok <Rainer.Woitok at Gmail.Com>
# Date 1455527026 -3600
#      Mon Feb 15 10:03:46 2016 +0100
# Branch stable
# Node ID 6c708c0ac5820c467c1485122b24a2707b059863
# 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 changes the example by advising the reader to temporarily
"cd" into the repository's root directory before calling "xargs".

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,8 @@
 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 |
+           ( cd `$HG root` ; 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