D3628: status: add default of --terse=u to tweakdefaults (BC)

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Thu Jun 21 18:09:47 UTC 2018


martinvonz added inline comments.

INLINE COMMENTS

> test-status.t:112
>    $ hg status --cwd a --config ui.tweakdefaults=yes
> -  ? 1/in_a_1
> -  ? in_a
> -  ? ../b/1/in_b_1
> -  ? ../b/2/in_b_2
> -  ? ../b/in_b
> +  ? .
> +  ? ../b/

We had a more extreme case of "entire working directory is untracked" in our internal tests. It was something like this

  $ dir=foo/bar/baz/qux
  $ mkdir -p $dir
  $ cd $dir
  $ echo stuff > file
  $ hg st
  ? file

After this patch (we have tweakdefaults turned on internally), the output is instead this:

  $ hg st
  ../../../../

It's correct, but it's much less readable than the old output. Git does the same thing (it also shows `../../../../`), btw.

Maybe we shouldn't terse-ify the files in the current working directory? I understand how treating the working directory differently is not very appealing. Note that with both hg and git, if you add a file in the root directory of an empty repo, then the filename will still be printed (it doesn't just say `.`).

Consider an empty repo with these paths:

  dir/subdir/subdir/a
  dir/subdir/b
  c

If you're in the root directory, I think we all expect to get this:

  ? dir/
  ? c

How about when you're in `dir/subdir`? We currently get this:

  ? ../
  ? ../../c

Perhaps it's better to display this?

  ? subdir/
  ? b
  ? ../../c

That seems consistent with not abbreviating the root directory's entries to just '.'.

It still gets weird when you're in dir/subdir/subdir/. Should we show this?

  ? a
  ? ../b
  ? ../../../c

Thoughts?

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3628

To: durin42, #hg-reviewers, pulkit
Cc: martinvonz, mercurial-devel


More information about the Mercurial-devel mailing list