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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Dr Rainer Woitok
# HG changeset patch
# User Rainer Woitok <[hidden email]>
# Date 1487326116 -3600
# Parent  56ed3565559ad36d11eaf58697c2416bf5bc1f2b
doc: correct example concerning "hg purge" alias in man page "hgrc.5"

The "hg purge" alias as currently described in "hgrc.5" issues a possibly
confusing error message like

   rm: missing operand
   Try 'rm --help' for more information.

if no files are to be purged at all.

This patch slightly modifies the example by adding a "-f" option to the
"rm" command.

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 re: | xargs -0 rm
+   purge = !$HG status --no-status --unknown -0 re: | xargs -0 rm -f
 
 which will make ``hg purge`` delete all unknown files in the
 repository in the same manner as the purge extension.
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Martin von Zweigbergk via Mercurial-devel
On Fri, Feb 17, 2017 at 3:58 AM, Dr Rainer Woitok
<[hidden email]> wrote:

> # HG changeset patch
> # User Rainer Woitok <[hidden email]>
> # Date 1487326116 -3600
> # Parent  56ed3565559ad36d11eaf58697c2416bf5bc1f2b
> doc: correct example concerning "hg purge" alias in man page "hgrc.5"
>
> The "hg purge" alias as currently described in "hgrc.5" issues a possibly
> confusing error message like
>
>    rm: missing operand
>    Try 'rm --help' for more information.
>
> if no files are to be purged at all.
>
> This patch slightly modifies the example by adding a "-f" option to the
> "rm" command.
>
> 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 re: | xargs -0 rm
> +   purge = !$HG status --no-status --unknown -0 re: | xargs -0 rm -f

"xargs -r" would have shown the intent better, but that's apparently a
GNU extension, so your patch is probably the best we can do in a
portable way.  Queued, thanks.


>
>  which will make ``hg purge`` delete all unknown files in the
>  repository in the same manner as the purge extension.
> _______________________________________________
> Mercurial-devel mailing list
> [hidden email]
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Loading...