##// END OF EJS Templates
revert: look for copy information for all local modifications...
Pierre-Yves David -
r23403:edf29f9c stable
parent child Browse files
Show More
@@ -2531,12 +2531,16 b' def revert(ui, repo, ctx, parents, *pats'
2531 2531 dsmodified = modified
2532 2532 dsadded = added
2533 2533 dsremoved = removed
2534 # store all local modifications, useful later for rename detection
2535 localchanges = dsmodified | dsadded
2534 2536 modified, added, removed = set(), set(), set()
2535 2537 else:
2536 2538 changes = repo.status(node1=parent, match=m)
2537 2539 dsmodified = set(changes[0])
2538 2540 dsadded = set(changes[1])
2539 2541 dsremoved = set(changes[2])
2542 # store all local modifications, useful later for rename detection
2543 localchanges = dsmodified | dsadded
2540 2544
2541 2545 # only take into account for removes between wc and target
2542 2546 clean |= dsremoved - removed
@@ -2570,7 +2574,7 b' def revert(ui, repo, ctx, parents, *pats'
2570 2574
2571 2575 # if f is a rename, update `names` to also revert the source
2572 2576 cwd = repo.getcwd()
2573 for f in dsadded:
2577 for f in localchanges:
2574 2578 src = repo.dirstate.copied(f)
2575 2579 # XXX should we check for rename down to target node?
2576 2580 if src and src not in names and repo.dirstate[src] == 'r':
@@ -234,6 +234,12 b' reverting a rename target should revert '
234 234 $ hg st a newa
235 235 ? newa
236 236
237 Also true for move overwriting an existing file
238
239 $ hg mv --force a b/b
240 $ hg revert b/b
241 $ hg status a b/b
242
237 243 $ cd ..
238 244
239 245 $ hg init ignored
General Comments 0
You need to be logged in to leave comments. Login now