diff mercurial/shelve.py @ 49560:5f778b3a94ca stable

shelve: handle empty parents and nodestoremove in shelvedstate (issue6748)
author Jason R. Coombs <jaraco@jaraco.com>
date Wed, 19 Oct 2022 16:23:42 -0400
parents a3356ab610fc
children 636cd96806a7
line wrap: on
line diff
--- 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))