diff --git a/mercurial/commands.py b/mercurial/commands.py index cb2f7652ad1bd84644537882aafe4984651dc0c3_bWVyY3VyaWFsL2NvbW1hbmRzLnB5..41bb88cb913e96996635c3e2a5329bdd73e90c30_bWVyY3VyaWFsL2NvbW1hbmRzLnB5 100644 --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2251,7 +2251,6 @@ remove = ([], _('removing %s\n')) forget = ([], _('forgetting %s\n')) undelete = ([], _('undeleting %s\n')) - update = {} disptable = ( # dispatch table: @@ -2274,7 +2273,6 @@ target = repo.wjoin(abs) def handle(xlist, dobackup): xlist[0].append(abs) - update[abs] = 1 if dobackup and not opts['no_backup'] and util.lexists(target): bakname = "%s.orig" % rel ui.note(_('saving current version of %s as %s\n') % @@ -2317,5 +2315,9 @@ handle(remove, False) if not opts.get('dry_run'): + def checkout(f): + fc = ctx[f] + repo.wwrite(f, fc.data(), fc.fileflags()) + for f in forget[0]: repo.dirstate.forget(f) @@ -2320,4 +2322,7 @@ for f in forget[0]: repo.dirstate.forget(f) - r = hg.revert(repo, node, update.has_key) + + for f in revert[0]: + checkout(f) + for f in add[0]: @@ -2323,2 +2328,3 @@ for f in add[0]: + checkout(f) repo.dirstate.add(f) @@ -2324,2 +2330,3 @@ repo.dirstate.add(f) + for f in undelete[0]: @@ -2325,2 +2332,3 @@ for f in undelete[0]: + checkout(f) repo.dirstate.normal(f) @@ -2326,2 +2334,4 @@ repo.dirstate.normal(f) + + audit_path = util.path_auditor(repo.root) for f in remove[0]: @@ -2327,2 +2337,7 @@ for f in remove[0]: + audit_path(f) + try: + util.unlink(repo.wjoin(f)) + except OSError: + pass repo.dirstate.remove(f) @@ -2328,5 +2343,4 @@ repo.dirstate.remove(f) - return r finally: del wlock diff --git a/tests/test-revert.out b/tests/test-revert.out index cb2f7652ad1bd84644537882aafe4984651dc0c3_dGVzdHMvdGVzdC1yZXZlcnQub3V0..41bb88cb913e96996635c3e2a5329bdd73e90c30_dGVzdHMvdGVzdC1yZXZlcnQub3V0 100644 --- a/tests/test-revert.out +++ b/tests/test-revert.out @@ -26,8 +26,6 @@ %% should verbosely save backup to e.orig saving current version of e as e.orig reverting e -resolving manifests -getting e %% should say no changes needed no changes needed to a %% should say file not managed