Subject: Re: bug#18514: 24.3; vc-dir sometimes guesses the wrong backend

From: Stefan Monnier <[email-masked]>
Date: Sun, 21 Sep 2014 20:46:12 -0400

> Is it possible to force vc-dir to use a specific vcs on invocation, or to
> change vc-dir's backend after the fact?

You can change vc-handled-backends whenever you feel like it.  But I'm
not sure what would be a good hook to do it at the right time.

You can change VC backend after the fact via `vc-switch-backend',
although it was not written with vc-dir in mind, so I'm not sure it'll
work for that case.

> If this bugs me enough, I'll take a crack at a workaround/fix.

The core of the problem is that currently, every backend is responsible
for doing its own "walk up the parent directories" since some backends do
that and others don't.  Back in the days of SVN, such walks did not
exist at all, but nowadays they're "the normal case".

If you look at vc-default-registered, you'll see what was considered
"normal" many years ago.  Nowadays 99.9% of Emacs users have no clue
what those master-templates might be for.

So we need to change vc-registered (and the associated `registered'
backend functions) so that it does the walk up the parent directories,
and then calls each backend, yet also let the backend "refuse" to do
this walk (in case of RCS or SCCS).

        Stefan