Mercurial > public > mercurial-scm > hg
comparison mercurial/cmdutil.py @ 22371:81ad62defef5
revert: add documentation in the dispatch table
More sets are coming so documenting the existing ones will help.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Sat, 30 Aug 2014 01:48:58 +0200 |
parents | 45e02cfad4bd |
children | 8da5864dcfda |
comparison
equal
deleted
inserted
replaced
22370:45e02cfad4bd | 22371:81ad62defef5 |
---|---|
2516 disptable = ( | 2516 disptable = ( |
2517 # dispatch table: | 2517 # dispatch table: |
2518 # file state | 2518 # file state |
2519 # action | 2519 # action |
2520 # make backup | 2520 # make backup |
2521 | |
2522 ## Sets that results that will change file on disk | |
2523 # Modified compared to target, no local change | |
2521 (modified, actions['revert'], discard), | 2524 (modified, actions['revert'], discard), |
2525 # Modified compared to target, local change | |
2522 (dsmodified, actions['revert'], backup), | 2526 (dsmodified, actions['revert'], backup), |
2527 # Added since target | |
2523 (dsadded, actions['remove'], backup), | 2528 (dsadded, actions['remove'], backup), |
2529 # Removed since target, before working copy parent | |
2524 (removed, actions['add'], backup), | 2530 (removed, actions['add'], backup), |
2531 # Removed since targe, marked as such in working copy parent | |
2525 (dsremoved, actions['undelete'], backup), | 2532 (dsremoved, actions['undelete'], backup), |
2533 ## the following sets does not result in any file changes | |
2534 # File with no modification | |
2526 (clean, actions['noop'], discard), | 2535 (clean, actions['noop'], discard), |
2536 # Existing file, not tracked anywhere | |
2527 (unknown, actions['unknown'], discard), | 2537 (unknown, actions['unknown'], discard), |
2528 ) | 2538 ) |
2529 | 2539 |
2530 needdata = ('revert', 'add', 'remove', 'undelete') | 2540 needdata = ('revert', 'add', 'remove', 'undelete') |
2531 _revertprefetch(repo, ctx, *[actions[name][0] for name in needdata]) | 2541 _revertprefetch(repo, ctx, *[actions[name][0] for name in needdata]) |