Ganesh Sittampalam <gan...@earth.li> added the comment:

Here's a version of the patch for 2.5. Only the third patch has been
amended.

3 patches for repository http://darcs.net/releases/branch-2.5:

Sat Sep  4 04:09:47 BST 2010  Petr Rockai <m...@mornfall.net>
  * Resolve issue1942: Fix an IO interleaving bug in old-fashioned readRepo.

Sat Sep 11 19:53:55 BST 2010  Dmitry Astapov <dasta...@gmail.com>
  * Resolve issue1942: fix the fix which ended up too strict due to unsealing.
  (manually backpopting fix by Petr Rockai to mainline)

Mon Oct 11 21:52:53 BST 2010  Ganesh Sittampalam <gan...@earth.li>
  * write out tag before trying to optimize inventory
  
  This is a backport of the patch from HEAD to the 2.5 branch.
  
  This fixes 'darcs tag' for old-fashioned repos.
  The original code seems obviously wrong, so it's hard to understand
  why things only started breaking after this patch:
  
    Sat Sep 11 19:53:55 BST 2010  Dmitry Astapov <dasta...@gmail.com>
     * Resolve issue1942: fix the fix which ended up too strict due to 
unsealing.
     (manually backpopting fix by Petr Rockai to mainline)

__________________________________
Darcs bug tracker <b...@darcs.net>
<http://bugs.darcs.net/patch387>
__________________________________
New patches:

[Resolve issue1942: Fix an IO interleaving bug in old-fashioned readRepo.
Petr Rockai <m...@mornfall.net>**20100904030947
 Ignore-this: d89716791fecb518f530fcf1b1924a9f
] hunk ./src/Darcs/Repository/DarcsRepo.lhs 71
 import System.IO.Unsafe ( unsafeInterleaveIO )
 import System.FilePath.Posix ( (</>) )
 import Control.Monad ( when )
