[PATCH] bookmarks: delegate writing to the repo just like reading

Augie Fackler durin42 at gmail.com
Wed Oct 12 11:22:14 CDT 2011


# HG changeset patch
# User Augie Fackler <durin42 at gmail.com>
# Date 1318435797 18000
# Node ID 6a5946704553faa1519eb301e5d79259e176b0c9
# Parent  ee625de3541ede9768309c649ae9b8e5023eed1b
bookmarks: delegate writing to the repo just like reading

This makes it easier for alternate storage backends to not use flat
files for bookmarks storage.

diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -146,7 +146,7 @@
             marks[mark] = new.node()
             update = True
     if update:
-        write(repo)
+        repo._writebookmarks(marks)
 
 def listbookmarks(repo):
     # We may try to list bookmarks on a repo type that does not
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -167,6 +167,9 @@
     def _bookmarkcurrent(self):
         return bookmarks.readcurrent(self)
 
+    def _writebookmarks(self, marks):
+      bookmarks.write(self)
+
     @filecache('00changelog.i', True)
     def changelog(self):
         c = changelog.changelog(self.sopener)


More information about the Mercurial-devel mailing list