# HG changeset patch # User Jason R. Coombs # Date 2022-10-19 20:23:42 # Node ID 5f778b3a94ca1c9f048e002d267899ed4651473e # Parent 7787174f0a5a51361f846f5d90993b075c576ba9 shelve: handle empty parents and nodestoremove in shelvedstate (issue6748) diff --git a/mercurial/shelve.py b/mercurial/shelve.py --- a/mercurial/shelve.py +++ b/mercurial/shelve.py @@ -278,9 +278,9 @@ class shelvedstate: 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))