New submission from Ben Franksen <[email protected]>:

These have accumulated over time on my unstable development branch and
should all be uncontroversial and easy to review.

32 patches for repository https://darcs.net/screened:

patch 998c313e5e852953703b9ef69e306c8bec58af00
Author: Ben Franksen <[email protected]>
Date:   Sat Feb 25 08:25:45 CET 2023
  * add doc comment to explain lazy reading of inventories

patch d5a69fa6d6d57e7573e2de8e11e337c194bec6dc
Author: Ben Franksen <[email protected]>
Date:   Mon Apr  3 01:16:56 CEST 2023
  * partly fix a TODO in copySSH

patch 643a475b5abe188165d62652248a5e16a3f78a14
Author: Ben Franksen <[email protected]>
Date:   Mon Apr  3 01:20:12 CEST 2023
  * add a TODO and a verbose message to cloneRepository

patch d99d2c5d6c3ced9e238cf456c563e3228692f861
Author: Ben Franksen <[email protected]>
Date:   Sat Apr 15 15:41:13 CEST 2023
  * add a missing failure case to Darcs.Util.Tree.Monad.rename

  Renaming x to y should fail if x is a parent directory of y.

patch 3c629b7326843d59af164a611419215a7fc404b5
Author: Ben Franksen <[email protected]>
Date:   Sun Apr 23 18:38:35 CEST 2023
  * check that Name does not contain any of the native path separators

patch 53271e8ac5d2e36cc955777c658c914d4fcaccac
Author: Ben Franksen <[email protected]>
Date:   Thu Apr 27 01:43:07 CEST 2023
  * harness: strengthen a test for RepoPatchV3

patch 59cb4c4aac70b2543ac9e1dc6a992ce5fc6ca994
Author: Ben Franksen <[email protected]>
Date:   Fri May 12 10:13:23 CEST 2023
  * cleanup unused definitions in Darcs.Repository.Paths

patch 03be91bce63fb5473f3f300b7d431bc04ecca8f7
Author: Ben Franksen <[email protected]>
Date:   Tue May 16 12:59:09 CEST 2023
  * add noPrereq and type synonym CommandPrereq

  This is a pure refactor to make it easier to change the type of the
  commandPrereq member of DarcsCommand.

patch c983b439d1c40f519c1701c44cdb5451827c513e
Author: Ben Franksen <[email protected]>
Date:   Sun Jul  3 12:42:28 CEST 2022
  * remove redundant ApplyState p ~ Tree constraints

patch 0839be6ef7b20a9c6ce30f56f8230c422e0bdf2e
Author: Ben Franksen <[email protected]>
Date:   Sun Aug  7 14:00:29 CEST 2022
  * Darcs.Util.Printer: remove unneeded exports

patch bf1bc76203987af22b2795219ffcd92e518ffd87
Author: Ben Franksen <[email protected]>
Date:   Sat Nov 26 19:55:07 CET 2022
  * remove unused appendBinFile and appendTextFile

patch 2fbb4013c12c040cb3607126365316be314e1882
Author: Ben Franksen <[email protected]>
Date:   Thu Jan  9 15:22:20 CET 2025
  * add --hidesuccesses to test-options in release script

patch 4598103a851c4c7f056d5af9cc1d05c13ce42d51
Author: Ben Franksen <[email protected]>
Date:   Thu Jan  9 17:00:11 CET 2025
  * ci: ghc 9.8.2 -> 9.8.4

patch ad94ef54542dd5e9d60dcee27a6a6472ef0a2de6
Author: Ben Franksen <[email protected]>
Date:   Sat Dec 17 10:29:27 CET 2022
  * D.R.Inventory.Format: rename keywords from xxxName to kwXxx

patch 799f09d69c649f022327e3b5c11ab111fddfa8a9
Author: Ben Franksen <[email protected]>
Date:   Sun Jun 19 23:50:37 CEST 2022
  * explain use of nominal equality for ingredients of V3 patches

patch 8cf09b81bc42d1ed91e687821388e1a24ef8c0ff
Author: Ben Franksen <[email protected]>
Date:   Sun Apr  2 16:37:15 CEST 2023
  * Darcs.Util.Ssh: import and use Data.Map qualified

patch 1d1d6010f13226149ecf79a8412195430cc2996a
Author: Ben Franksen <[email protected]>
Date:   Sat May  6 19:38:14 CEST 2023
  * harness: remove Darcs.Test.Patch.Properties.V1Set1.tShowRead

  (Prop1.tShowRead unsafeCompare) is the same as PropG.showRead

patch 6df4087c2bc58d68e6131ecbdad9a1dd5b0bd478
Author: Ben Franksen <[email protected]>
Date:   Fri May 12 11:33:25 CEST 2023
  * avoid unneeded import of AnchoredPath data constructor

patch 8d242e55c47039aed50b6ad94bc810ef12122cfc
Author: Ben Franksen <[email protected]>
Date:   Sat Dec  3 12:33:36 CET 2022
  * optimize upgrade: refactor using D.R.Pristine.writePristine

  This is a slightly more high-level function.

patch 430478c8e515e91b958d35d26ec89df424b93742
Author: Ben Franksen <[email protected]>
Date:   Mon Jul  3 23:15:38 CEST 2023
  * pull: improve haddock for readRepos

patch 73355309738e76d6187a735da9bd7ed44cf7bf59
Author: Ben Franksen <[email protected]>
Date:   Mon Mar  6 00:00:25 CET 2023
  * remove obsolete dependency on network package

patch 32c54b34bc3feed0d8f8473aee7018c99810e0dc
Author: Ben Franksen <[email protected]>
Date:   Tue May 28 10:38:08 CEST 2024
  * clean up import lists in D.T.Patch.Properties.Mergeable

