[PATCH 2 of 2] addremove: restore the relative path printing when files are named

Augie Fackler raf at durin42.com
Fri Dec 5 12:07:09 CST 2014


On Thu, Dec 04, 2014 at 11:47:33PM -0500, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison at yahoo.com>
> # Date 1417752507 18000
> #      Thu Dec 04 23:08:27 2014 -0500
> # Node ID 740027022204b6131b19eab62673b4929524d490
> # Parent  6dbf121735cfce8a9c241d1b58f255a4eee218c3
> addremove: restore the relative path printing when files are named

Queued. Thanks to Martin for doing a quick review on this and floating
it to my inbox.

>
> This fixes the previously mentioned issue with 3778884197f0, and undoes its
> corresponding test change.
>
> The test change demonstrates the correctness when a file is specified (i.e. the
> glob is required on Windows because relative paths use '\' and absolute paths
> use '/').  It is admittedly very subtle, but there will be a more robust test in
> the addremove -S v3 series.
>
> diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
> --- a/mercurial/scmutil.py
> +++ b/mercurial/scmutil.py
> @@ -730,11 +730,10 @@
>      toprint.update(deleted)
>      for abs in sorted(toprint):
>          if repo.ui.verbose or not m.exact(abs):
> -            rel = m.rel(abs)
>              if abs in unknownset:
> -                status = _('adding %s\n') % ((m.anypats() and rel) or abs)
> +                status = _('adding %s\n') % m.uipath(abs)
>              else:
> -                status = _('removing %s\n') % ((m.anypats() and rel) or abs)
> +                status = _('removing %s\n') % m.uipath(abs)
>              repo.ui.status(status)
>
>      renames = _findrenames(repo, m, added + unknown, removed + deleted,
> diff --git a/tests/test-addremove-similar.t b/tests/test-addremove-similar.t
> --- a/tests/test-addremove-similar.t
> +++ b/tests/test-addremove-similar.t
> @@ -91,7 +91,7 @@
>  no copies found here (since the target isn't in d
>
>    $ hg addremove -s80 d
> -  removing d/b
> +  removing d/b (glob)
>
>  copies here
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list