localrepo: simplify file bundling code and fix progress bug
Progress for files was off by one, and the code was rather hackish.
localrepo: use list comprehension instead of generators
The lists in question are iterated and kept in memory further down the code
path anyway, and this simplifies things.
workingctx: eliminate remove function
Inlining it into it's last remaining call place in cmdutil.copy.
Note that cmdutil.copy is called with the wlock already held, so no additional
locking is needed to call util.unlinkpath.
We do not need to wrap the util.unlinkpath call into a try block, because
at that point we already know whether abssrc exists or not -- thanks to the
preceding util.copyfile call. Adding a new local 'srcexists' in cmdutil.copy
for that purpose.
color: check if ui is already a subclass of colorui before wrapping it
since it's possible to reuse the ui object (see
80c599eee3f3)
between dispatch calls, the ui might have been wrapped already.
we could probably move this test up a bit but leaving it here
allows updates to take effect by extstyles() and configstyles().
web: prevent TypeError thrown when using the diffstat templates
Remove the lambda used to wrap webutil.diffstat because:
- functions passed to the templater must accept keyword arguments
- webutil.diffstat is a generator, so already calculates the diffstat lazily
This reverts the changes made to
1d3e2349304a after it was submitted to the
mailing list but before it was queued.
dispatch: add repo to the request
allows callers of dispatch.dispatch to pass in
an initialized repo object to be used.
-R/--repository overrides the request repo.