# HG changeset patch # User Pierre-Yves David # Date 1701917388 -3600 # Node ID 1486d8c63f641ba28a2937b61b3feed04d6a50c4 # Parent e306d552dfb126efec571c5834400c84809c7efb persistent-nodemap: avoid writing nodemap for empty revlog The format cannot encode the lack of tip_rev. There is currently nothing known to write such empty nodemap right now, but the change we are preparing on default reveal this issue. So I had rather fix it on stable. diff -r e306d552dfb1 -r 1486d8c63f64 mercurial/revlogutils/nodemap.py --- a/mercurial/revlogutils/nodemap.py Tue Dec 12 11:47:48 2023 +0100 +++ b/mercurial/revlogutils/nodemap.py Thu Dec 07 03:49:48 2023 +0100 @@ -163,6 +163,8 @@ def persist_nodemap(tr, revlog, pending=False, force=False): """Write nodemap data on disk for a given revlog""" + if len(revlog.index) <= 0: + return if getattr(revlog, 'filteredrevs', ()): raise error.ProgrammingError( "cannot persist nodemap of a filtered changelog"