##// END OF EJS Templates
changegroup: progress for added files is not measured in "chunks"...
Martin von Zweigbergk -
r28361:277a22cd default
parent child Browse files
Show More
@@ -394,9 +394,8 b' class cg1unpacker(object):'
394
394
395 # process the files
395 # process the files
396 repo.ui.status(_("adding file changes\n"))
396 repo.ui.status(_("adding file changes\n"))
397 pr = prog(_('files'), efiles)
398 newrevs, newfiles = _addchangegroupfiles(
397 newrevs, newfiles = _addchangegroupfiles(
399 repo, self, revmap, trp, pr, needfiles)
398 repo, self, revmap, trp, efiles, needfiles)
400 revisions += newrevs
399 revisions += newrevs
401 files += newfiles
400 files += newfiles
402
401
@@ -1068,16 +1067,18 b' def changegroup(repo, basenodes, source)'
1068 # to avoid a race we use changegroupsubset() (issue1320)
1067 # to avoid a race we use changegroupsubset() (issue1320)
1069 return changegroupsubset(repo, basenodes, repo.heads(), source)
1068 return changegroupsubset(repo, basenodes, repo.heads(), source)
1070
1069
1071 def _addchangegroupfiles(repo, source, revmap, trp, pr, needfiles):
1070 def _addchangegroupfiles(repo, source, revmap, trp, expectedfiles, needfiles):
1072 revisions = 0
1071 revisions = 0
1073 files = 0
1072 files = 0
1074 while True:
1073 while True:
1075 chunkdata = source.filelogheader()
1074 chunkdata = source.filelogheader()
1076 if not chunkdata:
1075 if not chunkdata:
1077 break
1076 break
1077 files += 1
1078 f = chunkdata["filename"]
1078 f = chunkdata["filename"]
1079 repo.ui.debug("adding %s revisions\n" % f)
1079 repo.ui.debug("adding %s revisions\n" % f)
1080 pr()
1080 repo.ui.progress(_('files'), files, unit=_('files'),
1081 total=expectedfiles)
1081 fl = repo.file(f)
1082 fl = repo.file(f)
1082 o = len(fl)
1083 o = len(fl)
1083 try:
1084 try:
@@ -1086,7 +1087,6 b' def _addchangegroupfiles(repo, source, r'
1086 except error.CensoredBaseError as e:
1087 except error.CensoredBaseError as e:
1087 raise error.Abort(_("received delta base is censored: %s") % e)
1088 raise error.Abort(_("received delta base is censored: %s") % e)
1088 revisions += len(fl) - o
1089 revisions += len(fl) - o
1089 files += 1
1090 if f in needfiles:
1090 if f in needfiles:
1091 needs = needfiles[f]
1091 needs = needfiles[f]
1092 for new in xrange(o, len(fl)):
1092 for new in xrange(o, len(fl)):
General Comments 0
You need to be logged in to leave comments. Login now