I have my fileinfo branch of DVC under both monotone and bzr control.
DVC mistakenly uses monotone for commands started from the bzr-status
buffer.

dvc-current-active-dvc uses four sources to determine the back-end to
use. In order of priority, they are:

dvc-buffer-current-active-dvc (buffer-local variable)
dvc-temp-current-active-dvc   (global; should be let-bound)
dvc-current-active-dvc-cache  (global alist of directories)
searching for a tree root

I can select whether dvc-status will use xmtn or bzr by binding
dvc-temp-current-active-dvc;

(let ((dvc-temp-current-active-dvc 'bzr))  (dvc-status "/Gnu/dvc-fileinfo/"))
(let ((dvc-temp-current-active-dvc 'xmtn)) (dvc-status "/Gnu/dvc-fileinfo/"))

That works.

However, bzr-dvc-status does _not_ set dvc-buffer-current-active-dvc.
So subsequent commands, such as dvc-pull, use xmtn (because it is
before bzr in dvc-select-priority).

Currently, dvc-buffer-current-active-dvc is set by
dvc-get-buffer-create; bzr-dvc-status calls that. However,
bzr-dvc-status later calls dvc-diff-mode, which resets
dvc-buffer-current-active-dvc to nil, because it is defined by
define-derived-mode, which runs kill-all-local-variables.

I think the general policy should be that _all_ dvc mode functions set
dvc-buffer-current-active-dvc, along with other significant
buffer-local variables.

Currently, there is a work-around for this same problem in
dvc-build-revision-list; that resets dvc-buffer-current-active-dvc
after calling dvc-revlist-mode. It would be cleaner if
dvc-revlist-mode would set dvc-buffer-current-active-dvc.

The dvc-mode functions should call dvc-current-active-dvc to set
dvc-buffer-current-active-dvc.

I've committed a change to dvc-diff-mode to set
dvc-buffer-current-active-dvc. I have not looked for all "dvc modes". 

--
-- Stephe

_______________________________________________
Dvc-dev mailing list
[email protected]
https://mail.gna.org/listinfo/dvc-dev

Reply via email to