patch b2f5c032fb985c2c4bdb07ec872d6d9d8fa3f35f
Author: Ben Franksen <[email protected]>
Date:   Tue May 28 22:45:24 CEST 2024
  * harness: fix order of witnesses in picture explaining Merged

patch 879aa9e041cb33af00390c1ced3dc5aaca5f8a43
Author: Ben Franksen <[email protected]>
Date:   Sun Jun  2 20:57:23 CEST 2024
  * harness: improve docs for some generic patch properties

patch aed941dd553521ed8f7dfa90b10416ae76cb2087
Author: Ben Franksen <[email protected]>
Date:   Sun Jun  2 20:59:49 CEST 2024
  * harness: add empty line between functions in D.T.T.P.V1Set2

patch d3594b00244a7ed47c14ee943819237e1ebee720
Author: Ben Franksen <[email protected]>
Date:   Sat Dec 17 11:09:12 CET 2022
  * move unwrapOneTagged from D.P.Depends to D.P.Set

patch b5e6a77413d4973dc78121d89706b57227bd8403
Author: Ben Franksen <[email protected]>
Date:   Tue Jul  2 07:48:09 CEST 2024
  * document Darcs.Util.Parser.takeTillChar

  It doesn't quite behave as one might expect from the name.

patch a9e198e54a98f59b0328cb0f3b32322c657891e8
Author: Ben Franksen <[email protected]>
Date:   Tue Jul  2 12:37:25 CEST 2024
  * harness: set DARCS_ESCAPE_8BIT in main

  This is so that when we show failing test cases we cannot run into encoding
  errors. Note that shell tests are not affected by this since they are run
  with DARCS_DONT_ESCAPE_ANYTHING which takes precedence.

patch e5f9f9785a8ab10ccacf66b7e7bf23be98cd73aa
Author: Ben Franksen <[email protected]>
Date:   Sat Jul 13 08:19:12 CEST 2024
  * expand tabs in tests/issue1987.sh

patch e8fdacc2f30fc66d33f04ca391a57a09323eb089
Author: Ben Franksen <[email protected]>
Date:   Sun Jul 14 09:06:59 CEST 2024
  * inline Darcs.Util.Tree.Monad.replaceItem

  This internal procedure is called in just one place.

patch abc91c655f2cc866831ec0e800cd31131727af4b
Author: Ben Franksen <[email protected]>
Date:   Wed Jul  6 14:37:49 CEST 2022
  * remove Darcs.Util.Printer.prefixLines

  The few use cases are easily replaced with the less problematic 'prefix'.

patch e3e8556e1fa4fa2542f6a07e9359fd69e8227db2
Author: Ben Franksen <[email protected]>
Date:   Wed Jan  8 12:11:22 CET 2025
  * packs: replace Data.ByteString.Lazy.Char8 with Data.ByteString.Lazy

----------
files: add-doc-comment-to-explain-lazy-reading-of-inventories.dpatch, 
patch-preview.txt
messages: 24165
nosy: bfrk
status: needs-screening
title: assorted unrelated trivial cleanups

__________________________________
Darcs bug tracker <[email protected]>
<https://bugs.darcs.net/patch2453>
__________________________________
[add doc comment to explain lazy reading of inventories
Ben Franksen <[email protected]>**20230225072545
 Ignore-this: 8830d293e27d4325d28c05f24b7ed1542e9e14aabaf2e0598b005e626fa7aa5bbd449485ce890877
] hunk ./src/Darcs/Repository/Inventory.hs 67
+-- Note that we read inventories and patches lazily, explicitly using
+-- 'unsafeInterleaveIO' to delay IO actions until the value is demanded. This
+-- is justified by the fact that inventories and patches are stored in hashed
+-- format, which implies that the files we read are never mutated.

[partly fix a TODO in copySSH
Ben Franksen <[email protected]>**20230402231656
 Ignore-this: 8c451239d60fd4323548eea69f1c73ae5076781bee4a63f390292713d4403101263abbd7451f1e88
] hunk ./src/Darcs/Util/Ssh.hs 258
-  -- TODO why do we disable progress reporting here?
-  withoutProgress $ do
-    mc <- getSshConnection rdarcs src
-    case mc of
-      Just v -> withMVar v (grabSSH src >=> B.writeFile dest)
-      Nothing -> do
+  mc <- getSshConnection rdarcs src
+  case mc of
+    Just v -> withMVar v (grabSSH src >=> B.writeFile dest)
+    Nothing ->
+      -- disable progress reporting because child inherits stdout
+      -- TODO check if we can avoid that
+      withoutProgress $ do

[add a TODO and a verbose message to cloneRepository
Ben Franksen <[email protected]>**20230402232012
 Ignore-this: cb7332f75801c0bd9937680619c376892002ed3ea83955252aabbad80077f0b9cbc93088ad89def9
] hunk ./src/Darcs/Repository/Clone.hs 255
-      -- check for unresolved conflicts
+      -- TODO Checking for unresolved conflicts means we have to download
+      -- at least all the patches referenced by hashed_inventory, even if
+      -- --lazy is in effect. This can take a long time, and in extreme
+      -- cases can even result in --lazy being slower than --complete.
+      putVerbose v $ text "Checking for unresolved conflicts..."

