# HG changeset patch # User Alexis S. L. Carvalho # Date 1181357352 10800 # Node ID 6c58139f4eaab0894dc534a5e0bc5b249a86aa2f # Parent b9d311928caf40251d8acadc196f3d4a2bae8708 Use absolute paths in revert. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2293,16 +2293,17 @@ def revert(ui, repo, *pats, **opts): for abs, (rel, exact) in entries: mfentry = mf.get(abs) + target = repo.wjoin(abs) def handle(xlist, dobackup): xlist[0].append(abs) update[abs] = 1 if (dobackup and not opts['no_backup'] and - (os.path.islink(rel) or os.path.exists(rel))): + (os.path.islink(target) or os.path.exists(target))): bakname = "%s.orig" % rel ui.note(_('saving current version of %s as %s\n') % (rel, bakname)) if not opts.get('dry_run'): - util.copyfile(rel, bakname) + util.copyfile(target, bakname) if ui.verbose or not exact: ui.status(xlist[1] % rel) for table, hitlist, misslist, backuphit, backupmiss in disptable: