Show More
@@ -2251,7 +2251,6 b' def revert(ui, repo, *pats, **opts):' | |||
|
2251 | 2251 | remove = ([], _('removing %s\n')) |
|
2252 | 2252 | forget = ([], _('forgetting %s\n')) |
|
2253 | 2253 | undelete = ([], _('undeleting %s\n')) |
|
2254 | update = {} | |
|
2255 | 2254 | |
|
2256 | 2255 | disptable = ( |
|
2257 | 2256 | # dispatch table: |
@@ -2274,7 +2273,6 b' def revert(ui, repo, *pats, **opts):' | |||
|
2274 | 2273 | target = repo.wjoin(abs) |
|
2275 | 2274 | def handle(xlist, dobackup): |
|
2276 | 2275 | xlist[0].append(abs) |
|
2277 | update[abs] = 1 | |
|
2278 | 2276 | if dobackup and not opts['no_backup'] and util.lexists(target): |
|
2279 | 2277 | bakname = "%s.orig" % rel |
|
2280 | 2278 | ui.note(_('saving current version of %s as %s\n') % |
@@ -2317,16 +2315,32 b' def revert(ui, repo, *pats, **opts):' | |||
|
2317 | 2315 | handle(remove, False) |
|
2318 | 2316 | |
|
2319 | 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 | 2322 | for f in forget[0]: |
|
2321 | 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 | 2328 | for f in add[0]: |
|
2329 | checkout(f) | |
|
2324 | 2330 | repo.dirstate.add(f) |
|
2331 | ||
|
2325 | 2332 | for f in undelete[0]: |
|
2333 | checkout(f) | |
|
2326 | 2334 | repo.dirstate.normal(f) |
|
2335 | ||
|
2336 | audit_path = util.path_auditor(repo.root) | |
|
2327 | 2337 | for f in remove[0]: |
|
2338 | audit_path(f) | |
|
2339 | try: | |
|
2340 | util.unlink(repo.wjoin(f)) | |
|
2341 | except OSError: | |
|
2342 | pass | |
|
2328 | 2343 | repo.dirstate.remove(f) |
|
2329 | return r | |
|
2330 | 2344 | finally: |
|
2331 | 2345 | del wlock |
|
2332 | 2346 |
General Comments 0
You need to be logged in to leave comments.
Login now