sapling/tests/test-rust-rmcwd.t
Jun Wu 4b08050ced hgcommands: improve getcwd error handling
Summary:
In case a directory was deleted and recreated, attempt to `cd $PWD` to autofix
issues about `getcwd`. Otherwise, let's avoid panic by showing a better error
message.

Reviewed By: DurhamG

Differential Revision: D18120609

fbshipit-source-id: f1882412336c7da66431cd946074a895f29518c9
2019-10-24 13:40:20 -07:00

31 lines
661 B
Perl

#require rmcwd
(rmcwd is incompatible with Python tests right now - os.getcwd() will fail)
$ A=$TESTTMP/a
$ mkdir $A
$ cd $A
Removed cwd
Note: With buck build the hg script can be a wrapper that runs shell commands.
That can print extra noisy outputs like " shell-init: error retrieving current
directory: getcwd: cannot access parent directories". So we skip this test for
buck build.
#if normal-layout
$ rmdir $A
$ hg debug-args
abort: cannot get current directory: * (glob)
[74]
#endif
Recreated cwd
$ mkdir $A
$ hg debug-args a
(warning: the current directory was recrated, consider running 'cd $PWD' to fix your shell)
["a"]