[PATCH] localrepo: drop useless `_writebookmarks`

pierre-yves.david at logilab.fr pierre-yves.david at logilab.fr
Fri Oct 5 10:10:13 CDT 2012

# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at logilab.fr>
# Date 1349446892 -7200
# Node ID 24751fbcc88c649b74961c05c8b7ead6f4daa7c2
# Parent  43b35b70f0a42d34a536ba17baf9928a7c002e8b
localrepo: drop useless `_writebookmarks`

This function was the same as `mercurial.bookmarks.write` but took an unused

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -61,11 +61,11 @@ such as -f/--force or --exact are passed
 from mercurial.i18n import _
 from mercurial.node import bin, hex, short, nullid, nullrev
 from mercurial.lock import release
 from mercurial import commands, cmdutil, hg, scmutil, util, revset
-from mercurial import repair, extensions, url, error, phases
+from mercurial import repair, extensions, url, error, phases, bookmarks
 from mercurial import patch as patchmod
 import os, re, errno, shutil
 commands.norepo += " qclone"
@@ -2980,11 +2980,11 @@ def strip(ui, repo, *revs, **opts):
                                "ancestors(bookmark() and not bookmark(%s))",
                                mark, mark, mark)
         if not revs:
             del marks[mark]
-            repo._writebookmarks(mark)
+            bookmarks.write(repo)
             ui.write(_("bookmark '%s' deleted\n") % mark)
     if not revs:
         raise util.Abort(_('empty revision set'))
@@ -3030,11 +3030,11 @@ def strip(ui, repo, *revs, **opts):
     if opts.get('bookmark'):
         del marks[mark]
-        repo._writebookmarks(marks)
+        bookmarks.write(repo)
         ui.write(_("bookmark '%s' deleted\n") % mark)
     repo.mq.strip(repo, revs, backup=backup, update=update,
diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -163,11 +163,11 @@ def update(repo, parents, node):
                 marks[cur] = new.node()
                 update = True
             if mark != cur:
                 del marks[mark]
     if update:
-        repo._writebookmarks(marks)
+        write(repo)
     return update
 def listbookmarks(repo):
     # We may try to list bookmarks on a repo type that does not
     # support it (e.g., statichttprepository).
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -269,13 +269,10 @@ class localrepository(object):
     def _bookmarkcurrent(self):
         return bookmarks.readcurrent(self)
-    def _writebookmarks(self, marks):
-        bookmarks.write(self)
     def bookmarkheads(self, bookmark):
         name = bookmark.split('@', 1)[0]
         heads = []
         for mark, n in self._bookmarks.iteritems():
             if mark.split('@', 1)[0] == name:

More information about the Mercurial-devel mailing list