[PATCH 3 of 9 V2] scmutil: pass a matcher to scmutil.addremove() instead of a list of patterns

Martin von Zweigbergk martinvonz at google.com
Tue Dec 2 05:37:01 UTC 2014


Your emails end up in my spam box because the origin can not be confirmed.
You may want to look into that.

On Sat Nov 29 2014 at 9:53:29 PM Matt Harbison <matt_harbison at yahoo.com>
wrote:

> diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
> --- a/mercurial/scmutil.py
> +++ b/mercurial/scmutil.py
> @@ -732,9 +732,9 @@
>          if repo.ui.verbose or not m.exact(abs):
>              rel = m.rel(abs)
>              if abs in unknownset:
> -                status = _('adding %s\n') % ((pats and rel) or abs)
> +                status = _('adding %s\n') % ((m.anyfiles() and rel) or
> abs)
>              else:
> -                status = _('removing %s\n') % ((pats and rel) or abs)
> +                status = _('removing %s\n') % ((m.anyfiles() and rel) or
> abs)
>              repo.ui.status(status)


While this looks like a safe refactoring, I wonder if we should instead
make it m.anypats(). The only difference I can think of is for includes and
excludes. Currently:

$ mkdir dir
$ cd dir
$ touch a.py
$ hg  addremove 'glob:*.py'
adding a.py
$ hg forget a.py
$ hg addremove -I 'glob:*.py'
adding dir/a.py

I'm not sure that inconsistency is desired. I would think it's better if
they print the same thing. I might send a patch to make it so.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20141202/69ee7f29/attachment.html>


More information about the Mercurial-devel mailing list