[add a missing failure case to Darcs.Util.Tree.Monad.rename
Ben Franksen <[email protected]>**20230415134113
 Ignore-this: 857d5d36d46b83e83039176c8b04e1e2deb885195de98ec425ed1e2b91399548e7cc537c726df03a
 
 Renaming x to y should fail if x is a parent directory of y.
] hunk ./src/Darcs/Util/Tree/Monad.hs 42
-import Darcs.Util.Path ( AnchoredPath, anchoredRoot, displayPath, movedirfilename )
+import Darcs.Util.Path
+    ( AnchoredPath
+    , anchoredRoot
+    , displayPath
+    , isPrefix
+    , movedirfilename
+    )
hunk ./src/Darcs/Util/Tree/Monad.hs 278
+  when (isPrefix from to) $
+    throwM $
+      mkIOError InvalidArgument "rename" Nothing (Just (displayPath to))

[check that Name does not contain any of the native path separators
Ben Franksen <[email protected]>**20230423163835
 Ignore-this: f5800ed23492bc45e590dd48565fab0c41412562322d0b0b6f3d7f7ab2df57c031aaee7da9438b8b
] hunk ./src/Darcs/Util/Path.hs 494
-hasPathSeparator = BC.elem '/'
+hasPathSeparator x = any (`BC.elem` x) NativeFilePath.pathSeparators

[harness: strengthen a test for RepoPatchV3
Ben Franksen <[email protected]>**20230426234307
 Ignore-this: 181f8638ba54dfd04f5e6436cbe49deb02bf2e230e435312499c1b4a3a2d8d9029c93b229523ddc1
] hunk ./harness/Darcs/Test/Patch/Properties/RepoPatchV3.hs 98
-  | not (revertedIds p `S.isSubsetOf` rids)
+  | not (revertedIds p `S.isSubsetOf` xids)
hunk ./harness/Darcs/Test/Patch/Properties/RepoPatchV3.hs 100
-      $ text "undone patches not found in repo:"
+      $ text "undone patches not a subset of conflicting patches:"

[cleanup unused definitions in Darcs.Repository.Paths
Ben Franksen <[email protected]>**20230512081323
 Ignore-this: be0d2900f12b9c9bb2f0f548e146791e3644f78ac3ea353e8d98cb4fdf82d3fdd14c320760b6a4e5
] hunk ./src/Darcs/Repository/Paths.hs 17
-prefsDir = "prefs"
-prefsDirPath = makeDarcsdirPath prefsDir
+prefsDirPath = makeDarcsdirPath "prefs"
hunk ./src/Darcs/Repository/Paths.hs 20
-hashedInventory = "hashed_inventory"
-hashedInventoryPath = makeDarcsdirPath hashedInventory
+hashedInventoryPath = makeDarcsdirPath "hashed_inventory"
hunk ./src/Darcs/Repository/Paths.hs 23
-tentativeHashedInventory = "tentative_hashed_inventory"
-tentativeHashedInventoryPath = makeDarcsdirPath tentativeHashedInventory
+tentativeHashedInventoryPath = makeDarcsdirPath "tentative_hashed_inventory"
hunk ./src/Darcs/Repository/Paths.hs 29
+-- | Location of the (one and only) tentative pristine root
+tentativePristinePath = makeDarcsdirPath "tentative_pristine"
+
hunk ./src/Darcs/Repository/Paths.hs 33
-tentativePristinePath = makeDarcsdirPath "tentative_pristine"
hunk ./src/Darcs/Repository/Paths.hs 54
-newPendingPath = patchesDirPath </> "pending.new"

