diff --git a/hgext/bookmarks.py b/hgext/bookmarks.py --- a/hgext/bookmarks.py +++ b/hgext/bookmarks.py @@ -129,23 +129,6 @@ def bookmark(ui, repo, mark=None, rev=No label=label) return -def reposetup(ui, repo): - if not repo.local(): - return - - class bookmark_repo(repo.__class__): - def addchangegroup(self, *args, **kwargs): - result = super(bookmark_repo, self).addchangegroup(*args, **kwargs) - if result > 1: - # We have more heads than before - return result - node = self.changelog.tip() - parents = self.dirstate.parents() - bookmarks.update(self, parents, node) - return result - - repo.__class__ = bookmark_repo - def pull(oldpull, ui, repo, source="default", **opts): # translate bookmark args to rev args for actual pull if opts.get('bookmark'): diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1891,6 +1891,10 @@ class localrepository(repo.repository): self.hook("incoming", node=hex(cl.node(i)), source=srctype, url=url) + # FIXME - why does this care about tip? + if newheads == oldheads: + bookmarks.update(self, self.dirstate.parents(), self['tip'].node()) + # never return 0 here: if newheads < oldheads: return newheads - oldheads - 1