-import Darcs.Hopefully ( PatchInfoAnd,
+import Darcs.Hopefully ( Hopefully, PatchInfoAnd,
                          patchInfoAndPatch, info,
                          actually, hopefully, unavailable, n2pia )
 import Darcs.SignalHandler ( withSignalsBlocked )
hunk ./src/Darcs/Repository/DarcsRepo.lhs 313
                  return $ seal $ Tagged tag00 Nothing ps :<: ts
           parse2 :: RepoPatch p => PatchInfo -> FilePath
                                 -> IO (Sealed (PatchInfoAnd p C(x)))
-          parse2 i fn = do ps <- gzFetchFilePS fn Cachable
-                           return $ hopefullyNoParseError i (toPath fn) (readPatch ps)
-          hopefullyNoParseError :: PatchInfo -> String
-                                -> Maybe (Sealed (Named a1dr C(x)), b)
-                                -> Sealed (PatchInfoAnd a1dr C(x))
-          hopefullyNoParseError i _ (Just (Sealed x, _)) =
-              seal $ patchInfoAndPatch i $ actually x
-          hopefullyNoParseError i s Nothing =
-              seal $ patchInfoAndPatch i $ unavailable $ "Couldn't parse file "++s
+          parse2 i fn = do ps <- unsafeInterleaveIO $ gzFetchFilePS fn Cachable
+                           Sealed p <- return $ hopefullyNoParseError (toPath fn) (readPatch ps)
+                           return $ seal $ patchInfoAndPatch i p
+          hopefullyNoParseError :: String -> Maybe (Sealed (Named a1dr C(x)), b)
+                                -> Sealed (Hopefully (Named a1dr) C(x))
+          hopefullyNoParseError _ (Just (Sealed x, _)) = seal $ actually x
+          hopefullyNoParseError s Nothing = seal $ unavailable $ "Couldn't parse file "++s
           read_patches :: RepoPatch p =>
                           (FORALL(b) PatchInfo -> IO (Sealed (PatchInfoAnd p C(b))))
                        -> [PatchInfo] -> IO (Sealed (RL (PatchInfoAnd p) C(x)))
[Resolve issue1942: fix the fix which ended up too strict due to unsealing.
Dmitry Astapov <dasta...@gmail.com>**20100911185355
 Ignore-this: 87012509b3c1c0137306b348ae585059
 (manually backpopting fix by Petr Rockai to mainline)
] hunk ./src/Darcs/Repository/DarcsRepo.lhs 107
 import Darcs.Utils ( catchall )
 import Darcs.ProgressPatches ( progressFL )
 import Printer ( text, (<>), Doc, ($$), empty )
-import Darcs.Witnesses.Sealed ( Sealed(Sealed), seal, unseal )
+import Darcs.Witnesses.Sealed ( Sealed(Sealed), seal, unseal, mapSeal )
 
 #include "impossible.h"
 \end{code}
hunk ./src/Darcs/Repository/DarcsRepo.lhs 314
           parse2 :: RepoPatch p => PatchInfo -> FilePath
                                 -> IO (Sealed (PatchInfoAnd p C(x)))
           parse2 i fn = do ps <- unsafeInterleaveIO $ gzFetchFilePS fn Cachable
-                           Sealed p <- return $ hopefullyNoParseError (toPath fn) (readPatch ps)
-                           return $ seal $ patchInfoAndPatch i p
+                           return $ patchInfoAndPatch i
+                             `mapSeal` hopefullyNoParseError (toPath fn) (readPatch ps)
           hopefullyNoParseError :: String -> Maybe (Sealed (Named a1dr C(x)), b)
                                 -> Sealed (Hopefully (Named a1dr) C(x))
           hopefullyNoParseError _ (Just (Sealed x, _)) = seal $ actually x
[write out tag before trying to optimize inventory
Ganesh Sittampalam <gan...@earth.li>**20101011205253
 Ignore-this: 61e712ff915b6aacaec3d7946e569fa6
 
 This is a backport of the patch from HEAD to the 2.5 branch.
 
 This fixes 'darcs tag' for old-fashioned repos.
 The original code seems obviously wrong, so it's hard to understand
 why things only started breaking after this patch:
 
   Sat Sep 11 19:53:55 BST 2010  Dmitry Astapov <dasta...@gmail.com>
    * Resolve issue1942: fix the fix which ended up too strict due to unsealing.
    (manually backpopting fix by Petr Rockai to mainline)
 
] hunk ./src/Darcs/Repository/DarcsRepo.lhs 192
 addToTentativeInventory opts p =
     do appendDocBinFile (darcsdir++"/tentative_inventory") $ text "\n"
                             <> showPatchInfo (patch2patchinfo p)
+       res <- writePatch opts p
        when (isTag $ patch2patchinfo p) $
             do debugMessage "Optimizing the tentative inventory, since we're adding a tag."
                realdir <- toPath `fmap` ioAbsoluteOrRemote "."
hunk ./src/Darcs/Repository/DarcsRepo.lhs 201
                Sealed ps <- readRepoPrivate k realdir "tentative_inventory"
                             :: IO  (SealedPatchSet p C(Origin) )
                simplyWriteInventory "tentative_inventory" "." $ slightlyOptimizePatchset ps
-       writePatch opts p
+       return res
 
 addToTentativePristine :: Effect p => p C(x y) -> IO ()
 addToTentativePristine p =

Context:

[Accept issue1951: add outside of current repository.
Eric Kow <ko...@darcs.net>**20100908095448
 Ignore-this: 5085d7647e9408ea7b5282e1cb0d1079
 Regression between darcs 2.4 and 2.4.98.5.
] 
[TAG 2.4.98.5
Reinier Lamers <tux_roc...@reinier.de>**20100905170906
 Ignore-this: 848f746fa6a939cef069abe6722d4206
] 
Patch bundle hash:
9bc2d4bc9e39c8b811c23622575a287252970a6a

Attachment: unnamed
Description: Binary data

_______________________________________________
darcs-users mailing list
darcs-users@darcs.net
http://lists.osuosl.org/mailman/listinfo/darcs-users

Reply via email to