Patchwork [5,of,7] py3: handle opts correctly for rollback

login
register
mail settings
Submitter Pulkit Goyal
Date May 4, 2017, 3:16 a.m.
Message ID <0eb19bf539912f8d2b07.1493867807@pulkit-goyal>
Download mbox | patch
Permalink /patch/20418/
State Accepted
Headers show

Comments

Pulkit Goyal - May 4, 2017, 3:16 a.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1492988524 -19800
#      Mon Apr 24 04:32:04 2017 +0530
# Node ID 0eb19bf539912f8d2b07d93ef3feb22c177cd938
# Parent  3acb9078079918d8de45d96619f8c12871828fa3
py3: handle opts correctly for rollback

dryrun and force are just check for None, the value is not used. So its better
to leave opts as unicodes as that wont harm us.

Patch

diff -r 3acb90780799 -r 0eb19bf53991 mercurial/commands.py
--- a/mercurial/commands.py	Fri Apr 21 15:04:32 2017 +0530
+++ b/mercurial/commands.py	Mon Apr 24 04:32:04 2017 +0530
@@ -4624,8 +4624,8 @@ 
     if not ui.configbool('ui', 'rollback', True):
         raise error.Abort(_('rollback is disabled because it is unsafe'),
                           hint=('see `hg help -v rollback` for information'))
-    return repo.rollback(dryrun=opts.get('dry_run'),
-                         force=opts.get('force'))
+    return repo.rollback(dryrun=opts.get(r'dry_run'),
+                         force=opts.get(r'force'))
 
 @command('root', [])
 def root(ui, repo):