This ensures responsiveness when the configured tools are slow or numerous.
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
This ensures responsiveness when the configured tools are slow or numerous.
| Lint Skipped |
| Unit Tests Skipped |
| # until all its parents are committed. We ensure this by committing and | # until all its parents are committed. We ensure this by committing and | ||||
| # freeing memory for the revisions in some topological order. This | # freeing memory for the revisions in some topological order. This | ||||
| # leaves a little bit of memory efficiency on the table, but also makes | # leaves a little bit of memory efficiency on the table, but also makes | ||||
| # the tests deterministic. It might also be considered a feature since | # the tests deterministic. It might also be considered a feature since | ||||
| # it makes the results more easily reproducible. | # it makes the results more easily reproducible. | ||||
| filedata = collections.defaultdict(dict) | filedata = collections.defaultdict(dict) | ||||
| replacements = {} | replacements = {} | ||||
| commitorder = sorted(revstofix, reverse=True) | commitorder = sorted(revstofix, reverse=True) | ||||
| with ui.makeprogress(topic=_('fixing'), unit=_('files'), | |||||
| total=sum(numitems.values())) as progress: | |||||
| for rev, path, newdata in results: | for rev, path, newdata in results: | ||||
| progress.increment(item=path) | |||||
| if newdata is not None: | if newdata is not None: | ||||
| filedata[rev][path] = newdata | filedata[rev][path] = newdata | ||||
| numitems[rev] -= 1 | numitems[rev] -= 1 | ||||
| # Apply the fixes for this and any other revisions that are ready | # Apply the fixes for this and any other revisions that are ready | ||||
| # and sitting at the front of the queue. Using a loop here prevents | # and sitting at the front of the queue. Using a loop here prevents | ||||
| # the queue from being blocked by the first revision to be ready out | # the queue from being blocked by the first revision to be ready out | ||||
| # of order. | # of order. | ||||
| while commitorder and not numitems[commitorder[-1]]: | while commitorder and not numitems[commitorder[-1]]: | ||||
| rev = commitorder.pop() | rev = commitorder.pop() | ||||
| ctx = repo[rev] | ctx = repo[rev] | ||||
| if rev == wdirrev: | if rev == wdirrev: | ||||
| writeworkingdir(repo, ctx, filedata[rev], replacements) | writeworkingdir(repo, ctx, filedata[rev], replacements) | ||||
| else: | else: | ||||
| replacerev(ui, repo, ctx, filedata[rev], replacements) | replacerev(ui, repo, ctx, filedata[rev], replacements) | ||||
| del filedata[rev] | del filedata[rev] | ||||
| replacements = {prec: [succ] for prec, succ in replacements.iteritems()} | replacements = {prec: [succ] for prec, succ in replacements.iteritems()} | ||||
| scmutil.cleanupnodes(repo, replacements, 'fix', fixphase=True) | scmutil.cleanupnodes(repo, replacements, 'fix', fixphase=True) | ||||
| def getworkqueue(ui, repo, pats, opts, revstofix, basectxs): | def getworkqueue(ui, repo, pats, opts, revstofix, basectxs): | ||||
| """"Constructs the list of files to be fixed at specific revisions | """"Constructs the list of files to be fixed at specific revisions | ||||
| It is up to the caller how to consume the work items, and the only | It is up to the caller how to consume the work items, and the only | ||||