Patchwork D5913: addremove: use uipathfn instead of m.rel() for recorded similatity message

login
register
mail settings
Submitter phabricator
Date Feb. 10, 2019, 3:41 a.m.
Message ID <cc585e123261f7747fd54d2fef7cc619@localhost.localdomain>
Download mbox | patch
Permalink /patch/38639/
State Not Applicable
Headers show

Comments

phabricator - Feb. 10, 2019, 3:41 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG0a5a6675c86c: addremove: use uipathfn instead of m.rel() for recorded similatity message (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5913?vs=13940&id=13994

REVISION DETAIL
  https://phab.mercurial-scm.org/D5913

AFFECTED FILES
  mercurial/scmutil.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -1092,7 +1092,7 @@ 
             repo.ui.status(status, label=label)
 
     renames = _findrenames(repo, m, added + unknown, removed + deleted,
-                           similarity)
+                           similarity, uipathfn)
 
     if not dry_run:
         _markchanges(repo, unknown + forgotten, deleted, renames)
@@ -1121,8 +1121,12 @@ 
                 status = _('removing %s\n') % abs
             repo.ui.status(status)
 
+    # TODO: We should probably have the caller pass in uipathfn and apply it to
+    # the messages above too. forcerelativevalue=True is consistent with how
+    # it used to work.
+    uipathfn = getuipathfn(repo, forcerelativevalue=True)
     renames = _findrenames(repo, m, added + unknown, removed + deleted,
-                           similarity)
+                           similarity, uipathfn)
 
     _markchanges(repo, unknown + forgotten, deleted, renames)
 
@@ -1161,7 +1165,7 @@ 
 
     return added, unknown, deleted, removed, forgotten
 
-def _findrenames(repo, matcher, added, removed, similarity):
+def _findrenames(repo, matcher, added, removed, similarity, uipathfn):
     '''Find renames from removed files to added ones.'''
     renames = {}
     if similarity > 0:
@@ -1171,7 +1175,7 @@ 
                 or not matcher.exact(new)):
                 repo.ui.status(_('recording removal of %s as rename to %s '
                                  '(%d%% similar)\n') %
-                               (matcher.rel(old), matcher.rel(new),
+                               (uipathfn(old), uipathfn(new),
                                 score * 100))
             renames[new] = old
     return renames