sapling/eden/scm/tests/test-fsmonitor-nonutf8-path.t
Muir Manders 8e2d79da37 status: handle non-utf8 paths from watchman
Summary:
We don't intend to fully support non-utf8 file names, but it is important we don't error out.

We now use the new BytesNameField watchman query type so we can decode non-utf8 file paths in watchman responses. Then, we pipe the invalid paths along up to the status command where they are printed out as warnings to the user.

In the future we probably want to track invalid paths in the treestate and make "hg clean" support removing them as a special case (as suggested by quark-zju).

Reviewed By: quark-zju

Differential Revision: D43141278

fbshipit-source-id: ad04ebdf75594e33ebaded137e9c65c487f0b30b
2023-02-10 07:14:53 -08:00

22 lines
498 B
Perl

#require fsmonitor linux
#testcases pythonstatus ruststatus
#if pythonstatus
$ setconfig workingcopy.ruststatus=false workingcopy.use-rust=false status.use-rust=false
#endif
#if ruststatus
$ setconfig status.use-rust=true workingcopy.use-rust=true
#endif
$ configure modernclient
$ newclientrepo repo
hg status on a non-utf8 filename
$ touch foo
$ python3 -c 'open(b"\xc3\x28", "wb+").write(b"asdf")'
$ hg status --traceback
skipping invalid utf-8 filename: '*' (glob)
? foo