mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 09:17:30 +03:00
4b08050ced
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
31 lines
661 B
Perl
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"]
|