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

login
register
mail settings
Submitter Pierre-Yves David
Date May 17, 2017, 1:46 p.m.
Message ID <99515353c72a4c54e4aa.1495028786@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/20652/
State Accepted
Headers show

Comments

Pierre-Yves David - May 17, 2017, 1:46 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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.
Augie Fackler - May 17, 2017, 7:45 p.m.
On Wed, May 17, 2017 at 03:46:26PM +0200, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@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

queued for stable, thanks

Patch

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: