Patchwork D2435: commitextras: fix on Python 3 by using sysstrs for __dict__ ops

login
register
mail settings
Submitter phabricator
Date Feb. 26, 2018, 3:49 a.m.
Message ID <differential-rev-PHID-DREV-efwlpbg5cuh23iqgi5we-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28357/
State Superseded
Headers show

Comments

phabricator - Feb. 26, 2018, 3:49 a.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I'm dubious of the __dict__ shenanigans in use here, but lack the
  enthusiasm for figuring out why that was done right now.
  
  1. skip-blame just some r prefixes

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/commitextras.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel
phabricator - Feb. 26, 2018, 5:36 a.m.
indygreg accepted this revision.
indygreg added a comment.
This revision is now accepted and ready to land.


  That `__dict__` usage is... special.

REPOSITORY
  rHG Mercurial

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

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

Patch

diff --git a/hgext/commitextras.py b/hgext/commitextras.py
--- a/hgext/commitextras.py
+++ b/hgext/commitextras.py
@@ -70,7 +70,7 @@ 
 
         # This __dict__ logic is needed because the normal
         # extension.wrapfunction doesn't seem to work.
-        repo.__dict__['commit'] = _wrappedcommit
+        repo.__dict__[r'commit'] = _wrappedcommit
         return orig(ui, repo, *pats, **opts)
     finally:
-        del repo.__dict__['commit']
+        del repo.__dict__[r'commit']