darcs

Patch 335 Resolve issue1908: try to create a global cache before...

Title Resolve issue1908: try to create a global cache before...
Superseder Nosy List kowey, mornfall
Related Issues
Status accepted Assigned To
Milestone

Created on 2010-08-08.12:22:34 by mornfall, last changed 2011-05-10.20:35:48 by darcswatch. Tracked on DarcsWatch.

Files
File name Status Uploaded Type Edit Remove
resolve-issue1908_-try-to-create-a-global-cache-before-checking-its-availability_.dpatch mornfall, 2010-08-08.12:22:34 text/x-darcs-patch
unnamed mornfall, 2010-08-08.12:22:34
See mailing list archives for discussion on individual patches.
Messages
msg12046 (view) Author: mornfall Date: 2010-08-08.12:22:34
See the issue tracker for explanation.

Yours,
   Petr.

1 patch for repository http://darcs.net/:

Sun Aug  8 14:24:19 CEST 2010  Petr Rockai <me@mornfall.net>
  * Resolve issue1908: try to create a global cache before checking its availability.
Attachments
msg12049 (view) Author: kowey Date: 2010-08-08.12:34:52
On Sun, Aug 08, 2010 at 12:22:34 +0000, Petr Ročkai wrote:
> Sun Aug  8 14:24:19 CEST 2010  Petr Rockai <me@mornfall.net>
>   * Resolve issue1908: try to create a global cache before checking its availability.

What about users that don't want a global cache?

Looks like our user documentation is lacking: How do users disable the
global cache if they don't want it?  I'm guessing they would have to
make sure ~/.darcs/sources is empty (well, that it excludes the global
cache entry).

If so, would this mechanism support this?  I'm guessing it does because
we only attempt to create the cache if it's in the sources.

Also, does createCache deal correctly with cache entries that are explicitly
marked readonly (in darcs sources, not in the filesystem mind you)?  Or is
that such a corner case that we shouldn't worry about it.

-                                 do
-                                   checkCacheReachability (show e) c
-                                   (fname,x) <- filterBadSources cs >>= ffuc
-                                   do createCache c subdir
-                                      createLink fname (fn c)
-                                      return (fn c, x)
-                                    `catchall`
+                                 do createCache c subdir `catchall` return () -- don't worry
+                                    checkCacheReachability (show e) c
+                                    (fname,x) <- filterBadSources cs >>= ffuc
+                                    do createLink fname (fn c)
+                                       return (fn c, x)
+                                     `catchall`

This looks like it just added the createCache, which seems fine if my questions
above are fine.

Same request to Adolfo: please produce minimal patches to ensure fast review.

Also, the comment could probably say something more useful than "don't worry"
perhaps explaining why we try to create the cache (it may be missing) and why
it's no big deal if it fails

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
For a faster response, please try +44 (0)1273 64 2905.
msg12054 (view) Author: mornfall Date: 2010-08-08.13:14:23
Eric Kow <kowey@darcs.net> writes:
> What about users that don't want a global cache?
I'd suggest adding ALL no-cache to ~/.darcs/defaults to that effect. We
should update the docs/faq/whatever we have, I guess.

Yours,
   Petr.
msg12055 (view) Author: mornfall Date: 2010-08-08.13:17:07
Eric Kow <kowey@darcs.net> writes:
> Also, does createCache deal correctly with cache entries that are explicitly
> marked readonly (in darcs sources, not in the filesystem mind you)?  Or is
> that such a corner case that we shouldn't worry about it.

This whole block is guarded with "| writable", so I wouldn't worry about
that.

>
> -                                 do
> -                                   checkCacheReachability (show e) c
> -                                   (fname,x) <- filterBadSources cs >>= ffuc
> -                                   do createCache c subdir
> -                                      createLink fname (fn c)
> -                                      return (fn c, x)
> -                                    `catchall`
> +                                 do createCache c subdir `catchall` return () -- don't worry
> +                                    checkCacheReachability (show e) c
> +                                    (fname,x) <- filterBadSources cs >>= ffuc
> +                                    do createLink fname (fn c)
> +                                       return (fn c, x)
> +                                     `catchall`
>
> This looks like it just added the createCache, which seems fine if my questions
> above are fine.
>
> Same request to Adolfo: please produce minimal patches to ensure fast review.
I actually shuffled the createCache out of the inner block. Not sure the
patch could be made any smaller.

> Also, the comment could probably say something more useful than "don't worry"
> perhaps explaining why we try to create the cache (it may be missing) and why
> it's no big deal if it fails
Oh. I didn't intend to actually add that comment :D. The idea is that we
check whether this worked on the next line.

Yours,
   Petr.
msg12057 (view) Author: kowey Date: 2010-08-08.13:37:22
On Sun, Aug 08, 2010 at 15:20:02 +0200, Petr Rockai wrote:
> > Also, does createCache deal correctly with cache entries that are explicitly
> > marked readonly (in darcs sources, not in the filesystem mind you)?  Or is
> > that such a corner case that we shouldn't worry about it.
> 
> This whole block is guarded with "| writable", so I wouldn't worry about
> that.

...

> > Same request to Adolfo: please produce minimal patches to ensure fast review.
> I actually shuffled the createCache out of the inner block. Not sure the
> patch could be made any smaller.

Thanks for the clarification.  This would have been more evident to
me if I had actually taken the time to view your patch in a graphical
diff tool, tsk.

For now my workflow is

  darcs apply -i /tmp/foo.dpatch
  darcs-gdiff --last=1

with

  alias darcs-gdiff='darcs diff --diff-command='\''meld %1 %2'\'''

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
For a faster response, please try +44 (0)1273 64 2905.
msg12058 (view) Author: darcswatch Date: 2010-08-08.13:42:11
This patch bundle (with 1 patches) was just applied to the repository http://darcs.net/.
This message was brought to you by DarcsWatch
http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-1789ccebb70bfa0af2f3b3e0e7ba1ae1e9257e80
msg14272 (view) Author: darcswatch Date: 2011-05-10.20:35:48
This patch bundle (with 1 patches) was just applied to the repository http://darcs.net/reviewed.
This message was brought to you by DarcsWatch
http://darcswatch.nomeata.de/repo_http:__darcs.net_reviewed.html#bundle-1789ccebb70bfa0af2f3b3e0e7ba1ae1e9257e80
History
Date User Action Args
2010-08-08 12:22:34mornfallcreate
2010-08-08 12:23:37darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-1789ccebb70bfa0af2f3b3e0e7ba1ae1e9257e80
2010-08-08 12:34:52koweysetnosy: + kowey
messages: + msg12049
2010-08-08 13:14:23mornfallsetmessages: + msg12054
2010-08-08 13:17:07mornfallsetmessages: + msg12055
2010-08-08 13:37:23koweysetmessages: + msg12057
2010-08-08 13:42:11darcswatchsetstatus: needs-review -> accepted
messages: + msg12058
2011-05-10 20:35:48darcswatchsetmessages: + msg14272