Patchwork D2968: memctx: create parent contexts using "repo[p]" syntax

login
register
mail settings
Submitter phabricator
Date March 30, 2018, 6:10 a.m.
Message ID <differential-rev-PHID-DREV-4awe6dtq3ro4oa26vnwd-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/29947/
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
  I want to reduce dependence on basectx.__new__() and move that code
  over to repo.__getitem__().

REPOSITORY
  rHG Mercurial

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

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
@@ -2284,7 +2284,7 @@ 
         self._node = None
         parents = [(p or nullid) for p in parents]
         p1, p2 = parents
-        self._parents = [changectx(self._repo, p) for p in (p1, p2)]
+        self._parents = [self._repo[p] for p in (p1, p2)]
         files = sorted(set(files))
         self._files = files
         if branch is not None: