shelve: handle empty parents and nodestoremove in shelvedstate (issue6748) stable
authorJason R. Coombs <jaraco@jaraco.com>
Wed, 19 Oct 2022 16:23:42 -0400
branchstable
changeset 49560 5f778b3a94ca
parent 49559 7787174f0a5a
child 49561 220738a53d05
shelve: handle empty parents and nodestoremove in shelvedstate (issue6748)
mercurial/shelve.py
--- a/mercurial/shelve.py	Thu Nov 03 14:58:58 2022 +0100
+++ b/mercurial/shelve.py	Wed Oct 19 16:23:42 2022 -0400
@@ -278,9 +278,9 @@
         try:
             d[b'originalwctx'] = bin(d[b'originalwctx'])
             d[b'pendingctx'] = bin(d[b'pendingctx'])
-            d[b'parents'] = [bin(h) for h in d[b'parents'].split(b' ')]
+            d[b'parents'] = [bin(h) for h in d[b'parents'].split(b' ') if h]
             d[b'nodestoremove'] = [
-                bin(h) for h in d[b'nodestoremove'].split(b' ')
+                bin(h) for h in d[b'nodestoremove'].split(b' ') if h
             ]
         except (ValueError, KeyError) as err:
             raise error.CorruptedState(stringutil.forcebytestr(err))