diff --git a/mercurial/discovery.py b/mercurial/discovery.py --- a/mercurial/discovery.py +++ b/mercurial/discovery.py @@ -297,12 +297,12 @@ for bm in localbookmarks: rnode = remotebookmarks.get(bm) if rnode and rnode in repo: - lctx, rctx = repo[bm], repo[rnode] + lctx, rctx = localbookmarks.ctx(bm), repo[rnode] if bookmarks.validdest(repo, rctx, lctx): bookmarkedheads.add(lctx.node()) else: if bm in newbookmarks and bm not in remotebookmarks: - bookmarkedheads.add(repo[bm].node()) + bookmarkedheads.add(localbookmarks[bm]) return bookmarkedheads