Patchwork D6565: drawdag: don't crash when writing copy info to changesets

login
register
mail settings
Submitter phabricator
Date June 21, 2019, 5:01 p.m.
Message ID <differential-rev-PHID-DREV-uwuilhdk7gne2huroq67-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/40645/
State Superseded
Headers show

Comments

phabricator - June 21, 2019, 5:01 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  When writing copies to the changeset, localrepo.commitctx() will call
  ctx.p1copies() and ctx.p2copies(). These crashed on simplecommitctx
  because they ended up trying to access the manifest. drawdag doesn't
  support copies at all, so we can simply override the methods to return
  empty dicts.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/drawdag.py

CHANGE DETAILS




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

Patch

diff --git a/tests/drawdag.py b/tests/drawdag.py
--- a/tests/drawdag.py
+++ b/tests/drawdag.py
@@ -300,6 +300,12 @@ 
     def commit(self):
         return self._repo.commitctx(self)
 
+    def p1copies(self):
+        return {}
+
+    def p2copies(self):
+        return {}
+
 def _walkgraph(edges):
     """yield node, parents in topologically order"""
     visible = set(edges.keys())