Patchwork [1,of,3,V3] bookmarks: factor out repository lookup from writing bookmarks file

login
register
mail settings
Submitter Ryan McElroy
Date Dec. 3, 2014, 5:09 a.m.
Message ID <8904023bad6c33d48725.1417583360@devbig105.prn2.facebook.com>
Download mbox | patch
Permalink /patch/6972/
State Accepted
Headers show

Comments

Ryan McElroy - Dec. 3, 2014, 5:09 a.m.
# HG changeset patch
# User Ryan McElroy <rmcelroy@fb.com>
# Date 1417581079 28800
#      Tue Dec 02 20:31:19 2014 -0800
# Node ID 8904023bad6c33d487253918437b31ac04d98c9a
# Parent  9b523f33c407b5a575d7d37e8c49ed4d7ee0ad1b
bookmarks: factor out repository lookup from writing bookmarks file

This will allow the share extension to extend bookmarks functionality to share
bookmarks between repositories.
Matt Mackall - Dec. 4, 2014, 11:51 p.m.
On Tue, 2014-12-02 at 21:09 -0800, Ryan McElroy wrote:
> # HG changeset patch
> # User Ryan McElroy <rmcelroy@fb.com>
> # Date 1417581079 28800
> #      Tue Dec 02 20:31:19 2014 -0800
> # Node ID 8904023bad6c33d487253918437b31ac04d98c9a
> # Parent  9b523f33c407b5a575d7d37e8c49ed4d7ee0ad1b
> bookmarks: factor out repository lookup from writing bookmarks file
> 
> This will allow the share extension to extend bookmarks functionality to share
> bookmarks between repositories.

This one is queued, thanks.

Patch

diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -79,6 +79,10 @@  class bmstore(dict):
         can be copied back on rollback.
         '''
         repo = self._repo
+        self._writerepo(repo)
+
+    def _writerepo(self, repo):
+        """Factored out for extensibility"""
         if repo._bookmarkcurrent not in self:
             unsetcurrent(repo)