[darcs-users] Getting a full diff for pulled patches

Alexander Staubo alex at purefiction.net
Thu Jul 26 00:32:22 UTC 2007


On 7/26/07, David Roundy <droundy at darcs.net> wrote:
> On Thu, Jul 26, 2007 at 12:14:27AM +0200, Alexander Staubo wrote:
> > This is a small repo -- 3,500 files or around 24MB in total (excluding
> > _darcs, which has 5,600 files, or 64MB). Perhaps this operation is
> > fairly quick with recently-checkpointed repos, but I can't count on
> > this being the case; the operation I am implementing cannot take more
> > than a second or so.
>
> A local partial get is much slower than a local full get, or at least it
> should be.

I didn't know this. All right, good point, though there's the
additional snag: You cannot "get" from a partial repo -- you get this
obscure error ("openBinaryFile: does not exist"), and you have to add
--partial. So while performance on full repos might be fine, partial
repos would be horrible.

[snip]
> You could also get the remote patch contents with darcs changes --repo -v.

Silly me, I had no idea that the changes command could do remote
repos, since most of the usual repo-interaction commands don't. That's
great news.

[snip]
> > The process for push is similar, but I need to use "darcs changes"
> > instead to build up the original file; in fact, I guess I can skip the
> > read-the-pristine-file step and simply use the --to-match argument to
> > get the entire change history.
>
> You could also just process the output of darcs annotate on the file to
> remove the annotations.  It's a bit stupid, but allows you to use darcs to
> get the version of the file you want.
>
> Or if you really just want diffs, why not use darcs diff? Or darcs annotate
> --unified?

You're right -- for the push case I can use "annotate" to get the
original file, and I can use "diff" to get the diff instead of reading
the output of "push --dry-run --verbose".

On the other hand, if I implement the reconstruction logic for pulls,
I could just reuse it for pushes, and sharing the logic between the
two cases would be beneficial. The two operations are, as far as I can
tell, completely analogous.

What would have really helped is if "annotate" could support the
--repo argument for remote repos. Then I could trivially reconstruct
the ancestor file for both pulls and pushes, and it would all be using
Darcs itself instead of my home-brewed patch reconstruction logic,
improving future compatibility and reducing the possibility of
unforeseen edge cases.

Alexander.



More information about the darcs-users mailing list