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.
|