changeset 31663:f33c9a5e81cd

metadataonlyctx: speed up sanity check Previously the sanity check will construct manifestctx for both p1 and p2. But it only needs the "manifest node" information, which could be read from changelog directly.
author Jun Wu <quark@fb.com>
date Sun, 26 Mar 2017 12:26:35 -0700
parents 080734cd2440
children 1cbeefa59343
files mercurial/context.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Fri Feb 24 18:39:08 2017 +0100
+++ b/mercurial/context.py	Sun Mar 26 12:26:35 2017 -0700
@@ -2054,10 +2054,10 @@
         # sanity check to ensure that the reused manifest parents are
         # manifests of our commit parents
         mp1, mp2 = self.manifestctx().parents
-        if p1 != nullid and p1.manifestctx().node() != mp1:
+        if p1 != nullid and p1.changeset()[0] != mp1:
             raise RuntimeError('can\'t reuse the manifest: '
                                'its p1 doesn\'t match the new ctx p1')
-        if p2 != nullid and p2.manifestctx().node() != mp2:
+        if p2 != nullid and p2.changeset()[0] != mp2:
             raise RuntimeError('can\'t reuse the manifest: '
                                'its p2 doesn\'t match the new ctx p2')