[add noPrereq and type synonym CommandPrereq
Ben Franksen <[email protected]>**20230516105909
 Ignore-this: 3bb958c95197140d6eca158c0efa290367e556ef45261101ddb6751a734ad8f36276a43b6a5a83cc
 
 This is a pure refactor to make it easier to change the type of the
 commandPrereq member of DarcsCommand.
] hunk ./src/Darcs/UI/Commands/Clone.hs 35
-import Darcs.UI.Commands ( DarcsCommand(..), withStdOpts
-                      , nodefaults
-                      , commandStub
-                      , commandAlias
-                      , putInfo
-                      , putFinished
-                      )
+import Darcs.UI.Commands
+    ( DarcsCommand(..)
+    , commandAlias
+    , commandStub
+    , noPrereq
+    , nodefaults
+    , putFinished
+    , putInfo
+    , withStdOpts
+    )
hunk ./src/Darcs/UI/Commands/Clone.hs 139
-    , commandPrereq = \_ -> return $ Right ()
+    , commandPrereq = noPrereq
hunk ./src/Darcs/UI/Commands/Convert/Darcs2.hs 78
-import Darcs.UI.Commands ( DarcsCommand(..), nodefaults, putFinished, withStdOpts )
+import Darcs.UI.Commands
+    ( DarcsCommand(..)
+    , noPrereq
+    , nodefaults
+    , putFinished
+    , withStdOpts
+    )
hunk ./src/Darcs/UI/Commands/Convert/Darcs2.hs 143
-    , commandPrereq = \_ -> return $ Right ()
+    , commandPrereq = noPrereq
hunk ./src/Darcs/UI/Commands/Convert/Import.hs 83
+    , noPrereq
hunk ./src/Darcs/UI/Commands/Convert/Import.hs 166
-    , commandPrereq = \_ -> return $ Right ()
+    , commandPrereq = noPrereq
hunk ./src/Darcs/UI/Commands/Help.hs 49
+    , noPrereq
hunk ./src/Darcs/UI/Commands/Help.hs 131
-    , commandPrereq = \_ -> return $ Right ()
+    , commandPrereq = noPrereq
hunk ./src/Darcs/UI/Commands/Init.hs 33
+    , noPrereq
hunk ./src/Darcs/UI/Commands/Init.hs 95
-    , commandPrereq = \_ -> return $ Right ()
+    , commandPrereq = noPrereq
hunk ./src/Darcs/UI/Commands/Optimize.hs 35
-import Darcs.UI.Commands ( DarcsCommand(..), nodefaults
+import Darcs.UI.Commands ( DarcsCommand(..), nodefaults, noPrereq
hunk ./src/Darcs/UI/Commands/Optimize.hs 550
-    , commandPrereq = \_ -> return $ Right ()
+    , commandPrereq = noPrereq
hunk ./src/Darcs/UI/Commands.hs 52
+    , noPrereq
hunk ./src/Darcs/UI/Commands.hs 147
-          , commandPrereq :: [DarcsFlag] -> IO (Either String ())
+          , commandPrereq :: CommandPrereq
hunk ./src/Darcs/UI/Commands.hs 159
-          , commandPrereq :: [DarcsFlag] -> IO (Either String ())
+          , commandPrereq :: CommandPrereq
hunk ./src/Darcs/UI/Commands.hs 163
+type CommandPrereq = [DarcsFlag] -> IO (Either String ())
+
hunk ./src/Darcs/UI/Commands.hs 354
-amInHashedRepository :: [DarcsFlag] -> IO (Either String ())
+amInHashedRepository :: CommandPrereq
hunk ./src/Darcs/UI/Commands.hs 357
-amInRepository :: [DarcsFlag] -> IO (Either String ())
+amInRepository :: CommandPrereq
hunk ./src/Darcs/UI/Commands.hs 360
-amNotInRepository :: [DarcsFlag] -> IO (Either String ())
+amNotInRepository :: CommandPrereq
hunk ./src/Darcs/UI/Commands.hs 364
-findRepository :: [DarcsFlag] -> IO (Either String ())
+findRepository :: CommandPrereq
hunk ./src/Darcs/UI/Commands.hs 366
+
+noPrereq :: CommandPrereq
+noPrereq _ = return $ Right ()

[remove redundant ApplyState p ~ Tree constraints
Ben Franksen <[email protected]>**20220703104228
 Ignore-this: 7d1b29da7882a16a4d4d35e28908efe94e5943bbc7a96e541aa79208e950aefe6cc6ab88fb16654f
] hunk ./src/Darcs/UI/SelectChanges.hs 396
-viewChanges :: (ShowPatch p, ShowContextPatch p, ApplyState p ~ Tree)
+viewChanges :: (ShowPatch p, ShowContextPatch p)
hunk ./src/Darcs/UI/SelectChanges.hs 425
-    :: (Commute p, Matchable p, ShowPatch p, ShowContextPatch p, ApplyState p ~ Tree)
+    :: (Commute p, Matchable p, ShowPatch p, ShowContextPatch p)
hunk ./src/Darcs/UI/SelectChanges.hs 449
-         (Commute p, Matchable p, ShowPatch p, ShowContextPatch p, ApplyState p ~ Tree)
+         (Commute p, Matchable p, ShowPatch p, ShowContextPatch p)
hunk ./src/Darcs/UI/SelectChanges.hs 540
-              , PatchInspect p, ApplyState p ~ Tree )
+              , PatchInspect p )
hunk ./src/Darcs/UI/SelectChanges.hs 554
-               , PatchInspect p, ApplyState p ~ Tree )
+               , PatchInspect p )
hunk ./src/Darcs/UI/SelectChanges.hs 907
-textView :: (ShowPatch p, ShowContextPatch p, ApplyState p ~ Tree)
+textView :: (ShowPatch p, ShowContextPatch p)

[Darcs.Util.Printer: remove unneeded exports
Ben Franksen <[email protected]>**20220807120029
 Ignore-this: 6fe3a0a71fa33ae7a445771b9c6a5281ffdae177b39778e1341ca5331c08c9ab5e95fb6e0849b987
] hunk ./src/Darcs/Util/Printer.hs 40
-    , doc
-    , printable, invisiblePrintable, hiddenPrintable, userchunkPrintable

[remove unused appendBinFile and appendTextFile
Ben Franksen <[email protected]>**20221126185507
 Ignore-this: eac477840b61ce60774dff93f653a4f2fc7ec6613d3b9e549aca5a032dd3d3cab82e6bd1d6d8b868
] hunk ./src/Darcs/Util/Lock.hs 29
-    , appendBinFile
-    , appendTextFile
hunk ./src/Darcs/Util/Lock.hs 305
-appendBinFile :: FilePathLike p => p -> B.ByteString -> IO ()
-appendBinFile f s = appendToFile Binary f $ \h -> B.hPut h s
-
-appendTextFile :: FilePathLike p => p -> String -> IO ()
-appendTextFile f s = appendToFile Text f $ \h -> hPutStr h s
-

[add --hidesuccesses to test-options in release script
Ben Franksen <[email protected]>**20250109142220
 Ignore-this: e86dca5871aaa6ce23766b6083dd2d73135b41ec9ec507a5a3fb9e61083d1bdbb3abfc53de2c755d
] hunk ./release/release.sh 26
-cabal test --enable-tests --test-option="-j3"
+cabal test --enable-tests --test-option="-j3 --hidesuccesses"

[ci: ghc 9.8.2 -> 9.8.4
Ben Franksen <[email protected]>**20250109160011
 Ignore-this: 36c15b0ce58002d1f2c5474b7bfebcd8e5ddb21aa2793a97ca544a760223b9c3cce141ba6ceaa7eb
] hunk ./.github/workflows/build-and-test.yml 30
-          - 9.8.2
+          - 9.8.4

