Patchwork D3635: py3: add support for NoneType in stringutil.pprint()

login
register
mail settings
Submitter phabricator
Date May 21, 2018, 6:36 p.m.
Message ID <1ed18cf92b4076efe113fa1161a94a23@localhost.localdomain>
Download mbox | patch
Permalink /patch/31788/
State Not Applicable
Headers show

Comments

phabricator - May 21, 2018, 6:36 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG7aeb8aa262eb: py3: add support for NoneType in stringutil.pprint() (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3635?vs=8843&id=8860

REVISION DETAIL
  https://phab.mercurial-scm.org/D3635

AFFECTED FILES
  mercurial/utils/stringutil.py

CHANGE DETAILS




To: pulkit, #hg-reviewers, indygreg
Cc: mercurial-devel

Patch

diff --git a/mercurial/utils/stringutil.py b/mercurial/utils/stringutil.py
--- a/mercurial/utils/stringutil.py
+++ b/mercurial/utils/stringutil.py
@@ -29,6 +29,8 @@ 
         if bprefix:
             return "b'%s'" % escapestr(o)
         return "'%s'" % escapestr(o)
+    elif o is None:
+        return 'None'
     elif isinstance(o, bytearray):
         # codecs.escape_encode() can't handle bytearray, so escapestr fails
         # without coercion.