darcs

Patch 2289 remove UpdatePending parameter from revert/finalize

Title remove UpdatePending parameter from revert/finalize
Superseder Nosy List bfrk
Related Issues
Status accepted Assigned To
Milestone

Created on 2023-03-22.15:00:59 by bfrk, last changed 2023-07-15.00:30:21 by ganesh.

Files
File name Status Uploaded Type Edit Remove
patch-preview.txt bfrk, 2023-03-22.15:00:56 text/x-darcs-patch
remove-updatepending-parameter-from-revert_finalize.dpatch bfrk, 2023-03-22.15:00:56 application/x-darcs-patch
See mailing list archives for discussion on individual patches.
Messages
msg23159 (view) Author: bfrk Date: 2023-03-22.15:00:56
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
transactional processing.

1 patch for repository http://darcs.net/screened:

patch 15f5e2ff9d9788f77c421036f7446f9d750e3a72
Author: Ben Franksen <ben.franksen@online.de>
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.
Attachments
msg23570 (view) Author: ganesh Date: 2023-07-13.21:58:12
Looks fine.

(I'm not familiar enough with the semantics of repos to independently 
verify that NoUpdatePending was just an optimisation, but we also
have the test suite.)
msg23574 (view) Author: bfrk Date: 2023-07-14.12:41:38
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.
History
Date User Action Args
2023-03-22 15:00:59bfrkcreate
2023-03-22 15:02:18bfrksetstatus: needs-screening -> needs-review
2023-07-13 21:58:13ganeshsetstatus: needs-review -> accepted-pending-tests
messages: + msg23570
2023-07-14 12:41:40bfrksetmessages: + msg23574
2023-07-15 00:30:21ganeshsetstatus: accepted-pending-tests -> accepted