shelve: handle empty parents and nodestoremove in shelvedstate (
issue6748)
--- 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))