darcs

Patch 2144 refactor testing and running hooks

Title refactor testing and running hooks
Superseder Nosy List bfrk
Related Issues
Status accepted Assigned To
Milestone

Created on 2020-12-21.21:02:18 by bfrk, last changed 2021-03-27.23:55:56 by ganesh.

Files
File name Status Uploaded Type Edit Remove
bugfix_-__leave_test_dir-should-be-off-by-default.dpatch bfrk, 2020-12-21.21:02:18 application/x-darcs-patch
patch-preview.txt bfrk, 2020-12-21.21:02:18 text/x-darcs-patch
unnamed bfrk, 2020-12-21.21:02:18 text/plain
See mailing list archives for discussion on individual patches.
Messages
msg22589 (view) Author: bfrk Date: 2020-12-21.21:02:18
A common theme here is to move stuff that has nothing to do with Repository
mechanics, namely running hooks and tests, from the Repository to the UI
layer, especially since running hooks may involve prompting the user.

Another theme is to make the Repository and UI layers more functional and
less imperative, in this case by passing around a tree (the tentative
pristine) instead of a Repository.

8 patches for repository http://darcs.net/screened:

patch 954ba7d6aa1937d26ce534a83fd282d33e521461
Author: Ben Franksen <ben.franksen@online.de>
Date:   Thu Nov  5 13:50:44 CET 2020
  * bugfix: --leave-test-dir should be off by default

patch 9edd5f9f4d76bcc0c842ee721e64bf9111310876
Author: Ben Franksen <ben.franksen@online.de>
Date:   Thu Nov  5 14:08:45 CET 2020
  * support --leave-test-dir for all commands that support --test

patch 0cec9e038927db01b8ee2017ce6675c0defd874e
Author: Ben Franksen <ben.franksen@online.de>
Date:   Thu Nov  5 12:19:40 CET 2020
  * refactor testing of the tentative pristine

patch f4b961d97abf40d31f2c05ee35481eea5602e084
Author: Ben Franksen <ben.franksen@online.de>
Date:   Mon Dec 21 21:14:03 CET 2020
  * inline runTest into getTest and move to UI layer

patch fdf066a51e4bd051d43b6ed5498c5948477572eb
Author: Ben Franksen <ben.franksen@online.de>
Date:   Mon Dec 21 21:35:10 CET 2020
  * move remainder of D.R.Test to D.UI.RunHook

patch f27d28dc46a1fa8edcbaf6d73216cc9f50d5db63
Author: Ben Franksen <ben.franksen@online.de>
Date:   Mon Dec 21 21:37:24 CET 2020
  * reduce code duplication in Darcs.UI.RunHook

patch fc1d0a894334881117fb3553a9cb2afcba731b13
Author: Ben Franksen <ben.franksen@online.de>
Date:   Mon Dec 21 21:45:52 CET 2020
  * move Hook(s)Config from D.R.Flags to D.UI.Options.All

patch 52d8f1b62fecac9f93fcdfc4031d356f7b0d44c7
Author: Ben Franksen <ben.franksen@online.de>
Date:   Mon Dec 21 21:54:55 CET 2020
  * use promptYorn when asking whether to execute hook
Attachments
msg22680 (view) Author: ganesh Date: 2021-03-27.21:43:22
> A common theme here is to move stuff that has nothing to do with Repository
> mechanics, namely running hooks and tests, from the Repository to the UI
> layer, especially since running hooks may involve prompting the user.

I see why it doesn't belong in the Repository layer, but the UI layer
also feels a bit wrong. Maybe this class of things does justify a new
layer? One idea off the top of my head would be "Action", so
functionality like hooks and tests could live in Darcs.Action.Hook and
Darcs.Action.Test respectively.

>   * bugfix: --leave-test-dir should be off by default
>   * support --leave-test-dir for all commands that support --test

OK

>   * refactor testing of the tentative pristine

OK

>   * inline runTest into getTest and move to UI layer

OK

>   * move remainder of D.R.Test to D.UI.RunHook

OK

>   * reduce code duplication in Darcs.UI.RunHook

OK

>   * move Hook(s)Config from D.R.Flags to D.UI.Options.All

OK

>   * use promptYorn when asking whether to execute hook

OK
History
Date User Action Args
2020-12-21 21:02:18bfrkcreate
2020-12-21 22:18:05bfrksetstatus: needs-screening -> needs-review
2021-03-27 21:43:24ganeshsetmessages: + msg22680
2021-03-27 21:43:44ganeshsetstatus: needs-review -> accepted-pending-tests
2021-03-27 23:55:56ganeshsetstatus: accepted-pending-tests -> accepted