Patchwork D2966: context: remove unwanted assignments in basectx.__new__() (API)

login
register
mail settings
Submitter phabricator
Date March 30, 2018, 6:10 a.m.
Message ID <differential-rev-PHID-DREV-ngep4afdt2kyv5ebafai-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/29946/
State Superseded
Headers show

Comments

phabricator - March 30, 2018, 6:10 a.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The two subclasses in core apparently didn't trust __new__() to do the
  job anyway (they both reassigned all the properties after).

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -66,13 +66,7 @@ 
         if isinstance(changeid, basectx):
             return changeid
 
-        o = super(basectx, cls).__new__(cls)
-
-        o._repo = repo
-        o._rev = nullrev
-        o._node = nullid
-
-        return o
+        return super(basectx, cls).__new__(cls)
 
     def __bytes__(self):
         return short(self.node())