Skip to content
Snippets Groups Projects
Commit 07f03124 authored by Sean Farley's avatar Sean Farley
Browse files

git_handler: remove pre-2.8 code for bookmarks

parent f33faedc
No related branches found
No related tags found
No related merge requests found
......@@ -15,12 +15,5 @@
from dulwich import config as dul_config
from dulwich import diff_tree
try:
from mercurial import bookmarks
bookmarks.update
from mercurial import commands
except ImportError:
from hgext import bookmarks
from mercurial.i18n import _
from mercurial.node import hex, bin, nullid
......@@ -25,5 +18,7 @@
from mercurial.i18n import _
from mercurial.node import hex, bin, nullid
from mercurial import bookmarks
from mercurial import commands
from mercurial import context, util as hgutil
from mercurial import url
......@@ -266,8 +261,8 @@
self.update_remote_branches('default', refs)
# "Activate" a tipmost bookmark.
bms = getattr(self.repo['tip'], 'bookmarks',
lambda: None)()
bms = self.repo['tip'].bookmarks()
if bms:
try:
bookmarks.activate(self.repo, bms[0])
......@@ -1281,11 +1276,7 @@
def update_hg_bookmarks(self, refs):
try:
oldbm = getattr(bookmarks, 'parse', None)
if oldbm:
bms = bookmarks.parse(self.repo)
else:
bms = self.repo._bookmarks
bms = self.repo._bookmarks
heads = dict([(ref[11:], refs[ref]) for ref in refs
if ref.startswith('refs/heads/')])
......@@ -1308,14 +1299,7 @@
bms[head + suffix] = hgsha
if heads:
if oldbm:
bookmarks.write(self.repo, bms)
else:
self.repo._bookmarks = bms
if getattr(bms, 'write', None): # hg >= 2.5
bms.write()
else: # hg < 2.5
bookmarks.write(self.repo)
bms.write()
except AttributeError:
self.ui.warn(_('creating bookmarks failed, do you have'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment