# HG changeset patch # User Martin von Zweigbergk # Date 2018-04-04 22:13:32 # Node ID e27298bf11dde3a7fe2aecfff8edca36b72f153f # Parent d5e1678026fd34ce5dd8f5b4c61bd503e50a2b63 bookmarks: calculateupdate() returns a bookmark, not a rev This changes the inaccurate/unclear documentation and also changes the code so "node" now contains a binary nodeid. Differential Revision: https://phab.mercurial-scm.org/D3087 diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py --- a/mercurial/bookmarks.py +++ b/mercurial/bookmarks.py @@ -349,8 +349,8 @@ def headsforactive(repo): return heads def calculateupdate(ui, repo, checkout): - '''Return a tuple (targetrev, movemarkfrom) indicating the rev to - check out and where to move the active bookmark from, if needed.''' + '''Return a tuple (activemark, movemarkfrom) indicating the active bookmark + and where to move the active bookmark from, if needed.''' movemarkfrom = None if checkout is None: activemark = repo._activebookmark diff --git a/mercurial/destutil.py b/mercurial/destutil.py --- a/mercurial/destutil.py +++ b/mercurial/destutil.py @@ -55,10 +55,10 @@ def _destupdateobs(repo, clean): def _destupdatebook(repo, clean): """decide on an update destination from active bookmark""" # we also move the active bookmark, if any - activemark = None - node, movemark = bookmarks.calculateupdate(repo.ui, repo, None) - if node is not None: - activemark = node + node = None + activemark, movemark = bookmarks.calculateupdate(repo.ui, repo, None) + if activemark is not None: + node = repo.lookup(activemark) return node, movemark, activemark def _destupdatebranch(repo, clean):