Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG4e08bbfc6d51: remotefilelog: use progress helper in shallowbundle
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
( )
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | hgext/remotefilelog/shallowbundle.py (7 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
Martin von Zweigbergk | Dec 4 2018, 7:31 PM |
Status | Author | Revision | |
---|---|---|---|
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz |
return orig(repo, outgoing, version, source, *args, **kwargs) | return orig(repo, outgoing, version, source, *args, **kwargs) | ||||
finally: | finally: | ||||
repo.shallowmatch = original | repo.shallowmatch = original | ||||
def addchangegroupfiles(orig, repo, source, revmap, trp, expectedfiles, *args): | def addchangegroupfiles(orig, repo, source, revmap, trp, expectedfiles, *args): | ||||
if not shallowutil.isenabled(repo): | if not shallowutil.isenabled(repo): | ||||
return orig(repo, source, revmap, trp, expectedfiles, *args) | return orig(repo, source, revmap, trp, expectedfiles, *args) | ||||
files = 0 | |||||
newfiles = 0 | newfiles = 0 | ||||
visited = set() | visited = set() | ||||
revisiondatas = {} | revisiondatas = {} | ||||
queue = [] | queue = [] | ||||
# Normal Mercurial processes each file one at a time, adding all | # Normal Mercurial processes each file one at a time, adding all | ||||
# the new revisions for that file at once. In remotefilelog a file | # the new revisions for that file at once. In remotefilelog a file | ||||
# revision may depend on a different file's revision (in the case | # revision may depend on a different file's revision (in the case | ||||
# of a rename/copy), so we must lay all revisions down across all | # of a rename/copy), so we must lay all revisions down across all | ||||
# files in topological order. | # files in topological order. | ||||
# read all the file chunks but don't add them | # read all the file chunks but don't add them | ||||
progress = repo.ui.makeprogress(_('files'), total=expectedfiles) | |||||
while True: | while True: | ||||
chunkdata = source.filelogheader() | chunkdata = source.filelogheader() | ||||
if not chunkdata: | if not chunkdata: | ||||
break | break | ||||
files += 1 | |||||
f = chunkdata["filename"] | f = chunkdata["filename"] | ||||
repo.ui.debug("adding %s revisions\n" % f) | repo.ui.debug("adding %s revisions\n" % f) | ||||
repo.ui.progress(_('files'), files, total=expectedfiles) | progress.increment() | ||||
if not repo.shallowmatch(f): | if not repo.shallowmatch(f): | ||||
fl = repo.file(f) | fl = repo.file(f) | ||||
deltas = source.deltaiter() | deltas = source.deltaiter() | ||||
fl.addgroup(deltas, revmap, trp) | fl.addgroup(deltas, revmap, trp) | ||||
continue | continue | ||||
chain = None | chain = None | ||||
if p != nullid: | if p != nullid: | ||||
if not available(f, node, f, p): | if not available(f, node, f, p): | ||||
continue | continue | ||||
fl.add(text, meta, trp, linknode, p1, p2) | fl.add(text, meta, trp, linknode, p1, p2) | ||||
processed.add((f, node)) | processed.add((f, node)) | ||||
skipcount = 0 | skipcount = 0 | ||||
repo.ui.progress(_('files'), None) | progress.complete() | ||||
return len(revisiondatas), newfiles | return len(revisiondatas), newfiles |