Ben Franksen <[email protected]> added the comment:

5 patches for repository /home/franksen/src/darcs/bla:

patch 34012b0f3c3fec83b3d4e851f4a4bec3dbc42ea7
Author: Ben Franksen <[email protected]>
Date:   Sun Apr 23 18:37:23 CEST 2023
  * document Name and turn unName from record accessor to a separate function

  This makes the derived Show instance less verbose, which is helpful when
  debugging failing test cases.

patch 22b35c6b822281bea274838a96d5fdbc37c9d24e
Author: Ben Franksen <[email protected]>
Date:   Fri May 12 11:36:46 CEST 2023
  * use ShortByteString for Name (and thus AnchoredPath)

  This is the minimum necessary change that keeps the external API as is.

patch e4f4f99cd9e24818a2099eca454f15400bcb2a9d
Author: Ben Franksen <[email protected]>
Date:   Sat May 13 08:20:54 CEST 2023
  * remove unused name2fp

patch b340726142282fa5a084d5558241580d0fb28789
Author: Ben Franksen <[email protected]>
Date:   Sat May 13 08:36:08 CEST 2023
  * optimize eqAnycase

patch d56aa483b47935dda652c07d756835d20cb8f1aa
Author: Ben Franksen <[email protected]>
Date:   Mon Dec 16 20:22:31 CET 2024
  * fix: require bytestring >= 0.11.3.0

  Earlier versions don't export Data.ByteString.Short.map. This fixes building 
with
  ghc < 9.2, after being broken by

  patch 22b35c6b822281bea274838a96d5fdbc37c9d24e
  Author: Ben Franksen <[email protected]>
  Date:   Fri May 12 11:36:46 CEST 2023
    * use ShortByteString for Name (and thus AnchoredPath)

__________________________________
Darcs bug tracker <[email protected]>
<https://bugs.darcs.net/patch2434>
__________________________________
[document Name and turn unName from record accessor to a separate function
Ben Franksen <[email protected]>**20230423163723
 Ignore-this: 32a37ed0123f01b0c3ce5d1edb06cf9645b849d0058d86abe9f393459ced320791278a1e52e2f3af
 
 This makes the derived Show instance less verbose, which is helpful when
 debugging failing test cases.
] hunk ./src/Darcs/Util/Path.hs 387
-newtype Name = Name { unName :: B.ByteString } deriving (Binary, Eq, Show, Ord)
+-- The type of file and directory names that can appear as entries inside a
+-- directory. Must not be empty, ".", or "..", and must not contain path
+-- separators. Also must be a valid (relative) file path on the native platform
+-- (TODO this is currently not checked).
+newtype Name = Name B.ByteString deriving (Binary, Eq, Ord, Show)
+
+unName :: Name -> B.ByteString
+unName (Name s) = s

[use ShortByteString for Name (and thus AnchoredPath)
Ben Franksen <[email protected]>**20230512093646
 Ignore-this: 27ce412afbfea9dc4e85adb442859c5bd9490404aeeb7fa215c64efafac8c03a22453969eb1b420b
 
 This is the minimum necessary change that keeps the external API as is.
] hunk ./src/Darcs/Util/Path.hs 95
+import qualified Data.ByteString.Short as BS
hunk ./src/Darcs/Util/Path.hs 392
-newtype Name = Name B.ByteString deriving (Binary, Eq, Ord, Show)
+newtype Name = Name BS.ShortByteString deriving (Binary, Eq, Ord, Show)
hunk ./src/Darcs/Util/Path.hs 395
-unName (Name s) = s
+unName (Name s) = BS.fromShort s
hunk ./src/Darcs/Util/Path.hs 437
-name2fp (Name ps) = decodeLocale ps
+name2fp = decodeLocale . unName
hunk ./src/Darcs/Util/Path.hs 442
-flatten (AnchoredPath p) = BC.intercalate (BC.singleton '/') [n | (Name n) <- p]
+flatten (AnchoredPath p) = BC.intercalate (BC.singleton '/') (map unName p)
hunk ./src/Darcs/Util/Path.hs 490
-  | otherwise = Right (Name s)
+  | otherwise = Right (Name (BS.toShort s))
hunk ./src/Darcs/Util/Path.hs 505
-eqAnycase (Name a) (Name b) = BC.map toLower a == BC.map toLower b
+eqAnycase (Name a) (Name b) = BS.map to_lower a == BS.map to_lower b
+  where
+    to_lower :: Word8 -> Word8
+    to_lower = fromIntegral . fromEnum . toLower . toEnum . fromIntegral
replace ./src/Darcs/Util/Path.hs [A-Za-z_0-9] unName fromName

[remove unused name2fp
Ben Franksen <[email protected]>**20230513062054
 Ignore-this: 51ec70e89ea336f859e378a52f002e48ee845cbf1a1ad555b542b0447e213224c437ea21741df0e7
] hunk ./src/Darcs/Util/Path.hs 62
-    , name2fp
hunk ./src/Darcs/Util/Path.hs 435
-name2fp :: Name -> FilePath
-name2fp = decodeLocale . fromName
-

[optimize eqAnycase
Ben Franksen <[email protected]>**20230513063608
 Ignore-this: 3c4495a2b69f482beb5c67d89a1649e524da7c9d09cc6ed6960127803647729966519579d9b7c4ba
] hunk ./src/Darcs/Util/Path.hs 97
+import GHC.Base ( unsafeChr )
hunk ./src/Darcs/Util/Path.hs 505
-    to_lower = fromIntegral . fromEnum . toLower . toEnum . fromIntegral
+    to_lower = fromIntegral . ord . toLower . unsafeChr . fromIntegral

[fix: require bytestring >= 0.11.3.0
Ben Franksen <[email protected]>**20241216192231
 Ignore-this: f63cc0a56768c2cc7bd23c81eb8f9a6e55ca2f3ccc62f8cf0cd086d50daa475a6860cbedda657b62
 
 Earlier versions don't export Data.ByteString.Short.map. This fixes building with
 ghc < 9.2, after being broken by
 
 patch 22b35c6b822281bea274838a96d5fdbc37c9d24e
 Author: Ben Franksen <[email protected]>
 Date:   Fri May 12 11:36:46 CEST 2023
   * use ShortByteString for Name (and thus AnchoredPath)
] hunk ./darcs.cabal 441
-                      bytestring        >= 0.10.6 && < 0.13,
+                      bytestring        >= 0.11.3.0 && < 0.13,

Attachment: document-name-and-turn-unname-from-record-accessor-to-a-separate-function_0.dpatch
Description: application/darcs-patch

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

Reply via email to