Sending this now because follow-ups to patch2201 depend on it.
I think this was added to support "bare" repos (with no working dir), back
when dealing with pending was still fraught with bugs, a bad API, and no
1 patch for repository http://darcs.net/screened:
Author: Ben Franksen <firstname.lastname@example.org>
Date: Tue Feb 28 09:01:09 CET 2023
* remove UpdatePending parameter from revert/finalize
The complication added by this extra parameter is not justified, given that
- we have to remember to pass the same value for both calls,
- passing NoUpdatePending merely avoids one file copy and one rename, and
- was done only in a few places where to knew that pending is not touched.
Responding to your last remark: in the past it surely was more than just
an optimization, but nowadays pending follows the standard transaction
protocol: on start of a transaction it gets copied to pending.tentative,
we only ever modify pending.tentative, and on commit of transaction we
(atomically) rename it back to pending. This can be seen by looking at the
code, particularly the export list, of Darcs.Repository.Pending: the only
procedure that directly modifies pending is finalizePending. It follows
from this that not touching pending in revert/finalize merely saves one
copy and one rename.