1688 |
1688 |
1689 # write changelog data to temp files so concurrent readers will not see |
1689 # write changelog data to temp files so concurrent readers will not see |
1690 # inconsistent view |
1690 # inconsistent view |
1691 cl = self.changelog |
1691 cl = self.changelog |
1692 cl.delayupdate() |
1692 cl.delayupdate() |
1693 oldheads = len(cl.heads()) |
1693 oldheads = cl.heads() |
1694 |
1694 |
1695 tr = self.transaction("\n".join([srctype, urlmod.hidepassword(url)])) |
1695 tr = self.transaction("\n".join([srctype, urlmod.hidepassword(url)])) |
1696 try: |
1696 try: |
1697 trp = weakref.proxy(tr) |
1697 trp = weakref.proxy(tr) |
1698 # pull off the changeset group |
1698 # pull off the changeset group |
1779 except error.LookupError: |
1779 except error.LookupError: |
1780 raise util.Abort( |
1780 raise util.Abort( |
1781 _('missing file data for %s:%s - run hg verify') % |
1781 _('missing file data for %s:%s - run hg verify') % |
1782 (f, hex(n))) |
1782 (f, hex(n))) |
1783 |
1783 |
1784 newheads = len(cl.heads()) |
1784 dh = 0 |
1785 heads = "" |
1785 if oldheads: |
1786 if oldheads and newheads != oldheads: |
1786 heads = cl.heads() |
1787 heads = _(" (%+d heads)") % (newheads - oldheads) |
1787 dh = len(heads) - len(oldheads) |
|
1788 for h in heads: |
|
1789 if h not in oldheads and 'close' in self[h].extra(): |
|
1790 dh -= 1 |
|
1791 htext = "" |
|
1792 if dh: |
|
1793 htext = _(" (%+d heads)") % dh |
1788 |
1794 |
1789 self.ui.status(_("added %d changesets" |
1795 self.ui.status(_("added %d changesets" |
1790 " with %d changes to %d files%s\n") |
1796 " with %d changes to %d files%s\n") |
1791 % (changesets, revisions, files, heads)) |
1797 % (changesets, revisions, files, htext)) |
1792 |
1798 |
1793 if changesets > 0: |
1799 if changesets > 0: |
1794 p = lambda: cl.writepending() and self.root or "" |
1800 p = lambda: cl.writepending() and self.root or "" |
1795 self.hook('pretxnchangegroup', throw=True, |
1801 self.hook('pretxnchangegroup', throw=True, |
1796 node=hex(cl.node(clstart)), source=srctype, |
1802 node=hex(cl.node(clstart)), source=srctype, |
1815 for i in xrange(clstart, clend): |
1821 for i in xrange(clstart, clend): |
1816 self.hook("incoming", node=hex(cl.node(i)), |
1822 self.hook("incoming", node=hex(cl.node(i)), |
1817 source=srctype, url=url) |
1823 source=srctype, url=url) |
1818 |
1824 |
1819 # never return 0 here: |
1825 # never return 0 here: |
1820 if newheads < oldheads: |
1826 if dh < 0: |
1821 return newheads - oldheads - 1 |
1827 return dh - 1 |
1822 else: |
1828 else: |
1823 return newheads - oldheads + 1 |
1829 return dh + 1 |
1824 |
|
1825 |
1830 |
1826 def stream_in(self, remote, requirements): |
1831 def stream_in(self, remote, requirements): |
1827 lock = self.lock() |
1832 lock = self.lock() |
1828 try: |
1833 try: |
1829 fp = remote.stream_out() |
1834 fp = remote.stream_out() |