Show More
@@ -2251,7 +2251,6 b' def revert(ui, repo, *pats, **opts):' | |||||
2251 | remove = ([], _('removing %s\n')) |
|
2251 | remove = ([], _('removing %s\n')) | |
2252 | forget = ([], _('forgetting %s\n')) |
|
2252 | forget = ([], _('forgetting %s\n')) | |
2253 | undelete = ([], _('undeleting %s\n')) |
|
2253 | undelete = ([], _('undeleting %s\n')) | |
2254 | update = {} |
|
|||
2255 |
|
2254 | |||
2256 | disptable = ( |
|
2255 | disptable = ( | |
2257 | # dispatch table: |
|
2256 | # dispatch table: | |
@@ -2274,7 +2273,6 b' def revert(ui, repo, *pats, **opts):' | |||||
2274 | target = repo.wjoin(abs) |
|
2273 | target = repo.wjoin(abs) | |
2275 | def handle(xlist, dobackup): |
|
2274 | def handle(xlist, dobackup): | |
2276 | xlist[0].append(abs) |
|
2275 | xlist[0].append(abs) | |
2277 | update[abs] = 1 |
|
|||
2278 | if dobackup and not opts['no_backup'] and util.lexists(target): |
|
2276 | if dobackup and not opts['no_backup'] and util.lexists(target): | |
2279 | bakname = "%s.orig" % rel |
|
2277 | bakname = "%s.orig" % rel | |
2280 | ui.note(_('saving current version of %s as %s\n') % |
|
2278 | ui.note(_('saving current version of %s as %s\n') % | |
@@ -2317,16 +2315,32 b' def revert(ui, repo, *pats, **opts):' | |||||
2317 | handle(remove, False) |
|
2315 | handle(remove, False) | |
2318 |
|
2316 | |||
2319 | if not opts.get('dry_run'): |
|
2317 | if not opts.get('dry_run'): | |
|
2318 | def checkout(f): | |||
|
2319 | fc = ctx[f] | |||
|
2320 | repo.wwrite(f, fc.data(), fc.fileflags()) | |||
|
2321 | ||||
2320 | for f in forget[0]: |
|
2322 | for f in forget[0]: | |
2321 | repo.dirstate.forget(f) |
|
2323 | repo.dirstate.forget(f) | |
2322 | r = hg.revert(repo, node, update.has_key) |
|
2324 | ||
|
2325 | for f in revert[0]: | |||
|
2326 | checkout(f) | |||
|
2327 | ||||
2323 | for f in add[0]: |
|
2328 | for f in add[0]: | |
|
2329 | checkout(f) | |||
2324 | repo.dirstate.add(f) |
|
2330 | repo.dirstate.add(f) | |
|
2331 | ||||
2325 | for f in undelete[0]: |
|
2332 | for f in undelete[0]: | |
|
2333 | checkout(f) | |||
2326 | repo.dirstate.normal(f) |
|
2334 | repo.dirstate.normal(f) | |
|
2335 | ||||
|
2336 | audit_path = util.path_auditor(repo.root) | |||
2327 | for f in remove[0]: |
|
2337 | for f in remove[0]: | |
|
2338 | audit_path(f) | |||
|
2339 | try: | |||
|
2340 | util.unlink(repo.wjoin(f)) | |||
|
2341 | except OSError: | |||
|
2342 | pass | |||
2328 | repo.dirstate.remove(f) |
|
2343 | repo.dirstate.remove(f) | |
2329 | return r |
|
|||
2330 | finally: |
|
2344 | finally: | |
2331 | del wlock |
|
2345 | del wlock | |
2332 |
|
2346 |
@@ -26,8 +26,6 b' e' | |||||
26 | %% should verbosely save backup to e.orig |
|
26 | %% should verbosely save backup to e.orig | |
27 | saving current version of e as e.orig |
|
27 | saving current version of e as e.orig | |
28 | reverting e |
|
28 | reverting e | |
29 | resolving manifests |
|
|||
30 | getting e |
|
|||
31 | %% should say no changes needed |
|
29 | %% should say no changes needed | |
32 | no changes needed to a |
|
30 | no changes needed to a | |
33 | %% should say file not managed |
|
31 | %% should say file not managed |
General Comments 0
You need to be logged in to leave comments.
Login now