# HG changeset patch # User Martin von Zweigbergk # Date 1600900575 25200 # Node ID 5ed6efedc457b03eb1abf472aeefb589351ca863 # Parent 5a555d6e0d9090d7751829e86678244367eaabbc repoview: don't crash if mergestate points to non-existent node Differential Revision: https://phab.mercurial-scm.org/D9078 diff -r 5a555d6e0d90 -r 5ed6efedc457 mercurial/repoview.py --- a/mercurial/repoview.py Wed Sep 23 16:07:14 2020 -0700 +++ b/mercurial/repoview.py Wed Sep 23 15:36:15 2020 -0700 @@ -70,8 +70,10 @@ ms = mergestate.mergestate.read(repo) if ms.active(): - pinned.add(ms.localctx.rev()) - pinned.add(ms.otherctx.rev()) + for node in (ms.local, ms.other): + rev = cl.index.get_rev(node) + if rev is not None: + pinned.add(rev) return pinned diff -r 5a555d6e0d90 -r 5ed6efedc457 tests/test-obsolete.t --- a/tests/test-obsolete.t Wed Sep 23 16:07:14 2020 -0700 +++ b/tests/test-obsolete.t Wed Sep 23 15:36:15 2020 -0700 @@ -1826,8 +1826,8 @@ ancestor path: file (node bc7ebe2d260cff30d2a39a130d84add36216f791) other path: file (node b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3) extra: ancestorlinknode = b73b8c9a4ab4da89a5a35a6f10dfb13edc84ca37 -BROKEN: We should be able to see the log (without the deleted commit, of course) +We should be able to see the log (without the deleted commit, of course) $ hg log -G - abort: unknown revision 'b73b8c9a4ab4da89a5a35a6f10dfb13edc84ca37'! - [255] + @ 0:f53e9479dce5 (draft) [tip ] first + $ cd ..