[darcs-users] moin to gitit migration

Gwern Branwen gwern0 at gmail.com
Wed Apr 15 16:45:30 UTC 2009


On Mon, Apr 13, 2009 at 11:31 PM, John MacFarlane <jgm at berkeley.edu> wrote:
> You can restore that invariant by inserting the line
>
>    ensureFileExists repo name
>
> before the runDarcsCommand call.

Ah thanks. That indeed corrects the test. I've sent in a patch now
that the tests pass.

> Note, however, that your change won't suffice by itself, because
> filestore's "latest" function also gets called in formattedPage (which
> needs to know the latest revision in order to determine whether it
> can use a cached version) The way darcsLatestRevId works currently is
> horribly inefficient. It calls
>
>    darcs changes --xml-output --summary [filename]
>
> parses the whole thing, and returns the head of the list. Is there a
> command that returns just the last change made that affects the given
> file? I tried adding "--last=1", but that seems to count back in the
> global patch stack, not in the patches affecting [filename].

> In git we can just do
>
>    git rev-list --max-count=1 HEAD -- [filename]
>
> which is very fast.  I'm sure there's something comparable in darcs?
...
> John

Yes, that's right. (Dammit!) The tests clearly show up this
distinction, with 4 or 5 tests failing with --last=1. Unfortunately, I
don't think there is any other way to get at it.

-- 
gwern


More information about the darcs-users mailing list