# HG changeset patch # User Pierre-Yves David # Date 1409358507 -7200 # Node ID bf0ecb2243162f1fde972e1c5d63f1821048f04c # Parent 4a00110fd8708373ed8e69f96367383b2dd10661 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. diff -r 4a00110fd870 -r bf0ecb224316 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Wed Oct 01 15:05:09 2014 -0500 +++ b/mercurial/cmdutil.py Sat Aug 30 02:28:27 2014 +0200 @@ -2626,10 +2626,13 @@ 'unknown': (None, _('file not managed: %s\n')), } - - # should we do a backup? - backup = not opts.get('no_backup') - discard = False + # "constant" that convey the backup strategy. + # All set to `discard` if `no-backup` is set do avoid checking + # no_backup lower in the code. + backup = 2 # unconditionally do backup + discard = 0 # never do backup + if opts.get('no_backup'): + backup = discard disptable = ( # dispatch table: