On Thu, Jul 21, 2005 at 08:31:37AM -0400, David Roundy wrote:
> Hi all (but especially Ian),
>
> I seem to remember a patch by Ian, but can't find it in any of my
> mailboxes, and it's not in the darcs-unstable tree, so I'm wondering if any
> of you remember it or have it.
I think you mean the attached (and your comment would also need to be
applied).
Going by admittedly hazy memories, as long as we actually open the old
pending early enough I don't see why this should cause a problem,
though. Perhaps our lazy reading is delaying the entire file reading
rather than just the actual reading of the contents?
Thanks
Ian
--- Begin Message ---
David,
Do you have any comments about this for a solution to #323?
(the problem is that we first apply the patch to pristine, then the
actual diff of pristine and working happens. This just applies to
pristine first, with a bit of fiddling to make the valid pending check
succeed. Would probably need to be done in another place or two too.)
Tue Jun 21 18:31:21 BST 2005 Ian Lynagh <[EMAIL PROTECTED]>
* Remove redundant sift_for_pending
Wed Jun 22 04:25:56 BST 2005 Ian Lynagh <[EMAIL PROTECTED]>
* Apply to working directory before pristine
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
New patches:
[Remove redundant sift_for_pending
Ian Lynagh <[EMAIL PROTECTED]>**20050621173121] {
hunk ./Repository.lhs 207
- - Just _ -> writePatch "_darcs/patches/pending" $ sift_for_pending p
+ Just _ -> writePatch "_darcs/patches/pending" p
}
[Apply to working directory before pristine
Ian Lynagh <[EMAIL PROTECTED]>**20050622032556] {
hunk ./Pull.lhs 40
- - write_pending, read_pending,
+ write_pending_then, read_pending,
hunk ./Pull.lhs 173
- - repairable $ do pris <- identifyPristine
- - applyPristine pris pc
- - `catch` \e ->
- - fail ("Error applying patch to recorded.\nRunning 'darcs repair' on the target repo may help.\n" ++ show e)
hunk ./Pull.lhs 176
- - write_pending $ join_patches
- - [invert pc, fromMaybePatch mp, pw_resolved]
- - -- so work will be more recent than rec:
- - revertable wait_a_moment
- - revertable $ apply pw_resolved `catch` \e ->
- - fail ("Error applying patch to working dir:\n" ++ show e)
+ write_pending_then
+ (join_patches [invert pc, fromMaybePatch mp, pw_resolved]) $
+ do revertable $ apply pw_resolved `catch` \e ->
+ fail ("Error applying patch to working dir:\n" ++ show e)
+ -- so work will have a different time to rec:
+ revertable wait_a_moment
+ repairable $ do pris <- identifyPristine
+ applyPristine pris pc
+ `catch` \e ->
+ fail ("Error applying patch to recorded.\nRunning 'darcs repair' on the target repo may help.\n" ++ show e)
hunk ./Repository.lhs 52
- - read_pending, write_pending,
+ read_pending, write_pending, write_pending_then,
hunk ./Repository.lhs 68
- - doesDirectoryExist )
+ doesDirectoryExist, renameFile )
hunk ./Repository.lhs 200
- -write_pending origp =
+write_pending origp = write_pending_then origp (return ())
+
+write_pending_then :: Patch -> IO a -> IO a
+write_pending_then origp f =
hunk ./Repository.lhs 206
- - then writePatch "_darcs/patches/pending" p
+ then do writePatch "_darcs/patches/pending" p
+ f
hunk ./Repository.lhs 209
+ writePatch "_darcs/patches/pending.new" p
+ r <- f
hunk ./Repository.lhs 213
- - Just _ -> writePatch "_darcs/patches/pending" p
+ Just _ ->
+ do renameFile "_darcs/patches/pending.new" "_darcs/patches/pending"
+ return r
hunk ./Repository.lhs 217
- - writeBinFile "_darcs/patches/pending_buggy" ""
- - writePatch "_darcs/patches/pending_buggy" p
+ renameFile "_darcs/patches/pending.new" "_darcs/patches/pending_buggy"
}
Context:
[Remove '\n's from Docs, and remove some unwanted spaces
Ian Lynagh <[EMAIL PROTECTED]>**20050615003925]
[format error to be easier to read
Mark Stosberg <[EMAIL PROTECTED]>**20050604231330
Before this change, the description ran directly into the patch name, like
this:
Couldn't read patch Wed Jul ...
]
[Don't define our lex function separately for PackedStrings, and take it out of Stringalike itself
Ian Lynagh <[EMAIL PROTECTED]>**20050615024343]
[Teach apply how to handle ChangePref patches
Ian Lynagh <[EMAIL PROTECTED]>**20050615023428]
[Make more RepoPrefs functions generic in their Monad
Ian Lynagh <[EMAIL PROTECTED]>**20050615023359]
[Make some repo prefs functions generic in the Monad they use
Ian Lynagh <[EMAIL PROTECTED]>**20050615022455]
[Add m{Write,Read}BinFile, mDoes{Directory,File}Exist to DarcsIO
Ian Lynagh <[EMAIL PROTECTED]>**20050615022310]
[Fall back to the inefficient, but safe, separate_middle_last_from_first defn.
Ian Lynagh <[EMAIL PROTECTED]>**20050615010549]
[provide a clue with there is an error applying patch to recorded.
Mark Stosberg <[EMAIL PROTECTED]>**20050604230334]
[quit recommend 'get --verbose'
Mark Stosberg <[EMAIL PROTECTED]>**20050605004133
Get now gives nice feedback by default, a continually updating with feedback
like:
Copying patch 13 of 135
--verbose additionally shows the patch IDS, which most people won't care about.
So the --verbose recommedation is no longer needed.
]
[Tidy up after tests
Ian Lynagh <[EMAIL PROTECTED]>**20050604193114]
[Fix test warnings
Ian Lynagh <[EMAIL PROTECTED]>**20050604193054]
[RT#413: add TODO test for bug: add should return an error when files can't be read.
Mark Stosberg <[EMAIL PROTECTED]>**20050602161701]
[RT#414: test case for 'record' failing when there are multiple files with permissions problems.
Mark Stosberg <[EMAIL PROTECTED]>**20050602163139]
[GNUmakefile: update predist to copy Context.hs instead of c_context.c
Tomasz Zielonka <[EMAIL PROTECTED]>**20050525093936]
[move some of predist commands to GNUmakefile, to the predist target
Tomasz Zielonka <[EMAIL PROTECTED]>**20050525090659]
[add sal_last
Tommy Pettersson <[EMAIL PROTECTED]>**20050518194617]
[TAG darcs unstable 2005-05-29
Ian Lynagh <[EMAIL PROTECTED]>**20050529125403]
Patch bundle hash:
15b2f8200416fa271ec8df19485d54aeb89bdb05
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFCuNuCw1LMYXi7WGsRAqmLAJ921irjqnOc6zst4lwb/Ui/8SW/HgCgkUms
+fekYm98eBeOZ4zarP0iylI=
=KMEy
-----END PGP SIGNATURE-----
_______________________________________________
darcs-devel mailing list
[email protected]
http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel
--- End Message ---
--- Begin Message ---
On Wed, Jun 22, 2005 at 04:34:42AM +0100, Ian Lynagh wrote:
>
> Do you have any comments about this for a solution to #323?
Looks mostly all right. My biggest concern (and I haven't actually applied
it, so I don't see all the context) is that it looks like the update of the
inventories is now further from the application to pristine. I'd rather
put them adjacent to minimize the danger of repository corruption due to
power outage or kill -9.
In a side note, perhaps we should add some sort of corruption-lock to the
repository, which would exist while we're updating the pristine cache, and
would be removed by repair? It'd be more than the existing lock, since it's
very easy to kill darcs and leave the lock behind, and usually you just
want to remove the lock by hand. But if one leaves the corruption marker
behind, one really ought to run darcs repair, since there'd be a high
probability of corruption in that case.
> (the problem is that we first apply the patch to pristine, then the
> actual diff of pristine and working happens. This just applies to
> pristine first, with a bit of fiddling to make the valid pending check
> succeed. Would probably need to be done in another place or two too.)
If I understand properly, the trick you used was to write the pending patch
*first* and then after the pristine cache has been updated check whether
the pending patch is actually valid? That's a clever trick. I hadn't
thought of separating the two like that, which is why I had to go for my
touch_patch business.
I do think that we still need to track down that bus error, right? Although
this fixes a real bug, we still have another real bug that I'd like to
find. I would do it this weekend, except that I've got a conference. :(
--
David Roundy
http://www.darcs.net
_______________________________________________
darcs-devel mailing list
[email protected]
http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel
--- End Message ---
_______________________________________________
darcs-devel mailing list
[email protected]
http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel