comparison hgext/mq.py @ 41592:e67a85e0f19e

mq: always show relative path to .orig backup Same as previous commit, but for mq (I would have folded them, but test-check-commit doesn't like "revert/mq" as a topic and I couldn't think of a better one). Differential Revision: https://phab.mercurial-scm.org/D5872
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 06 Feb 2019 15:26:53 -0800
parents bd3f03d8cc9f
children 106b0bec162a
comparison
equal deleted inserted replaced
41591:4d4842445afc 41592:e67a85e0f19e
736 def backup(self, repo, files, copy=False): 736 def backup(self, repo, files, copy=False):
737 # backup local changes in --force case 737 # backup local changes in --force case
738 for f in sorted(files): 738 for f in sorted(files):
739 absf = repo.wjoin(f) 739 absf = repo.wjoin(f)
740 if os.path.lexists(absf): 740 if os.path.lexists(absf):
741 absorig = scmutil.origpath(self.ui, repo, absf)
741 self.ui.note(_('saving current version of %s as %s\n') % 742 self.ui.note(_('saving current version of %s as %s\n') %
742 (f, scmutil.origpath(self.ui, repo, f))) 743 (f, os.path.relpath(absorig)))
743 744
744 absorig = scmutil.origpath(self.ui, repo, absf)
745 if copy: 745 if copy:
746 util.copyfile(absf, absorig) 746 util.copyfile(absf, absorig)
747 else: 747 else:
748 util.rename(absf, absorig) 748 util.rename(absf, absorig)
749 749