[PATCH 04 of 10] py3: convert key to str to make kwargs.pop work

Pulkit Goyal 7895pulkit at gmail.com
Fri May 5 23:01:16 EDT 2017


# HG changeset patch
# User Pulkit Goyal <7895pulkit at gmail.com>
# Date 1493939922 -19800
#      Fri May 05 04:48:42 2017 +0530
# Node ID cfc021a731d59f713ffa1c54eb855d680125168b
# Parent  6b6133f042eff0ca52612a58e8b071dffdfb7347
py3: convert key to str to make kwargs.pop work

The keys are passed here and there as unicodes and our transformer make things
bytes. Due to that, mq was not poped and this results in error on Py3.
Here we abuse r'' to make that str on Python 3.

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -3540,7 +3540,7 @@
     """Add --mq option to operate on patch repository instead of main"""
 
     # some commands do not like getting unknown options
-    mq = kwargs.pop('mq', None)
+    mq = kwargs.pop(r'mq', None)
 
     if not mq:
         return orig(ui, repo, *args, **kwargs)


More information about the Mercurial-devel mailing list