mercurial/localrepo.py
branchstable
changeset 10698 e930017f9e2a
parent 10547 bae9bb09166b
child 10699 7b0a0d498cc0
child 10725 00d46934ee35
equal deleted inserted replaced
10697:c90d923fff64 10698:e930017f9e2a
  1824             # back to lookup the owning changenode and collect information.
  1824             # back to lookup the owning changenode and collect information.
  1825             group = cl.group(msng_cl_lst, identity, collect)
  1825             group = cl.group(msng_cl_lst, identity, collect)
  1826             cnt = 0
  1826             cnt = 0
  1827             for chnk in group:
  1827             for chnk in group:
  1828                 yield chnk
  1828                 yield chnk
  1829                 self.ui.progress(_('bundle changes'), cnt, unit=_('chunks'))
  1829                 self.ui.progress(_('bundling changes'), cnt, unit=_('chunks'))
  1830                 cnt += 1
  1830                 cnt += 1
  1831             self.ui.progress(_('bundle changes'), None, unit=_('chunks'))
  1831             self.ui.progress(_('bundling changes'), None, unit=_('chunks'))
  1832 
  1832 
  1833 
  1833 
  1834             # Figure out which manifest nodes (of the ones we think might be
  1834             # Figure out which manifest nodes (of the ones we think might be
  1835             # part of the changegroup) the recipient must know about and
  1835             # part of the changegroup) the recipient must know about and
  1836             # remove them from the changegroup.
  1836             # remove them from the changegroup.
  1852             group = mnfst.group(msng_mnfst_lst, lookup_manifest_link,
  1852             group = mnfst.group(msng_mnfst_lst, lookup_manifest_link,
  1853                                 filenode_collector(changedfiles))
  1853                                 filenode_collector(changedfiles))
  1854             cnt = 0
  1854             cnt = 0
  1855             for chnk in group:
  1855             for chnk in group:
  1856                 yield chnk
  1856                 yield chnk
  1857                 self.ui.progress(_('bundle manifests'), cnt, unit=_('chunks'))
  1857                 self.ui.progress(_('bundling manifests'), cnt, unit=_('chunks'))
  1858                 cnt += 1
  1858                 cnt += 1
  1859             self.ui.progress(_('bundle manifests'), None, unit=_('chunks'))
  1859             self.ui.progress(_('bundling manifests'), None, unit=_('chunks'))
  1860 
  1860 
  1861             # These are no longer needed, dereference and toss the memory for
  1861             # These are no longer needed, dereference and toss the memory for
  1862             # them.
  1862             # them.
  1863             msng_mnfst_lst = None
  1863             msng_mnfst_lst = None
  1864             msng_mnfst_set.clear()
  1864             msng_mnfst_set.clear()
  1895                     # from filenodes.
  1895                     # from filenodes.
  1896                     group = filerevlog.group(msng_filenode_lst,
  1896                     group = filerevlog.group(msng_filenode_lst,
  1897                                              lookup_filenode_link_func(fname))
  1897                                              lookup_filenode_link_func(fname))
  1898                     for chnk in group:
  1898                     for chnk in group:
  1899                         self.ui.progress(
  1899                         self.ui.progress(
  1900                             _('bundle files'), cnt, item=fname, unit=_('chunks'))
  1900                             _('bundling files'), cnt, item=fname, unit=_('chunks'))
  1901                         cnt += 1
  1901                         cnt += 1
  1902                         yield chnk
  1902                         yield chnk
  1903                 if fname in msng_filenode_set:
  1903                 if fname in msng_filenode_set:
  1904                     # Don't need this anymore, toss it to free memory.
  1904                     # Don't need this anymore, toss it to free memory.
  1905                     del msng_filenode_set[fname]
  1905                     del msng_filenode_set[fname]
  1906             # Signal that no more groups are left.
  1906             # Signal that no more groups are left.
  1907             yield changegroup.closechunk()
  1907             yield changegroup.closechunk()
  1908             self.ui.progress(_('bundle files'), None, unit=_('chunks'))
  1908             self.ui.progress(_('bundling files'), None, unit=_('chunks'))
  1909 
  1909 
  1910             if msng_cl_lst:
  1910             if msng_cl_lst:
  1911                 self.hook('outgoing', node=hex(msng_cl_lst[0]), source=source)
  1911                 self.hook('outgoing', node=hex(msng_cl_lst[0]), source=source)
  1912 
  1912 
  1913         return util.chunkbuffer(gengroup())
  1913         return util.chunkbuffer(gengroup())
  1952             mmfs = {}
  1952             mmfs = {}
  1953             collect = changegroup.collector(cl, mmfs, changedfiles)
  1953             collect = changegroup.collector(cl, mmfs, changedfiles)
  1954 
  1954 
  1955             cnt = 0
  1955             cnt = 0
  1956             for chnk in cl.group(nodes, identity, collect):
  1956             for chnk in cl.group(nodes, identity, collect):
  1957                 self.ui.progress(_('bundle changes'), cnt, unit=_('chunks'))
  1957                 self.ui.progress(_('bundling changes'), cnt, unit=_('chunks'))
  1958                 cnt += 1
  1958                 cnt += 1
  1959                 yield chnk
  1959                 yield chnk
  1960             self.ui.progress(_('bundle changes'), None, unit=_('chunks'))
  1960             self.ui.progress(_('bundling changes'), None, unit=_('chunks'))
  1961 
  1961 
  1962             mnfst = self.manifest
  1962             mnfst = self.manifest
  1963             nodeiter = gennodelst(mnfst)
  1963             nodeiter = gennodelst(mnfst)
  1964             cnt = 0
  1964             cnt = 0
  1965             for chnk in mnfst.group(nodeiter, lookuprevlink_func(mnfst)):
  1965             for chnk in mnfst.group(nodeiter, lookuprevlink_func(mnfst)):
  1966                 self.ui.progress(_('bundle manifests'), cnt, unit=_('chunks'))
  1966                 self.ui.progress(_('bundling manifests'), cnt, unit=_('chunks'))
  1967                 cnt += 1
  1967                 cnt += 1
  1968                 yield chnk
  1968                 yield chnk
  1969             self.ui.progress(_('bundle manifests'), None, unit=_('chunks'))
  1969             self.ui.progress(_('bundling manifests'), None, unit=_('chunks'))
  1970 
  1970 
  1971             cnt = 0
  1971             cnt = 0
  1972             for fname in sorted(changedfiles):
  1972             for fname in sorted(changedfiles):
  1973                 filerevlog = self.file(fname)
  1973                 filerevlog = self.file(fname)
  1974                 if not len(filerevlog):
  1974                 if not len(filerevlog):
  1979                     yield changegroup.chunkheader(len(fname))
  1979                     yield changegroup.chunkheader(len(fname))
  1980                     yield fname
  1980                     yield fname
  1981                     lookup = lookuprevlink_func(filerevlog)
  1981                     lookup = lookuprevlink_func(filerevlog)
  1982                     for chnk in filerevlog.group(nodeiter, lookup):
  1982                     for chnk in filerevlog.group(nodeiter, lookup):
  1983                         self.ui.progress(
  1983                         self.ui.progress(
  1984                             _('bundle files'), cnt, item=fname, unit=_('chunks'))
  1984                             _('bundling files'), cnt, item=fname, unit=_('chunks'))
  1985                         cnt += 1
  1985                         cnt += 1
  1986                         yield chnk
  1986                         yield chnk
  1987             self.ui.progress(_('bundle files'), None, unit=_('chunks'))
  1987             self.ui.progress(_('bundling files'), None, unit=_('chunks'))
  1988 
  1988 
  1989             yield changegroup.closechunk()
  1989             yield changegroup.closechunk()
  1990 
  1990 
  1991             if nodes:
  1991             if nodes:
  1992                 self.hook('outgoing', node=hex(nodes[0]), source=source)
  1992                 self.hook('outgoing', node=hex(nodes[0]), source=source)