Patchwork D5855: mq: migrate to scmutil.backuppath()

login
register
mail settings
Submitter phabricator
Date Feb. 7, 2019, 2:04 a.m.
Message ID <1a633bed6b29ff26b299a0080312a9d4@localhost.localdomain>
Download mbox | patch
Permalink /patch/38509/
State Not Applicable
Headers show

Comments

phabricator - Feb. 7, 2019, 2:04 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGa2caf9974995: mq: migrate to scmutil.backuppath() (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5855?vs=13860&id=13877

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

AFFECTED FILES
  hgext/mq.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel
Yuya Nishihara - Feb. 7, 2019, 12:51 p.m.
> -                absorig = scmutil.origpath(self.ui, repo, absf)
> +                absorig = scmutil.backuppath(self.ui, repo, f)
>                  self.ui.note(_('saving current version of %s as %s\n') %
> -                             (f, os.path.relpath(absorig)))
> +                             (f, os.path.relpath(absorig, start=repo.root)))

Why printing a repo-relative path instead of cwd-relative one?
phabricator - Feb. 7, 2019, 12:58 p.m.
yuja added a comment.


  > - absorig = scmutil.origpath(self.ui, repo, absf) +                absorig = scmutil.backuppath(self.ui, repo, f) self.ui.note(_('saving current version of %s as %s\n') %
  > - (f, os.path.relpath(absorig))) +                             (f, os.path.relpath(absorig, start=repo.root)))
  
  Why printing a repo-relative path instead of cwd-relative one?

REPOSITORY
  rHG Mercurial

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

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

Patch

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -738,9 +738,9 @@ 
         for f in sorted(files):
             absf = repo.wjoin(f)
             if os.path.lexists(absf):
-                absorig = scmutil.origpath(self.ui, repo, absf)
+                absorig = scmutil.backuppath(self.ui, repo, f)
                 self.ui.note(_('saving current version of %s as %s\n') %
-                             (f, os.path.relpath(absorig)))
+                             (f, os.path.relpath(absorig, start=repo.root)))
 
                 if copy:
                     util.copyfile(absf, absorig)