[D.R.Inventory.Format: rename keywords from xxxName to kwXxx
Ben Franksen <[email protected]>**20221217092927
 Ignore-this: a9d992e362b277475d92e3a081492137745882e0ffb26d4ed302cdb8ddfa00b7dd4b5bbcc74d15e2
] hunk ./src/Darcs/Repository/Inventory/Format.hs 21
-    , pristineName
replace ./src/Darcs/Repository/Inventory/Format.hs [A-Za-z_0-9] hashName kwHash
replace ./src/Darcs/Repository/Inventory/Format.hs [A-Za-z_0-9] parentName kwParent
replace ./src/Darcs/Repository/Inventory/Format.hs [A-Za-z_0-9] pristineName kwPristine

[explain use of nominal equality for ingredients of V3 patches
Ben Franksen <[email protected]>**20220619215037
 Ignore-this: aff9cba905cd47b946d4004adb189ee3d778966bfbd3cc6b3b95b7f4b754c039230d650ac36806fd
] hunk ./src/Darcs/Patch/V3/Core.hs 429
-        | IsEq <- r =\^/= s -- more efficient than IsEq <- r =\/= s
+        | IsEq <- r =\^/= s
+        -- =\^/= is not only more efficient than r =\/= s but also
+        -- semantically correct, since we want to treat different
+        -- orderings of the effect as equal here, same as we do for
+        -- the contexts in cp and cq.

[Darcs.Util.Ssh: import and use Data.Map qualified
Ben Franksen <[email protected]>**20230402143715
 Ignore-this: 10c5d3cd9c3b452502eb3d847c1697ac61882df48d32c72839a7345a5caf6033d3bfc9501c7721da
] hunk ./src/Darcs/Util/Ssh.hs 43
-
-import Data.Map ( Map, empty, insert, lookup )
+import qualified Data.Map as M
hunk ./src/Darcs/Util/Ssh.hs 147
-sshConnections :: MVar (Map RepoId (Maybe (MVar Connection)))
-sshConnections = unsafePerformIO $ newMVar empty
+sshConnections :: MVar (M.Map RepoId (Maybe (MVar Connection)))
+sshConnections = unsafePerformIO $ newMVar M.empty
hunk ./src/Darcs/Util/Ssh.hs 158
-  case lookup key cmap of
+  case M.lookup key cmap of
hunk ./src/Darcs/Util/Ssh.hs 165
-          return (insert key Nothing cmap, Nothing)
+          return (M.insert key Nothing cmap, Nothing)
hunk ./src/Darcs/Util/Ssh.hs 169
-          return (insert key (Just v) cmap, Just v)
+          return (M.insert key (Just v) cmap, Just v)
hunk ./src/Darcs/Util/Ssh.hs 216
-    return empty
+    return M.empty
hunk ./src/Darcs/Util/Ssh.hs 223
-  modifyMVar_ sshConnections (return . insert key Nothing)
+  modifyMVar_ sshConnections (return . M.insert key Nothing)

