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

This is an archive of the discontinued Mercurial Phabricator instance.

mq: migrate to scmutil.backuppath()
ClosedPublic

Authored by martinvonz on Feb 5 2019, 12:52 PM.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

martinvonz created this revision.Feb 5 2019, 12:52 PM
martinvonz updated this revision to Diff 13860.Feb 6 2019, 6:59 PM
This revision was automatically updated to reflect the committed changes.
yuja added a subscriber: yuja.Feb 7 2019, 7:58 AM
  • 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?

In D5855#86020, @yuja wrote:
  • 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?

Oops, not intended. Feel free to fix it. Otherwise I'll do that in about two hours.

In D5855#86020, @yuja wrote:
  • 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?

Oops, not intended. Feel free to fix it. Otherwise I'll do that in about two hours.

Fixed in the hg-committed repo.