Mercurial > hg
diff mercurial/localrepo.py @ 3803:2aef481ac73c
Don't report an error when closing heads during local push (issue387)
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Tue, 05 Dec 2006 23:25:28 +0100 |
parents | bd7011246fab |
children | b3b868113d24 a4457828ca1a |
line wrap: on
line diff
--- a/mercurial/localrepo.py Tue Dec 05 22:46:36 2006 +0100 +++ b/mercurial/localrepo.py Tue Dec 05 23:25:28 2006 +0100 @@ -1742,8 +1742,13 @@ def addchangegroup(self, source, srctype, url): """add changegroup to repo. - returns number of heads modified or added + 1.""" + return values: + - nothing changed or no source: 0 + - more heads than before: 1+added heads (2..n) + - less heads than before: -1-removed heads (-2..-n) + - number of heads stays the same: 1 + """ def csmap(x): self.ui.debug(_("add changeset %s\n") % short(x)) return cl.count() @@ -1836,7 +1841,11 @@ self.hook("incoming", node=hex(self.changelog.node(i)), source=srctype, url=url) - return newheads - oldheads + 1 + # never return 0 here: + if newheads < oldheads: + return newheads - oldheads - 1 + else: + return newheads - oldheads + 1 def stream_in(self, remote):