[harness: remove Darcs.Test.Patch.Properties.V1Set1.tShowRead
Ben Franksen <[email protected]>**20230506173814
 Ignore-this: 1500be30a855cea24d738175b85d87ca96eb5dcdb56e4fac055a79aaa5340fab21f89808d5c2e946
 
 (Prop1.tShowRead unsafeCompare) is the same as PropG.showRead
] hunk ./harness/Darcs/Test/Patch/Properties/V1Set1.hs 4
-       , tShowRead
hunk ./harness/Darcs/Test/Patch/Properties/V1Set1.hs 8
-import Darcs.Patch
-     ( commute, invert, merge, effect
-     , readPatch, showPatch
-     , canonizeFL )
+import Darcs.Patch ( canonizeFL, commute, effect, invert, merge )
hunk ./harness/Darcs/Test/Patch/Properties/V1Set1.hs 11
-import Darcs.Patch.Read ( ReadPatch )
-import Darcs.Patch.Show ( ShowPatchBasic, ShowPatchFor(..) )
hunk ./harness/Darcs/Test/Patch/Properties/V1Set1.hs 14
-import Darcs.Util.Printer ( renderPS )
hunk ./harness/Darcs/Test/Patch/Properties/V1Set1.hs 16
-import Darcs.Patch.Witnesses.Show
-import Darcs.Patch.Witnesses.Sealed ( Sealed(Sealed) )
hunk ./harness/Darcs/Test/Patch/Properties/V1Set1.hs 122
-tShowRead :: (Show2 p, ReadPatch p, ShowPatchBasic p)
-          => (forall wX wY wW wZ . p wX wY -> p wW wZ -> Bool) -> forall wX wY . p wX wY -> TestResult
-tShowRead eq p =
-    case readPatch $ renderPS $ showPatch ForStorage p of
-    Right (Sealed p') -> if p' `eq` p then succeeded
-                        else failed $ text $ "Failed to read shown:  "++(show2 p)++"\n"
-    Left e -> failed $ text $ unlines ["Failed to read at all:  "++show2 p, e]
-
hunk ./harness/Darcs/Test/Patch/Properties.hs 55
-import Darcs.Patch.Witnesses.Eq ( Eq2, unsafeCompare )
+import Darcs.Patch.Witnesses.Eq ( Eq2 )
hunk ./harness/Darcs/Test/Patch/Properties.hs 127
-  , testCases "primitive patch IO functions" (Prop1.tShowRead unsafeCompare) Ex.primitiveTestPatches
-  , testCases "IO functions (test patches)" (Prop1.tShowRead unsafeCompare) Ex.testPatches
-  , testCases "IO functions (named test patches)" (Prop1.tShowRead unsafeCompare) Ex.testPatchesNamed
+  , testCases "primitive patch IO functions" PropG.showRead Ex.primitiveTestPatches
+  , testCases "IO functions (test patches)" PropG.showRead Ex.testPatches
+  , testCases "IO functions (named test patches)" PropG.showRead Ex.testPatchesNamed

[avoid unneeded import of AnchoredPath data constructor
Ben Franksen <[email protected]>**20230512093325
 Ignore-this: ecac796286388dfcdd430f847a9914287e2c24e15c1fe2278c29f6954e9f299f7ba6b9ee6f7f7c46
] hunk ./src/Darcs/UI/Commands/Convert/Export.hs 97
-    , AnchoredPath(..)
+    , AnchoredPath

[optimize upgrade: refactor using D.R.Pristine.writePristine
Ben Franksen <[email protected]>**20221203113336
 Ignore-this: 12f5563a7ac2608e407742151352ada0d181b9d508e8cd29eaa726ac8a10611fc580a57d761d1891
 
 This is a slightly more high-level function.
] hunk ./src/Darcs/UI/Commands/Optimize.hs 49
+    , writePristine
hunk ./src/Darcs/UI/Commands/Optimize.hs 66
-    , tentativePristinePath
hunk ./src/Darcs/UI/Commands/Optimize.hs 84
-    , writeBinFile
hunk ./src/Darcs/UI/Commands/Optimize.hs 123
-import Darcs.Repository.InternalTypes ( repoCache, unsafeCoerceR )
+import Darcs.Repository.InternalTypes ( unsafeCoerceR )
hunk ./src/Darcs/UI/Commands/Optimize.hs 137
-import Darcs.Util.Tree.Hashed ( writeDarcsHashed )
hunk ./src/Darcs/UI/Commands/Optimize.hs 472
-  _ <- writeDarcsHashed emptyTree (repoCache _repository)
-  writeBinFile tentativePristinePath ""
+  _ <- writePristine _repository emptyTree

[pull: improve haddock for readRepos
Ben Franksen <[email protected]>**20230703211538
 Ignore-this: f44714fdde6829753d88fc8381fe8bd6a131b59fd4abc5ea09af0726d09c4182663f6b2fabde8249
] hunk ./src/Darcs/UI/Commands/Pull.hs 330
-{- Read in the specified pull-from repositories.  Perform
-Intersection, Union, or Complement read.  In patch-theory terms
-(stated in set algebra, where + is union and & is intersection
-and \ is complement):
-
-    Union =         ((R1 + R2 + ... + Rn) \ Rc)
-    Intersection =  ((R1 & R2 & ... & Rn) \ Rc)
-    Complement =    (R1 \ Rc) \ ((R2 + R3 + ... + Rn) \ Rc)
-
-                        where Rc = local repo
-                              R1 = 1st specified pull repo
-                              R2, R3, Rn = other specified pull repo
-
-Since Rc is not provided here yet, the result of readRepos is a
-tuple: the first patchset(s) to be complemented against Rc and then
-the second patchset(s) to be complemented against Rc.
+{- | Read in the specified pull-from repositories, and depending on whether
+to perform intersection, union, or complement, return two 'PatchSet's: the
+patches we want to pull and the ones we do not want to pull. In set-algebra
+terms (using + for union, & for intersection):
+
+[union]
+    > (R1 + R2 + ... + Rn, {})
+[intersection]
+    > (R1 & R2 & ... & Rn, {})
+[complement]
+    > (R1, R2 + R3 + ... + Rn)
+
hunk ./src/Darcs/UI/Commands/Pull.hs 343
-

[remove obsolete dependency on network package
Ben Franksen <[email protected]>**20230305230025
 Ignore-this: bf3e125460b451ff61dec92cd3efb40f4f6e3b2111eb520bf678c49591e39f5cfcd98b0ab4164306
] hunk ./darcs.cabal 455
-                      network           >= 2.6 && < 3.3,

[clean up import lists in D.T.Patch.Properties.Mergeable
Ben Franksen <[email protected]>**20240528083808
 Ignore-this: 6259c1d24d5fc66398198737b87c22522bd0723e074f831cbdaa18b9d295fed5aa350a42aff2cb2c
] hunk ./harness/Darcs/Test/Patch/Properties/RepoPatch.hs 9
-import Prelude ()
hunk ./harness/Darcs/Test/Patch/Properties/RepoPatch.hs 14
-import Darcs.Test.Patch.Arbitrary.Generic ( PrimBased )
-import Darcs.Test.Patch.Arbitrary.PatchTree
-  ( Tree, flattenTree, G2(..), mapTree )
-import Darcs.Test.Patch.Merge.Checked ( CheckedMerge )
-import Darcs.Test.Patch.Types.MergeableSequence ( MergeableSequence, mergeableSequenceToRL )
-import Darcs.Test.Patch.WithState
-import Darcs.Test.Patch.RepoModel
-  ( Fail, ModelOf, RepoApply, RepoModel, RepoState
-  , eqModel, maybeFail, repoApply, showModel
-  )
-import Darcs.Test.Util.TestResult ( TestResult, failed, rejected, succeeded )
-
-import Darcs.Util.Printer ( text, redText, ($$), vsep )
-
hunk ./harness/Darcs/Test/Patch/Properties/RepoPatch.hs 18
+    ( ApplyState
+    , Commute
+    , Conflict(..)
+    , Eq2
+    , Merge
+    , PatchListFormat
+    , PrimOf
+    , ShowPatchBasic
+    )
hunk ./harness/Darcs/Test/Patch/Properties/RepoPatch.hs 28
-
hunk ./harness/Darcs/Test/Patch/Properties/RepoPatch.hs 30
-import Darcs.Patch.Witnesses.Sealed ( Sealed(..), unseal, Sealed2(..) )
+import Darcs.Patch.Witnesses.Sealed ( Sealed(..), Sealed2(..), unseal )
hunk ./harness/Darcs/Test/Patch/Properties/RepoPatch.hs 32
+import Darcs.Util.Printer ( redText, text, vsep, ($$) )
+
+import Darcs.Test.Patch.Arbitrary.Generic ( PrimBased )
+import Darcs.Test.Patch.Arbitrary.PatchTree ( G2(..), Tree, flattenTree, mapTree )
+import Darcs.Test.Patch.Merge.Checked ( CheckedMerge )
+import Darcs.Test.Patch.RepoModel
+    ( Fail
+    , ModelOf
+    , RepoApply
+    , RepoModel
+    , RepoState
+    , eqModel
+    , maybeFail
+    , repoApply
+    , showModel
+    )
+import Darcs.Test.Patch.Types.MergeableSequence
+    ( MergeableSequence
+    , mergeableSequenceToRL
+    )
+import Darcs.Test.Patch.WithState
+import Darcs.Test.Util.TestResult ( TestResult, failed, rejected, succeeded )

[harness: fix order of witnesses in picture explaining Merged
Ben Franksen <[email protected]>**20240528204524
 Ignore-this: 29e81f2e6c8d60b33ab3df0b15c64a0cc9cb54f7d60e9a45d8025637a7d014ee0d5e4289c73741a
] hunk ./harness/Darcs/Test/Patch/Types/Merged.hs 13
---  wB    ----> Merged wA wB
+--  wA    ----> Merged wA wB
hunk ./harness/Darcs/Test/Patch/Types/Merged.hs 17
---  wBase ----> wA
+--  wBase ----> wB
hunk ./harness/Darcs/Test/Patch/Types/Merged.hs 31
-

[harness: improve docs for some generic patch properties
Ben Franksen <[email protected]>**20240602185723
 Ignore-this: d84846d8d1d7a22f4e037d53f0ca6452313e1a8bb01be02740555f12014d16d3917487cb6625f31
] hunk ./harness/Darcs/Test/Patch/Properties/Generic.hs 232
--- | effect preserving  AB <--> B'A' then effect(AB) = effect(B'A')
+-- | effect preserving: @AB <--> B'A' => apply(AB) = apply(B'A')@
hunk ./harness/Darcs/Test/Patch/Properties/Generic.hs 464
--- merge (A\/B) = B'/\A' ==> AB' <--> BA'
+-- | @merge (A\/B) = B'/\A' ==> AB' <--> BA'@
hunk ./harness/Darcs/Test/Patch/Properties/Generic.hs 510
--- | coalesce effect preserving
+-- | Coalescing is effect preserving
hunk ./harness/Darcs/Test/Patch/Properties/Generic.hs 540
+-- | Just X = coalesce (BC), A(BC) <--> (B'C')A', AX <--> X'A''
+--   ==>
+--   A' = A'', coalesce (B'C') = Just X'

[harness: add empty line between functions in D.T.T.P.V1Set2
Ben Franksen <[email protected]>**20240602185949
 Ignore-this: 8d7a296ee89affa57b642e974737110d5d1f3c64c872e314009cf790027518237112183da0fe8a72
] hunk ./harness/Darcs/Test/Patch/Properties/V1Set2.hs 61
+
hunk ./harness/Darcs/Test/Patch/Properties/V1Set2.hs 65
+
hunk ./harness/Darcs/Test/Patch/Properties/V1Set2.hs 115
+

[move unwrapOneTagged from D.P.Depends to D.P.Set
Ben Franksen <[email protected]>**20221217100912
 Ignore-this: 6d291cbb64966dcd82c849fc2ef1ada608d63b7b1372353d4a9acdebeacab944fad815b9211178d0
] hunk ./src/Darcs/Patch/Depends.hs 83
+    , unwrapOneTagged
hunk ./src/Darcs/Patch/Depends.hs 238
--- |'unwrapOneTagged' unfolds a single Tagged object in a PatchSet, adding the
--- tag and patches to the PatchSet's patch list.
-unwrapOneTagged :: PatchSet p wX wY -> Maybe (PatchSet p wX wY)
-unwrapOneTagged (PatchSet (ts :<: Tagged tps t _) ps) =
-    Just $ PatchSet ts (tps :<: t +<+ ps)
-unwrapOneTagged _ = Nothing
-
hunk ./src/Darcs/Patch/Set.hs 35
+    , unwrapOneTagged
hunk ./src/Darcs/Patch/Set.hs 204
+
+-- |'unwrapOneTagged' unfolds a single Tagged object in a PatchSet, adding the
+-- tag and patches to the PatchSet's patch list.
+unwrapOneTagged :: PatchSet p wX wY -> Maybe (PatchSet p wX wY)
+unwrapOneTagged (PatchSet (ts :<: Tagged tps t _) ps) =
+    Just $ PatchSet ts (tps :<: t +<+ ps)
+unwrapOneTagged _ = Nothing

[document Darcs.Util.Parser.takeTillChar
Ben Franksen <[email protected]>**20240702054809
 Ignore-this: 714373af424554787117f1194ba4bb9a26c453de7c330205a208216e2b4e124a99d84ee84836afb
 
 It doesn't quite behave as one might expect from the name.
] hunk ./src/Darcs/Util/Parser.hs 101
+-- | This function as well as 'takeTill' (on which it is based) both
+-- succeed when we hit end-of-input. So a more correct name would
+-- be 'takeTillCharOrEOF' (and 'takeTillOrEOF', respectively).

[harness: set DARCS_ESCAPE_8BIT in main
Ben Franksen <[email protected]>**20240702103725
 Ignore-this: 33828269ba1460a8f9d7b20dcaee5a892ca8bd5a21617e45d670a1d40d7bebafc1be5a0374fb7eb7
 
 This is so that when we show failing test cases we cannot run into encoding
 errors. Note that shell tests are not affected by this since they are run
 with DARCS_DONT_ESCAPE_ANYTHING which takes precedence.
] hunk ./harness/test.hs 22
+import System.Environment ( setEnv )
hunk ./harness/test.hs 226
+          setEnv "DARCS_ESCAPE_8BIT" "1"

[expand tabs in tests/issue1987.sh
Ben Franksen <[email protected]>**20240713061912
 Ignore-this: 9d2fb8aec5755a7b77b0d35b0e46aa4b28fd7831783549d2f9f0043fb1691eb5a68c8563fefaa8eb
] hunk ./tests/issue1987.sh 96
-						<(echo "$PATCHES_DIR_AFTER_AMEND")`
+                        <(echo "$PATCHES_DIR_AFTER_AMEND")`
hunk ./tests/issue1987.sh 133
-					<(echo "$INV_DIR_AFTER_SND_RECORD")`
+                    <(echo "$INV_DIR_AFTER_SND_RECORD")`
hunk ./tests/issue1987.sh 177
-					<(echo "$INV_DIR_AFTER_TAG")`
+                    <(echo "$INV_DIR_AFTER_TAG")`
hunk ./tests/issue1987.sh 205
-					<(echo "$INV_DIR_AFTER_RECORD")))
+                          <(echo "$INV_DIR_AFTER_RECORD")))
hunk ./tests/issue1987.sh 237
-										   <(echo "$PRISTINE_DIR_AFTER_RECORD")`
+                                           <(echo "$PRISTINE_DIR_AFTER_RECORD")`

