##// END OF EJS Templates
revert: add a `drop` action...
Pierre-Yves David -
r22491:5e16fe6f default
parent child Browse files
Show More
@@ -2613,6 +2613,7 b' def revert(ui, repo, ctx, parents, *pats'
2613 actions = {'revert': ([], _('reverting %s\n')),
2613 actions = {'revert': ([], _('reverting %s\n')),
2614 'add': ([], _('adding %s\n')),
2614 'add': ([], _('adding %s\n')),
2615 'remove': ([], _('removing %s\n')),
2615 'remove': ([], _('removing %s\n')),
2616 'drop': ([], _('removing %s\n')),
2616 'forget': ([], _('forgetting %s\n')),
2617 'forget': ([], _('forgetting %s\n')),
2617 'undelete': ([], _('undeleting %s\n')),
2618 'undelete': ([], _('undeleting %s\n')),
2618 'noop': (None, _('no changes needed to %s\n')),
2619 'noop': (None, _('no changes needed to %s\n')),
@@ -2642,7 +2643,7 b' def revert(ui, repo, ctx, parents, *pats'
2642 # Added in working directory
2643 # Added in working directory
2643 (dsadded, actions['forget'], discard),
2644 (dsadded, actions['forget'], discard),
2644 # Added since target but file is missing in working directory
2645 # Added since target but file is missing in working directory
2645 (deladded, actions['remove'], discard),
2646 (deladded, actions['drop'], discard),
2646 # Removed since target, before working copy parent
2647 # Removed since target, before working copy parent
2647 (removed, actions['add'], discard),
2648 (removed, actions['add'], discard),
2648 # Same as `removed` but an unknown file exists at the same path
2649 # Same as `removed` but an unknown file exists at the same path
@@ -2721,10 +2722,10 b' def _performrevert(repo, parents, ctx, a'
2721 repo.dirstate.drop(f)
2722 repo.dirstate.drop(f)
2722 for f in actions['remove'][0]:
2723 for f in actions['remove'][0]:
2723 audit_path(f)
2724 audit_path(f)
2724 try:
2725 util.unlinkpath(repo.wjoin(f))
2725 util.unlinkpath(repo.wjoin(f))
2726 repo.dirstate.remove(f)
2726 except OSError:
2727 for f in actions['drop'][0]:
2727 pass
2728 audit_path(f)
2728 repo.dirstate.remove(f)
2729 repo.dirstate.remove(f)
2729
2730
2730 normal = None
2731 normal = None
General Comments 0
You need to be logged in to leave comments. Login now