mercurial/changegroup.py
changeset 25517 513c31d8652f
parent 25505 19717d3c8f94
child 25573 3e89e67f17e8
equal deleted inserted replaced
25516:1e37bd83dc66 25517:513c31d8652f
   693                     (f, hex(n)))
   693                     (f, hex(n)))
   694 
   694 
   695     return revisions, files
   695     return revisions, files
   696 
   696 
   697 def addchangegroup(repo, source, srctype, url, emptyok=False,
   697 def addchangegroup(repo, source, srctype, url, emptyok=False,
   698                    targetphase=phases.draft):
   698                    targetphase=phases.draft, expectedtotal=None):
   699     """Add the changegroup returned by source.read() to this repo.
   699     """Add the changegroup returned by source.read() to this repo.
   700     srctype is a string like 'push', 'pull', or 'unbundle'.  url is
   700     srctype is a string like 'push', 'pull', or 'unbundle'.  url is
   701     the URL of the repo where this changegroup is coming from.
   701     the URL of the repo where this changegroup is coming from.
   702 
   702 
   703     Return an integer summarizing the change to this repo:
   703     Return an integer summarizing the change to this repo:
   742         clstart = len(cl)
   742         clstart = len(cl)
   743         class prog(object):
   743         class prog(object):
   744             step = _('changesets')
   744             step = _('changesets')
   745             count = 1
   745             count = 1
   746             ui = repo.ui
   746             ui = repo.ui
   747             total = None
   747             total = expectedtotal
   748             def __call__(repo):
   748             def __call__(repo):
   749                 repo.ui.progress(repo.step, repo.count, unit=_('chunks'),
   749                 repo.ui.progress(repo.step, repo.count, unit=_('chunks'),
   750                                  total=repo.total)
   750                                  total=repo.total)
   751                 repo.count += 1
   751                 repo.count += 1
   752         pr = prog()
   752         pr = prog()