[darcs-users] Re: Re: Annotate doesn't recognize anything

Tommy Pettersson ptp at lysator.liu.se
Fri Aug 10 13:37:29 UTC 2007


On Fri, Aug 10, 2007 at 10:47:38AM +0200, Alexander Staubo wrote:
> On 8/9/07, Matthew Palmer <mpalmer at hezmatt.org> wrote:
> > On Thu, Aug 09, 2007 at 12:40:42PM +0200, Alexander Staubo wrote:
> > > I'm surprised that Darcs does not fall back to the checkpoint to get
> > > the patches it needs, though.
> >
> > You mean retrieve the extra patches from the parent repo?  --lazy does that,
> > I think (not available in 1.0.9, only in the 1.1.0 pre-releases).
> 
> No, I meant look in the patch file in _darcs/checkpoints/..., which
> looks to me like it contains the entire repo as a single patch. It
> would be slow to process, but it's better than just failing with the
> wrong error message, and annotate is horrendously slow already, as
> previously demonstrated. :)

Annotate on a file shows for each line of the file which patch
the line comes from. This information is collected by examining
the contents of all patches touching the file. The checkpoint
patch is just a snapshot, so unfortunately it does not provide
information about which patches originally added the lines. The
best darcs could do (besides fetching the missing patches) is to
say all "old" lines comes from the checkpoint patch. But I don't
think darcs' traditional partial repo format knows _which_
checkpoint is its "base". Actually I don't even think it can
tell it _is_ a partial repo with any certainty. So implementing
this feature could turn out to be tricky. And now the new lazy
hashed repo format is on its way.

I don't want to say this would be a bad feature as is, but
perhaps a more general form could be interesting. What if
Annotate took the --from-patch and --from-tag flags? It could
hopefully make Annotate faster when only the latest changes are
of interest. All lines from before the break could be
un-annotated or marked with the tag in --from-tag.

I'm not sure how big a change this would be, because I think the
code used by Annotate works by producing a _complete_ history of
all changes to a file, and then showing the "surface", but maybe
the evaluation is lazy in a way that only the needed patches are
examined. I fear just cutting out the selected patches and feed
that to the Annotate code, instead of all patches, would result
in all "old" lines being missing.


-- 
Tommy Pettersson <ptp at lysator.liu.se>



More information about the darcs-users mailing list