[PATCH STABLE] obsolete: invalidate "volatile" set cache after merging marker

Pierre-Yves David pierre-yves.david at ens-lyon.org
Wed May 17 13:46:26 UTC 2017


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at octobus.net>
# Date 1495028377 -7200
#      Wed May 17 15:39:37 2017 +0200
# Branch stable
# Node ID 99515353c72a4c54e4aac1a2ad4f8f724c7fdc9c
# Parent  176ed32dc159b63a8edd1fd9faaba90bc7d924a6
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r 99515353c72a
obsolete: invalidate "volatile" set cache after merging marker

Adding markers to the repository might affect the set of obsolete changesets. So we
most remove the "volatile" set who rely in that data. We add two missing
invalidations after merging markers. This was caught by code change in the evolve
extensions tests.

This issues highlight that the current way to do things is a bit fragile,
however we keep things simple for stable.

diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -1631,6 +1631,7 @@ def handleobsmarker(op, inpart):
         op.repo.ui.debug('ignoring obsolescence markers, feature not enabled')
         return
     new = op.repo.obsstore.mergemarkers(tr, markerdata)
+    op.repo.invalidatevolatilesets()
     if new:
         op.repo.ui.status(_('%i new obsolescence markers\n') % new)
     op.records.add('obsmarkers', {'new': new})
diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -767,6 +767,7 @@ def pushmarker(repo, key, old, new):
         tr = repo.transaction('pushkey: obsolete markers')
         try:
             repo.obsstore.mergemarkers(tr, data)
+            repo.invalidatevolatilesets()
             tr.close()
             return 1
         finally:


More information about the Mercurial-devel mailing list