diff mercurial/destutil.py @ 32420:b9942bc6b292

localrepo: extract bookmarkheads method to bookmarks.py This method is only used internally by destutil, and it's obscure enough I'm willing to just move it without a deprecation warning, especially since the new method has more constrained functionality. Design-wise I'd also like to get active bookmark handling folded into the bookmark store, so that we don't squirrel away an extra attribute for the active bookmark on the repository object.
author Augie Fackler <augie@google.com>
date Thu, 18 May 2017 16:43:56 -0400
parents 6cf2857526c7
children 1b5c61d38a52
line wrap: on
line diff
--- a/mercurial/destutil.py	Sat May 20 20:50:29 2017 -0400
+++ b/mercurial/destutil.py	Thu May 18 16:43:56 2017 -0400
@@ -234,7 +234,7 @@
 def _destmergebook(repo, action='merge', sourceset=None, destspace=None):
     """find merge destination in the active bookmark case"""
     node = None
-    bmheads = repo.bookmarkheads(repo._activebookmark)
+    bmheads = bookmarks.headsforactive(repo)
     curhead = repo[repo._activebookmark].node()
     if len(bmheads) == 2:
         if curhead == bmheads[0]:
@@ -355,7 +355,7 @@
     return None
 
 def _statusotherbook(ui, repo):
-    bmheads = repo.bookmarkheads(repo._activebookmark)
+    bmheads = bookmarks.headsforactive(repo)
     curhead = repo[repo._activebookmark].node()
     if repo.revs('%n and parents()', curhead):
         # we are on the active bookmark