bookmarks: stop wrapping bookmarks.write

Summary:
Upstream mercurial has deleted bookmarks.write() since all bookmark writes
happen via transactions now. So we can delete our write wrapper for that. We
already wrap transaction closes, so nothing new needs to be added.

Test Plan: Ran the tests

Reviewers: #mercurial, ttung, rmcelroy

Reviewed By: rmcelroy

Differential Revision: https://phabricator.intern.facebook.com/D3289117

Signature: t1:3289117:1463000038:aaf3454059514d92a017bd579b6de0691b334795
This commit is contained in:
Durham Goode 2016-05-11 13:54:21 -07:00
parent c58a61d5cd
commit 95858fbd8a

View File

@ -121,8 +121,6 @@ def uisetup(ui):
# Reorder incoming revs to be in linkrev order
wrapfunction(revlog.revlog, 'addgroup', addgroup)
# Write SQL bookmarks at the same time as local bookmarks
wrapfunction(bookmarks.bmstore, 'write', bookmarkwrite)
def extsetup(ui):
if ui.configbool('hgsql', 'enabled'):
@ -1390,31 +1388,6 @@ def bookmarkcommand(orig, ui, repo, *names, **opts):
else:
return _bookmarkcommand()
def bookmarkwrite(orig, self):
repo = self._repo
if not issqlrepo(repo) or repo.disablesync:
return orig(self)
if not repo.sqlconn:
raise util.Abort("attempted bookmark write without sql connection")
elif not repo.hassqllock(writelock):
raise util.Abort("attempted bookmark write without write lock")
try:
cursor = repo.sqlcursor
cursor.execute("""DELETE FROM revision_references WHERE repo = %s AND
namespace = 'bookmarks'""", (repo.sqlreponame,))
for k, v in self.iteritems():
cursor.execute("""INSERT INTO revision_references(repo, namespace, name, value)
VALUES(%s, 'bookmarks', %s, %s)""",
(repo.sqlreponame, k, hex(v)))
repo.sqlconn.commit()
return orig(self)
except:
repo.sqlconn.rollback()
raise
def pushkey(orig, repo, proto, namespace, key, old, new):
if issqlrepo(repo):
def commitpushkey():