Patchwork [2,of,4] bookmarks: properly invalidate volatile sets when writing bookmarks

login
register
mail settings
Submitter Augie Fackler
Date May 5, 2016, 2:56 a.m.
Message ID <f3f96ad5b8314c87e787.1462416965@augie-macbookair2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/14888/
State Accepted
Headers show

Comments

Augie Fackler - May 5, 2016, 2:56 a.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1462416270 14400
#      Wed May 04 22:44:30 2016 -0400
# Node ID f3f96ad5b8314c87e7879553c2523dc3178f7a9d
# Parent  ef75c94c7e670127b18bcfeda68f13e3247d8a07
bookmarks: properly invalidate volatile sets when writing bookmarks

This corrects a regression introduced during the 3.7 cycle, but which
went undetected due to the surviving-but-deprecated write() method on
bmstore.

Patch

diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -181,6 +181,7 @@  class bmstore(dict):
         for name, node in self.iteritems():
             fp.write("%s %s\n" % (hex(node), encoding.fromlocal(name)))
         self._clean = True
+        self._repo.invalidatevolatilesets()
 
     def expandname(self, bname):
         if bname == '.':
diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
--- a/tests/test-obsolete.t
+++ b/tests/test-obsolete.t
@@ -1008,11 +1008,9 @@  bookmarks change
   $ echo "hello" > b
   $ hg commit --amend -m "message"
   $ hg book bookb -r 13bedc178fce --hidden
-  cache inconsistency
   $ hg log -r 13bedc178fce
   5:13bedc178fce (draft) [ bookb] add b
   $ hg book -d bookb
-  cache inconsistency
   $ hg log -r 13bedc178fce
   abort: hidden revision '13bedc178fce'!
   (use --hidden to access hidden revisions)