Subject: bug#39380: 26.3: Opening files in vc-dir-mode with differing root and working dir fails

From: Wolfgang Scherer <[email-masked]>
Date: Sun, 2 Feb 2020 23:35:42 +0100

Am 01.02.20 um 08:20 schrieb Dmitry Gutov:
> On 01.02.2020 3:13, Wolfgang Scherer wrote:
>> 3. Press `C-x v d RET`, which will show a "Working dir" different from "Root":
>>
>>     .. code-block:: text
>>
>>        Working dir: check-hgs/sub1/
>>        Root       : check-hgs
>>
>>                             ./
>>                             sub1/
>>        unregistered         sub1/a
>>                             sub2/
>>        unregistered         sub2/x
>
> Maybe this should be fixed in vc-hg-status-files by not showing "outside" files and using proper relative names.
>
> Compare how VC-Dir works with Git: when you open it in a subdirectory, it only shows changed files in that directory, and with proper relative names.

The behavior should be consistent. In Emacs 24/25 vc-dir-mode for Mercurial behaved exactly like Git. Since the behavior for Mercurial changed some time after Emacs 24, I just assumed (probably because of my bias towards `dvc`) that the new behavior was intended.

I really have no preference how the faulty behavior is fixed, since I have long since defined some advice before `vc-dir-prepare-status-buffer`. I have also not checked the documentation to find out what the intended behavior is.