mercurial/cmdutil.py
changeset 22608 bf0ecb224316
parent 22588 cd1b43226b34
child 22609 3760ebf786b8
--- 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: