##// END OF EJS Templates
revert: have an explicit action for "forget"...
Pierre-Yves David -
r22489:0d57bf80 default
parent child Browse files
Show More
@@ -2604,18 +2604,12 b' def revert(ui, repo, ctx, parents, *pats'
2604 2604 dsremovunk.add(abs)
2605 2605 dsremoved -= dsremovunk
2606 2606
2607 ## computation of the action to performs on `names` content.
2608
2609 def removeforget(abs):
2610 if repo.dirstate[abs] == 'a':
2611 return _('forgetting %s\n')
2612 return _('removing %s\n')
2613
2614 2607 # action to be actually performed by revert
2615 2608 # (<list of file>, message>) tuple
2616 2609 actions = {'revert': ([], _('reverting %s\n')),
2617 2610 'add': ([], _('adding %s\n')),
2618 'remove': ([], removeforget),
2611 'remove': ([], _('removing %s\n')),
2612 'forget': ([], _('forgetting %s\n')),
2619 2613 'undelete': ([], _('undeleting %s\n')),
2620 2614 'noop': (None, _('no changes needed to %s\n')),
2621 2615 'unknown': (None, _('file not managed: %s\n')),
@@ -2642,7 +2636,7 b' def revert(ui, repo, ctx, parents, *pats'
2642 2636 # Added since target
2643 2637 (added, actions['remove'], discard),
2644 2638 # Added in working directory
2645 (dsadded, actions['remove'], discard),
2639 (dsadded, actions['forget'], discard),
2646 2640 # Removed since target, before working copy parent
2647 2641 (removed, actions['add'], discard),
2648 2642 # Same as `removed` but an unknown file exists at the same path
@@ -2717,10 +2711,9 b' def _performrevert(repo, parents, ctx, a'
2717 2711 repo.wwrite(f, fc.data(), fc.flags())
2718 2712
2719 2713 audit_path = pathutil.pathauditor(repo.root)
2714 for f in actions['forget'][0]:
2715 repo.dirstate.drop(f)
2720 2716 for f in actions['remove'][0]:
2721 if repo.dirstate[f] == 'a':
2722 repo.dirstate.drop(f)
2723 continue
2724 2717 audit_path(f)
2725 2718 try:
2726 2719 util.unlinkpath(repo.wjoin(f))
General Comments 0
You need to be logged in to leave comments. Login now