compat: drop compatibility layer for bookmark.applychanges
We now only support Mercurial version down to 4.3.
--- a/hgext3rd/evolve/__init__.py Thu Apr 19 16:15:10 2018 +0200
+++ b/hgext3rd/evolve/__init__.py Thu Apr 19 16:21:44 2018 +0200
@@ -981,7 +981,7 @@
tr = repo.transaction('previous')
if bookmark is not None:
bmchanges = [(bookmark, target.node())]
- compat.bookmarkapplychanges(repo, tr, bmchanges)
+ repo._bookmarks.applychanges(repo, tr, bmchanges)
else:
bookmarksmod.deactivate(repo)
tr.close()
@@ -1203,7 +1203,7 @@
tr = repo.transaction('next')
if shouldmove:
bmchanges = [(bm, children.node())]
- compat.bookmarkapplychanges(repo, tr, bmchanges)
+ repo._bookmarks.applychanges(repo, tr, bmchanges)
else:
bookmarksmod.deactivate(repo)
tr.close()
@@ -1244,7 +1244,7 @@
if not lock:
lock = repo.lock()
tr = repo.transaction('commit')
- compat.bookmarkapplychanges(repo, tr, bmchanges)
+ repo._bookmarks.applychanges(repo, tr, bmchanges)
tr.close()
return result
finally:
--- a/hgext3rd/evolve/cmdrewrite.py Thu Apr 19 16:15:10 2018 +0200
+++ b/hgext3rd/evolve/cmdrewrite.py Thu Apr 19 16:21:44 2018 +0200
@@ -1079,7 +1079,7 @@
if movebookmark:
bookmarksmod.deactivate(repo)
bmchanges = [(bookactive, newnode.node())]
- compat.bookmarkapplychanges(repo, tr, bmchanges)
+ repo._bookmarks.applychanges(repo, tr, bmchanges)
commands.update(ui, repo, newnode.rev())
ui.status(_('working directory now at %s\n')
% ui.label(str(newnode), 'evolve.node'))
--- a/hgext3rd/evolve/compat.py Thu Apr 19 16:15:10 2018 +0200
+++ b/hgext3rd/evolve/compat.py Thu Apr 19 16:21:44 2018 +0200
@@ -38,20 +38,6 @@
eh = exthelper.exthelper()
-# compatibility layer for mercurial < 4.3
-def bookmarkapplychanges(repo, tr, changes):
- """Apply a list of changes to bookmarks
- """
- bookmarks = repo._bookmarks
- if util.safehasattr(bookmarks, 'applychanges'):
- return bookmarks.applychanges(repo, tr, changes)
- for name, node in changes:
- if node is None:
- del bookmarks[name]
- else:
- bookmarks[name] = node
- bookmarks.recordchange(tr)
-
def isobsnotesupported():
# hack to know obsnote is supported. The patches for obsnote support was
# pushed before the obsfateprinter patches, so this will serve as a good
--- a/hgext3rd/evolve/evolvecmd.py Thu Apr 19 16:15:10 2018 +0200
+++ b/hgext3rd/evolve/evolvecmd.py Thu Apr 19 16:21:44 2018 +0200
@@ -596,7 +596,7 @@
for book in destbookmarks: # restore bookmark that rebase move
bmchanges.append((book, dest.node()))
if bmchanges:
- compat.bookmarkapplychanges(repo, tr, bmchanges)
+ repo._bookmarks.applychanges(repo, tr, bmchanges)
def _evolvemerge(repo, orig, dest, pctx, keepbranch):
"""Used by the evolve function to merge dest on top of pctx.
@@ -1323,7 +1323,7 @@
# restoring bookmarks at there original place
bmchanges = evolvestate['bookmarkchanges']
if bmchanges:
- compat.bookmarkapplychanges(repo, tr, bmchanges)
+ repo._bookmarks.applychanges(repo, tr, bmchanges)
tr.close()
finally:
tr.release()
--- a/hgext3rd/evolve/rewriteutil.py Thu Apr 19 16:15:10 2018 +0200
+++ b/hgext3rd/evolve/rewriteutil.py Thu Apr 19 16:21:44 2018 +0200
@@ -86,7 +86,7 @@
oldbookmarks = repo.nodebookmarks(oldid)
bmchanges = [(b, newid) for b in oldbookmarks]
if bmchanges:
- compat.bookmarkapplychanges(repo, tr, bmchanges)
+ repo._bookmarks.applychanges(repo, tr, bmchanges)
return updatebookmarks
def disallowednewunstable(repo, revs):
@@ -125,7 +125,7 @@
bmchanges = []
for bookmark in bookmarks:
bmchanges.append((bookmark, None))
- compat.bookmarkapplychanges(repo, tr, bmchanges)
+ repo._bookmarks.applychanges(repo, tr, bmchanges)
tr.close()
for bookmark in sorted(bookmarks):
repo.ui.write(_("bookmark '%s' deleted\n") % bookmark)