[PATCH] purge: clarify behavior with regard to ignored files

Patrick Mézard pmezard at gmail.com
Fri Jan 2 15:17:49 CST 2009


Benjamin Pollack a écrit :
> 1 file changed, 7 insertions(+), 9 deletions(-)
> hgext/purge.py |   16 +++++++---------
> 
> 
> # HG changeset patch
> # User Benjamin Pollack <benjamin at bitquabit.com>
> # Date 1230925268 18000
> # Node ID 589690007256d1eefdd3f8d6f9527dbabe5be0db
> # Parent  016a7319e76ba15474a89199657c5aa39bd3b339
> purge: clarify behavior with regard to ignored files
> 
> The purge documentation previously said that purge would delete ignored
> files.  This is only true if purge is passed the --all option, which is
> now stated explicitly.  A few trivial grammar errors were also fixed.
> 
> diff -r 016a7319e76b -r 589690007256 hgext/purge.py
> --- a/hgext/purge.py	Wed Dec 31 18:00:35 2008 -0600
> +++ b/hgext/purge.py	Fri Jan 02 14:41:08 2009 -0500
> @@ -32,28 +32,26 @@
>  import os
>  
>  def purge(ui, repo, *dirs, **opts):
> -    '''removes files not tracked by mercurial
> +    '''removes files not tracked by Mercurial
>  
> -    Delete files not known to mercurial, this is useful to test local and
> -    uncommitted changes in the otherwise clean source tree.
> +    Delete files not known to Mercurial.  This is useful to test local and

Can you kill the extra space before "This" ?

> +    uncommitted changes in an otherwise-clean source tree.
>  
>      This means that purge will delete:
>       - Unknown files: files marked with "?" by "hg status"
> -     - Ignored files: files usually ignored by Mercurial because they match
> -       a pattern in a ".hgignore" file
>       - Empty directories: in fact Mercurial ignores directories unless they
>         contain files under source control managment
>      But it will leave untouched:
> -     - Unmodified tracked files
> -     - Modified tracked files
> +     - Modified and unmodified tracked files
> +     - Ignored files

Perhaps this can be made more explicit by mentioning the --all option like:

-- Ignored files (unless --all is used)

>       - New files added to the repository (with "hg add")
>  
>      If directories are given on the command line, only files in these
>      directories are considered.
>  
> -    Be careful with purge, you could irreversibly delete some files you
> +    Be careful with purge, as you could irreversibly delete some files you
>      forgot to add to the repository. If you only want to print the list of
> -    files that this program would delete use the --print option.
> +    files that this program would delete, use the --print option.
>      '''
>      act = not opts['print']
>      eol = '\n'

--
Patrick Mézard


More information about the Mercurial-devel mailing list