Show More
@@ -2531,12 +2531,16 b' def revert(ui, repo, ctx, parents, *pats' | |||||
2531 | dsmodified = modified |
|
2531 | dsmodified = modified | |
2532 | dsadded = added |
|
2532 | dsadded = added | |
2533 | dsremoved = removed |
|
2533 | dsremoved = removed | |
|
2534 | # store all local modifications, useful later for rename detection | |||
|
2535 | localchanges = dsmodified | dsadded | |||
2534 | modified, added, removed = set(), set(), set() |
|
2536 | modified, added, removed = set(), set(), set() | |
2535 | else: |
|
2537 | else: | |
2536 | changes = repo.status(node1=parent, match=m) |
|
2538 | changes = repo.status(node1=parent, match=m) | |
2537 | dsmodified = set(changes[0]) |
|
2539 | dsmodified = set(changes[0]) | |
2538 | dsadded = set(changes[1]) |
|
2540 | dsadded = set(changes[1]) | |
2539 | dsremoved = set(changes[2]) |
|
2541 | dsremoved = set(changes[2]) | |
|
2542 | # store all local modifications, useful later for rename detection | |||
|
2543 | localchanges = dsmodified | dsadded | |||
2540 |
|
2544 | |||
2541 | # only take into account for removes between wc and target |
|
2545 | # only take into account for removes between wc and target | |
2542 | clean |= dsremoved - removed |
|
2546 | clean |= dsremoved - removed | |
@@ -2570,7 +2574,7 b' def revert(ui, repo, ctx, parents, *pats' | |||||
2570 |
|
2574 | |||
2571 | # if f is a rename, update `names` to also revert the source |
|
2575 | # if f is a rename, update `names` to also revert the source | |
2572 | cwd = repo.getcwd() |
|
2576 | cwd = repo.getcwd() | |
2573 |
for f in |
|
2577 | for f in localchanges: | |
2574 | src = repo.dirstate.copied(f) |
|
2578 | src = repo.dirstate.copied(f) | |
2575 | # XXX should we check for rename down to target node? |
|
2579 | # XXX should we check for rename down to target node? | |
2576 | if src and src not in names and repo.dirstate[src] == 'r': |
|
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 | $ hg st a newa |
|
234 | $ hg st a newa | |
235 | ? newa |
|
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 | $ cd .. |
|
243 | $ cd .. | |
238 |
|
244 | |||
239 | $ hg init ignored |
|
245 | $ hg init ignored |
General Comments 0
You need to be logged in to leave comments.
Login now