Mercurial > hg
comparison mercurial/localrepo.py @ 8392:7e5cbb09515b
localrepo: use cl throughout in addchangegroup
author | Peter Arrenbrecht <peter.arrenbrecht@gmail.com> |
---|---|
date | Thu, 14 May 2009 16:09:27 +0200 |
parents | beae42f3d93b |
children | 59160ca338f7 |
comparison
equal
deleted
inserted
replaced
8391:27bffd81d265 | 8392:7e5cbb09515b |
---|---|
2049 if fl.addgroup(chunkiter, revmap, trp) is None: | 2049 if fl.addgroup(chunkiter, revmap, trp) is None: |
2050 raise util.Abort(_("received file revlog group is empty")) | 2050 raise util.Abort(_("received file revlog group is empty")) |
2051 revisions += len(fl) - o | 2051 revisions += len(fl) - o |
2052 files += 1 | 2052 files += 1 |
2053 | 2053 |
2054 newheads = len(self.changelog.heads()) | 2054 newheads = len(cl.heads()) |
2055 heads = "" | 2055 heads = "" |
2056 if oldheads and newheads != oldheads: | 2056 if oldheads and newheads != oldheads: |
2057 heads = _(" (%+d heads)") % (newheads - oldheads) | 2057 heads = _(" (%+d heads)") % (newheads - oldheads) |
2058 | 2058 |
2059 self.ui.status(_("added %d changesets" | 2059 self.ui.status(_("added %d changesets" |
2060 " with %d changes to %d files%s\n") | 2060 " with %d changes to %d files%s\n") |
2061 % (changesets, revisions, files, heads)) | 2061 % (changesets, revisions, files, heads)) |
2062 | 2062 |
2063 if changesets > 0: | 2063 if changesets > 0: |
2064 p = lambda: self.changelog.writepending() and self.root or "" | 2064 p = lambda: cl.writepending() and self.root or "" |
2065 self.hook('pretxnchangegroup', throw=True, | 2065 self.hook('pretxnchangegroup', throw=True, |
2066 node=hex(self.changelog.node(cor+1)), source=srctype, | 2066 node=hex(cl.node(cor+1)), source=srctype, |
2067 url=url, pending=p) | 2067 url=url, pending=p) |
2068 | 2068 |
2069 # make changelog see real files again | 2069 # make changelog see real files again |
2070 cl.finalize(trp) | 2070 cl.finalize(trp) |
2071 | 2071 |
2075 | 2075 |
2076 if changesets > 0: | 2076 if changesets > 0: |
2077 # forcefully update the on-disk branch cache | 2077 # forcefully update the on-disk branch cache |
2078 self.ui.debug(_("updating the branch cache\n")) | 2078 self.ui.debug(_("updating the branch cache\n")) |
2079 self.branchtags() | 2079 self.branchtags() |
2080 self.hook("changegroup", node=hex(self.changelog.node(cor+1)), | 2080 self.hook("changegroup", node=hex(cl.node(cor+1)), |
2081 source=srctype, url=url) | 2081 source=srctype, url=url) |
2082 | 2082 |
2083 for i in xrange(cor + 1, cnr + 1): | 2083 for i in xrange(cor + 1, cnr + 1): |
2084 self.hook("incoming", node=hex(self.changelog.node(i)), | 2084 self.hook("incoming", node=hex(cl.node(i)), |
2085 source=srctype, url=url) | 2085 source=srctype, url=url) |
2086 | 2086 |
2087 # never return 0 here: | 2087 # never return 0 here: |
2088 if newheads < oldheads: | 2088 if newheads < oldheads: |
2089 return newheads - oldheads - 1 | 2089 return newheads - oldheads - 1 |