Mercurial > hg-stable
changeset 13365:f1c5294e9119
bookmarks: merge suspect addchangegroup into core
This is marked with FIXME because it's not clear that it makes any sense.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 10 Feb 2011 13:46:28 -0600 |
parents | ddddb76f2da3 |
children | c756e9166417 |
files | hgext/bookmarks.py mercurial/localrepo.py |
diffstat | 2 files changed, 4 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/bookmarks.py Thu Feb 10 13:46:28 2011 -0600 +++ b/hgext/bookmarks.py Thu Feb 10 13:46:28 2011 -0600 @@ -129,23 +129,6 @@ 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'):
--- a/mercurial/localrepo.py Thu Feb 10 13:46:28 2011 -0600 +++ b/mercurial/localrepo.py Thu Feb 10 13:46:28 2011 -0600 @@ -1891,6 +1891,10 @@ 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