mercurial/changegroup.py
changeset 27735 bd37212c20ed
parent 27734 5c0fd878779c
child 27739 d6d3cf5fda6f
equal deleted inserted replaced
27734:5c0fd878779c 27735:bd37212c20ed
   312         - more heads than before: 1+added heads (2..n)
   312         - more heads than before: 1+added heads (2..n)
   313         - fewer heads than before: -1-removed heads (-2..-n)
   313         - fewer heads than before: -1-removed heads (-2..-n)
   314         - number of heads stays the same: 1
   314         - number of heads stays the same: 1
   315         """
   315         """
   316         repo = repo.unfiltered()
   316         repo = repo.unfiltered()
   317         wasempty = (len(repo.changelog) == 0)
       
   318         def csmap(x):
   317         def csmap(x):
   319             repo.ui.debug("add changeset %s\n" % short(x))
   318             repo.ui.debug("add changeset %s\n" % short(x))
   320             return len(cl)
   319             return len(cl)
   321 
   320 
   322         def revmap(x):
   321         def revmap(x):
   387             # process the files
   386             # process the files
   388             repo.ui.status(_("adding file changes\n"))
   387             repo.ui.status(_("adding file changes\n"))
   389             self.callback = None
   388             self.callback = None
   390             pr = prog(_('files'), efiles)
   389             pr = prog(_('files'), efiles)
   391             newrevs, newfiles = _addchangegroupfiles(
   390             newrevs, newfiles = _addchangegroupfiles(
   392                 repo, self, revmap, trp, pr, needfiles, wasempty)
   391                 repo, self, revmap, trp, pr, needfiles)
   393             revisions += newrevs
   392             revisions += newrevs
   394             files += newfiles
   393             files += newfiles
   395 
   394 
   396             dh = 0
   395             dh = 0
   397             if oldheads:
   396             if oldheads:
  1031 
  1030 
  1032 def changegroup(repo, basenodes, source):
  1031 def changegroup(repo, basenodes, source):
  1033     # to avoid a race we use changegroupsubset() (issue1320)
  1032     # to avoid a race we use changegroupsubset() (issue1320)
  1034     return changegroupsubset(repo, basenodes, repo.heads(), source)
  1033     return changegroupsubset(repo, basenodes, repo.heads(), source)
  1035 
  1034 
  1036 def _addchangegroupfiles(repo, source, revmap, trp, pr, needfiles, wasempty):
  1035 def _addchangegroupfiles(repo, source, revmap, trp, pr, needfiles):
  1037     revisions = 0
  1036     revisions = 0
  1038     files = 0
  1037     files = 0
  1039     while True:
  1038     while True:
  1040         chunkdata = source.filelogheader()
  1039         chunkdata = source.filelogheader()
  1041         if not chunkdata:
  1040         if not chunkdata: