[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Limitations of Emacs' vc when using modern backends
From: |
Stefan Monnier |
Subject: |
Re: Limitations of Emacs' vc when using modern backends |
Date: |
Thu, 15 Dec 2005 15:24:11 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
>>> If multiple revisions match, the latest one is chosen.
>> And this is a feature of vc-darcs rather than of darcs itself, right?
> No, it's actually a feature of Darcs itself.
OK, good. So it's very much like CVS's tag names (from the point of view
of the problems it introduces).
>> The only problem I see with `canonical-revision' is that for some backends
>> it may be very costly (for CVS it requires a round trip to the repository),
>> and it may suffer from race conditions.
> Good point about the cost (see below). On the other hand, there's no
> race condition if you do things in the right order: first normalise
> the version, then fetch the file from the backend using the canonical
> identifier.
True. And this order is the natural one anyway, so the issue of the race
condition was a red herring. Lucky someone's actually thinking here ;-)
>> Now `canonical-revision' is more general, but I'm wondering: where would it
>> be used other than in `vc-version-other-window'?
> In the current vc-darcs, it's also used by vc-diff.
Could you explain why you explicitly call vc-darcs-rev-to-hash in
vc-darcs-checkout and vc-darcs-diff ? If it's a feature of darcs itself, it
seems like vc-darcs shouldn't need to do the mapping (except for things
like the file~rev~ names, but that's done outside vc-darcs.el so you're
stuck with it right now).
> I haven't checked exhaustively if there are other instances where it might
> be useful.
It seems like it's only really needed (from vc.el's point of view) at those
very few points where we store and/or compare revision names, and AFAICT
it's currently only done for the naming of "backup" files file~rev~.
> I suggest that for backends that need it vc-BACKEND-canonical-revision
> should be compulsory, and we should optionally allow checkout and diff
> to return the canonical identifier(s).
[ In Emacs-22, rather it's not `checkout' but `find-version'. ]
Why should `diff' return the canonical identifiers?
> (What a pity elisp doesn't have multiple return values).
But it does. Not as efficient (syntax-wise or memory&cpu-wise), but that's
not an issue here since it's lost in the noise of the backend's execution.
> And adding generic support for completion is definitely a good idea.
> Bug again it might be premature to aim for having it in 22.
I haven't proposed it until now, indeed, although to tell you the truth,
I don't see what kind of controversy there might be about its shape.
Stefan
Re: Limitations of Emacs' vc when using modern backends, Andre Spiegel, 2005/12/15