[darcs-devel] darcs patch: Implement rm_recursive_except (and 1 more)

David Roundy droundy at abridgegame.org
Tue May 24 04:29:36 PDT 2005


On Mon, May 23, 2005 at 09:32:36PM +0100, Ian Lynagh wrote:
> By the way, do we always download foo to foo.1 or something and then mv
> foo.1 foo? (i.e. are we sure there won't be any half-complete files when
> we --continue?)

No, we don't, so there *will* be a danger of partially-downloaded files.
Perhaps we need to actually read the patches and download again if parsing
fails?

> Also, couldn't --continue-using just be --using (or some other name)? If
> I am getting another darcs unstable, wouldn't it be useful for me to be
> able to say
> 
> darcs get --using /my/darcs/unstable http://darcs.net/whateveritis

I'm not sure I care for this idea.  And I don't really like the
--continue-using flag... I'm not clear how it differs from --continue,
unless it's that you can specify it multiple times, but the code doesn't
seem to support that.

The danger with sources that aren't real "continues" is that the patches
may be in a different order, in which case you could end up with a corrupt
repository.  When we make the hashed inventories transition (so patch files
are named by a hash of their contents), it'll be safe to do this.  But then
I'd vote for reusing the existing --sibling flag.

> Hmm, and it might be nicer to catch failure copying from one place and
> then try the next, rather than splitting the list in 2 with
> doesFileExist. That way it will also be easier to allow multiple
> --using's, and we can also use a repo on a machine closer to us than the
> real repo. This should probably be done by having one function with an
> IO () type that takes a list of possibilities and uses another with an
> IO Bool type that returns success or failure.

Catching failure with a copy might work nicely with the idea of parsing
each patch to see if it's a valid patch file.  The catch is that we'd have
to grab files one at a time, and I seem to recall that especially scp works
much faster when we grab a bunch of files at one go.
-- 
David Roundy
http://www.darcs.net




More information about the darcs-devel mailing list