[PATCH] purge: avoid duplicate output for --print (issue4092)

Sean Farley sean.michael.farley at gmail.com
Thu Feb 13 16:30:27 CST 2014


Anurag Goel <anurag.dsps at gmail.com> writes:

> # HG changeset patch
> # User anuraggoel <anurag.dsps at gmail.com>
> # Date 1392327404 -19800
> #      Fri Feb 14 03:06:44 2014 +0530
> # Node ID c3f90f494d184aa611b9e3d4d3c6f28f8354cbe5
> # Parent  d98ba4a87427ce601dd23de8d4f5288cc44fe945
> purge: avoid duplicate output for --print (issue4092)
>
> diff -r d98ba4a87427 -r c3f90f494d18 hgext/purge.py
> --- a/hgext/purge.py	Mon Feb 10 17:31:26 2014 -0600
> +++ b/hgext/purge.py	Fri Feb 14 03:06:44 2014 +0530
> @@ -101,10 +101,12 @@
>      status = repo.status(match=match, ignored=opts['all'], unknown=True)
>  
>      for f in sorted(status[4] + status[5]):
> -        ui.note(_('removing file %s\n') % f)
> +        if act:
> +            ui.note(_('removing file %s\n') % f)
>          remove(removefile, f)
>  
>      for f in sorted(directories, reverse=True):
>          if match(f) and not os.listdir(repo.wjoin(f)):
> -            ui.note(_('removing directory %s\n') % f)
> +            if act:
> +                ui.note(_('removing directory %s\n') % f)
>              remove(os.rmdir, f)

This is much better and seems to work as expected. Other crew members
have anything else to add?


More information about the Mercurial-devel mailing list