# HG changeset patch # User Martin von Zweigbergk # Date 2019-02-05 19:14:07 # Node ID 9e545c9a4dfea42e07a766a059324a921669571e # Parent 630af04d4ae464892ec3f450eea74a9e7976fcf3 revert: migrate to scmutil.backuppath() Differential Revision: https://phab.mercurial-scm.org/D5853 diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -3017,7 +3017,7 @@ def revert(ui, repo, ctx, parents, *pats if dobackup == backupinteractive: tobackup.add(abs) elif (backup <= dobackup or wctx[abs].cmp(ctx[abs])): - bakname = scmutil.origpath(ui, repo, rel) + bakname = scmutil.backuppath(ui, repo, abs) relbakname = os.path.relpath(bakname) ui.note(_('saving current version of %s as %s\n') % (rel, relbakname)) @@ -3170,7 +3170,7 @@ def _performrevert(repo, parents, ctx, n # Create a backup file only if this hunk should be backed up if c.header.filename() in tobackup: target = repo.wjoin(abs) - bakname = scmutil.origpath(repo.ui, repo, m.rel(abs)) + bakname = scmutil.backuppath(repo.ui, repo, abs) util.copyfile(target, bakname) tobackup.remove(abs) c.write(fp)