[Updated] D11449: tests: make removeemptydirs more portable
marmoute (Pierre-Yves David)
phabricator at mercurial-scm.org
Sun Sep 19 19:45:46 UTC 2021
Closed by commit rHG1941064d3713: tests: make removeemptydirs more portable (authored by marmoute).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D11449?vs=30293&id=30302
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D11449/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D11449
AFFECTED FILES
tests/test-removeemptydirs.t
CHANGE DETAILS
diff --git a/tests/test-removeemptydirs.t b/tests/test-removeemptydirs.t
--- a/tests/test-removeemptydirs.t
+++ b/tests/test-removeemptydirs.t
@@ -1,5 +1,13 @@
Tests for experimental.removeemptydirs
+ $ cat >> pwd.py << EOF
+ > import os
+ > try:
+ > print(os.getcwd())
+ > except OSError:
+ > print("<directory is no longer accessible>")
+ > EOF
+
$ NO_RM=--config=experimental.removeemptydirs=0
$ DO_RM=--config=experimental.removeemptydirs=1
$ isdir() { if [ -d $1 ]; then echo yes; else echo no; fi }
@@ -132,8 +140,15 @@
r1
r2
somedir
- $ pwd
+#if windows
+ $ "$PYTHON" "$TESTTMP/pwd.py"
$TESTTMP/hghistedit/somedir
+#else
+ $ echo ${PWD} # no-pwd-check
+ $TESTTMP/hghistedit/somedir
+ $ "$PYTHON" "$TESTTMP/pwd.py"
+ <directory is no longer accessible>
+#endif
$ ls -1 $TESTTMP/hghistedit/somedir
foo
$ ls -1
@@ -142,6 +157,7 @@
Get out of the doomed directory
$ cd $TESTTMP/hghistedit
+ chdir: error retrieving current directory: getcwd: cannot access parent directories: $ENOENT$ (?)
$ hg files --rev . | grep somedir/
somedir/foo
To: marmoute, #hg-reviewers
Cc: mharbison72, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210919/e6148b5f/attachment-0002.html>
More information about the Mercurial-patches
mailing list