darcs

Patch 1603 lots of cleanups and fixes in (or affecting) Darcs.Repository.State

Title lots of cleanups and fixes in (or affecting) Darcs.Repository.State
Superseder Nosy List bf
Related Issues
Status accepted Assigned To
Milestone

Created on 2017-09-23.20:07:13 by bf, last changed 2017-10-10.17:04:46 by gh.

Files
File name Status Uploaded Type Edit Remove
add-applystate-_primof-p_-_-applystate-p-to-repopatch-constraints.dpatch bf, 2017-09-23.20:07:13 application/x-darcs-patch
use-restrictdarcsdir-in-d_r_state_readworking.dpatch bf, 2017-10-10.10:02:19 application/x-darcs-patch
See mailing list archives for discussion on individual patches.
Messages
msg19667 (view) Author: bf Date: 2017-09-23.20:07:13
This was a necessary step before I could even start to make any farther
reaching changes to the Darcs.Repository API. I fixed a number of bugs
along the way, mostly to do with --look-for-moves and
--look-for-replaces, which are now more cleanly integrated. The number
of patches in this bundle is large but I tried hard to keep each change
small and reviewable.

If one looks a bit closer, the beginnings of a better API can be
spotted. I refactored (mostly internally in D.R.State, for now) things
so that when we read a piece of state, we don't throw it away. Instead
we pass it (or a modified version) on to the caller, who is free to
discard the unneeded parts, but more often than not can directly use it
in stead of re-computing it. I'll write more about that in another message.

I am not yet screening this because about half the patches conflict with
Patch1593 (separating display and storage of patches), and I would like
to rebase them if (and when) Patch1593 gets screened.
Attachments
msg19715 (view) Author: bf Date: 2017-10-10.10:02:19
This is a rebased version. Unfortunately it has even more patches than
the previous bundle. Sorry for that. I tried to split it into smaller
pieces but the result failed to make any sense to me.
Attachments
msg19727 (view) Author: gh Date: 2017-10-10.17:04:45
TL;DR: Accepted, all tests pass, thanks for splitting changes into small
patches.


  * use restrictDarcsdir in D.R.State.readWorking
  * fixed erroneous/misleading docs in D.R.State
  * small simplification in filteredWorking
  * better documentation for restrictBoring
  * removed unneeded forall in type signatures in D.R.State
  * yet another layout fix, for D.R.State.readPending

OK


  * pull all the lookForMoves/Replaces ugliness into D.R.State

Nice improvement of the repository API.
This simplifies the code of the individual commands
that inspect the unrecorded state.


  * layout changes, mostly to break overlong lines
  * document how readPendingAndWorking handles LookForMoves and
LookForReplaces
  * slightly refactored index code in D.R.State
  * further improved docs for unrecordedChanges

OK


  * pull calls to GetMoves and GetReplaces into readPendingAndWorking

Yes!

  * layout cleanup and some renamings in D.R.State

OK

  * avoid repeated reading of the pending tree in D.R.State.getReplaces

Good.

  * maybeRestrictSubpaths gets the pending patch as parameter
  
OK (Probably the comment "- we have no need for the pending patch"
should go away)
(PD: the next patch removes it :-) )

  * fix: consider --look-for-moves in readUnrecordedFiltered and
filterExistingPaths

Seems correct.

  * avoid use of pattern type signatures in readPendingAndWorking
  * layout: decreased indentation of where-block of D.R.State.getReplaces

OK


  * fix getReplaces, refactoring call sites along the way
  
*Seems* correct to me.

  * fix: use argument file paths to restrict detected moves
  * added a test for --look-for-moves and --look-for-replaces and with files
  * removed tests/failing-look_for_replaces2.sh
  * cleanup arguments to filteredWorking
  * fixed tests/failing-look_for_replaces1.sh so that it fails for the
stated reason

OK


  * added test for --look-for-moves with (file path) arguments

This is to test patch "fix: use argument file paths to restrict detected
moves". Good.
History
Date User Action Args
2017-09-23 20:07:13bfcreate
2017-10-10 10:02:19bfsetfiles: + use-restrictdarcsdir-in-d_r_state_readworking.dpatch
messages: + msg19715
2017-10-10 17:04:46ghsetstatus: needs-screening -> accepted
messages: + msg19727