[inline Darcs.Util.Tree.Monad.replaceItem
Ben Franksen <[email protected]>**20240714070659
 Ignore-this: a1f6584a2a142720d8350c249d534dad27e0add7ba76bac6784aae23f5a363e219bdab11577d769b
 
 This internal procedure is called in just one place.
] hunk ./src/Darcs/Util/Tree/Monad.hs 149
--- | Replace an item with a new version without modifying the content of the
--- tree. This does not do any change tracking. Ought to be only used from a
--- 'sync' implementation for a particular storage format. The presumed use-case
--- is that an existing in-memory Blob is replaced with a one referring to an
--- on-disk file.
-replaceItem :: Monad m
-            => AnchoredPath -> TreeItem m -> TreeMonad m ()
-replaceItem path item = do
-  modify $ \st -> st { tree = modifyTree (tree st) path (Just item) }
-
hunk ./src/Darcs/Util/Tree/Monad.hs 157
-    Just item -> lift (dumpItem path item) >>= replaceItem path
+    Just item -> do
+      let replaceItem item' =
+            modify $ \st -> st { tree = modifyTree current path (Just item') }
+      lift (dumpItem path item) >>= replaceItem

[remove Darcs.Util.Printer.prefixLines
Ben Franksen <[email protected]>**20220706123749
 Ignore-this: fabcce07569aa8c7d00b5dc9fc11ec7eba139bdf2ef9c5eff56462ffd21fbc69580fce8761a17a68
 
 The few use cases are easily replaced with the less problematic 'prefix'.
] hunk ./src/Darcs/UI/Commands/ShowDependencies.hs 28
-    , prefixLines
+    , prefix
hunk ./src/Darcs/UI/Commands/ShowDependencies.hs 155
-    indent = prefixLines ("  ")
+    indent = prefix "  "
hunk ./src/Darcs/UI/PatchHeader.hs 52
-import Darcs.Util.Printer ( Doc, text, ($+$), vcat, prefixLines, renderString )
+import Darcs.Util.Printer ( Doc, text, ($+$), vcat, prefix, renderString )
hunk ./src/Darcs/UI/PatchHeader.hs 225
-        , prefixLines (text "#") chs
+        , prefix "# " chs
hunk ./src/Darcs/Util/Printer.hs 25
-    , prefixLines
hunk ./src/Darcs/Util/Printer.hs 62
-import Darcs.Util.ByteString ( linesPS, decodeLocale, encodeLocale, gzWriteHandle )
+import Darcs.Util.ByteString ( decodeLocale, encodeLocale, gzWriteHandle )
hunk ./src/Darcs/Util/Printer.hs 269
--- TODO try to find another way to do this, it's rather a violation
--- of the Doc abstraction
-prefixLines :: Doc -> Doc -> Doc
-prefixLines prefixer prefixee =
-  vcat $ map (prefixer <+>) $ map packedString $ linesPS $ renderPS prefixee
-

[packs: replace Data.ByteString.Lazy.Char8 with Data.ByteString.Lazy
Ben Franksen <[email protected]>**20250108111122
 Ignore-this: 44f5b3e398f31e22d0065c288bf54734b7e7d4d954801e303cf2839493f1cceda21b8c7f5d6ba32e
] hunk ./src/Darcs/Repository/Packs.hs 36
-import qualified Data.ByteString.Lazy.Char8 as BLC
+import qualified Data.ByteString.Lazy as BLC
replace ./src/Darcs/Repository/Packs.hs [A-Za-z_0-9] BLC BL

Attachment: add-doc-comment-to-explain-lazy-reading-of-inventories.dpatch
Description: application/darcs-patch

_______________________________________________
darcs-devel mailing list
[email protected]
https://lists.darcs.net/mailman/listinfo/darcs-devel

Reply via email to