Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/cmdutil.py @ 22608:bf0ecb224316
revert: small refactoring in the way backup value are handled
The current backup value may have two different values:
1. Do not try to do backup
2. Do backup if applicable
We are about to move to:
1. Do not try to do backup
2. Do backup if applicable
3. Do backup in all cases
So we change the current values to make room for the new one.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Sat, 30 Aug 2014 02:28:27 +0200 |
parents | cd1b43226b34 |
children | 3760ebf786b8 |
comparison
equal
deleted
inserted
replaced
22607:4a00110fd870 | 22608:bf0ecb224316 |
---|---|
2624 'undelete': ([], _('undeleting %s\n')), | 2624 'undelete': ([], _('undeleting %s\n')), |
2625 'noop': (None, _('no changes needed to %s\n')), | 2625 'noop': (None, _('no changes needed to %s\n')), |
2626 'unknown': (None, _('file not managed: %s\n')), | 2626 'unknown': (None, _('file not managed: %s\n')), |
2627 } | 2627 } |
2628 | 2628 |
2629 | 2629 # "constant" that convey the backup strategy. |
2630 # should we do a backup? | 2630 # All set to `discard` if `no-backup` is set do avoid checking |
2631 backup = not opts.get('no_backup') | 2631 # no_backup lower in the code. |
2632 discard = False | 2632 backup = 2 # unconditionally do backup |
2633 discard = 0 # never do backup | |
2634 if opts.get('no_backup'): | |
2635 backup = discard | |
2633 | 2636 |
2634 disptable = ( | 2637 disptable = ( |
2635 # dispatch table: | 2638 # dispatch table: |
2636 # file state | 2639 # file state |
2637 # action | 2640 # action |