Show More
@@ -2523,9 +2523,8 b' def revert(ui, repo, ctx, parents, *pats' | |||||
2523 | smf = set(mf) |
|
2523 | smf = set(mf) | |
2524 |
|
2524 | |||
2525 | # determine the exact nature of the deleted changesets |
|
2525 | # determine the exact nature of the deleted changesets | |
2526 |
|
|
2526 | deladded = _deleted - smf | |
2527 |
deleted = _deleted - |
|
2527 | deleted = _deleted - deladded | |
2528 | added |= _deletedadded |
|
|||
2529 |
|
2528 | |||
2530 | # We need to account for the state of file in the dirstate |
|
2529 | # We need to account for the state of file in the dirstate | |
2531 | # |
|
2530 | # | |
@@ -2586,6 +2585,11 b' def revert(ui, repo, ctx, parents, *pats' | |||||
2586 | added.add(abs) |
|
2585 | added.add(abs) | |
2587 | dsadded -= added |
|
2586 | dsadded -= added | |
2588 |
|
2587 | |||
|
2588 | for abs in deladded: | |||
|
2589 | if repo.dirstate[abs] == 'a': | |||
|
2590 | dsadded.add(abs) | |||
|
2591 | deladded -= dsadded | |||
|
2592 | ||||
2589 | # For files marked as removed, we check if an unknown file is present at |
|
2593 | # For files marked as removed, we check if an unknown file is present at | |
2590 | # the same path. If a such file exists it may need to be backed up. |
|
2594 | # the same path. If a such file exists it may need to be backed up. | |
2591 | # Making the distinction at this stage helps have simpler backup |
|
2595 | # Making the distinction at this stage helps have simpler backup | |
@@ -2637,6 +2641,8 b' def revert(ui, repo, ctx, parents, *pats' | |||||
2637 | (added, actions['remove'], discard), |
|
2641 | (added, actions['remove'], discard), | |
2638 | # Added in working directory |
|
2642 | # Added in working directory | |
2639 | (dsadded, actions['forget'], discard), |
|
2643 | (dsadded, actions['forget'], discard), | |
|
2644 | # Added since target but file is missing in working directory | |||
|
2645 | (deladded, actions['remove'], discard), | |||
2640 | # Removed since target, before working copy parent |
|
2646 | # Removed since target, before working copy parent | |
2641 | (removed, actions['add'], discard), |
|
2647 | (removed, actions['add'], discard), | |
2642 | # Same as `removed` but an unknown file exists at the same path |
|
2648 | # Same as `removed` but an unknown file exists at the same path |
General Comments 0
You need to be logged in to leave comments.
Login now