D5899: subrepo: use relative path for "already tracked" message

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Fri Feb 8 18:49:06 UTC 2019


martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  From https://phab.mercurial-scm.org/rHG932de135041fc944af1c3df21ff251522f8236b6 (subrepo: warn when adding already tracked files in
  gitsubrepo, 2015-02-27):
  
    The file is printed with abs() to be consistent with how it is
    printed in workingctx, even though that is inconsistent with how
    added files are printed in verbose mode.
  
  However, a few year later, the same author wrote https://phab.mercurial-scm.org/rHG7008f6819002bc01bcc8626f2ff41af0949096c4
  (context: name files relative to cwd in warning messages, 2017-07-11)
  and now it's inconsistent. This fixes that inconsistency.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/subrepo.py

CHANGE DETAILS

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -1624,7 +1624,7 @@
                 self._gitcommand(command + [f])
 
         for f in rejected:
-            ui.warn(_("%s already tracked!\n") % match.abs(f))
+            ui.warn(_("%s already tracked!\n") % match.rel(f))
 
         return rejected
 



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


More information about the Mercurial-devel mailing list