bookmarks: delegate writing to the repo just like reading
authorAugie Fackler <durin42@gmail.com>
Wed, 12 Oct 2011 11:09:57 -0500
changeset 15237 7196ed7a1505
parent 15236 4fae5df4b1bb
child 15238 2d710c12ffc0
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.
mercurial/bookmarks.py
mercurial/localrepo.py
--- a/mercurial/bookmarks.py	Wed Oct 12 22:01:14 2011 +0200
+++ b/mercurial/bookmarks.py	Wed Oct 12 11:09:57 2011 -0500
@@ -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
--- a/mercurial/localrepo.py	Wed Oct 12 22:01:14 2011 +0200
+++ b/mercurial/localrepo.py	Wed Oct 12 11:09:57 2011 -0500
@@ -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)