equal
deleted
inserted
replaced
1 Tests for experimental.removeemptydirs |
1 Tests for experimental.removeemptydirs |
|
2 |
|
3 $ cat >> pwd.py << EOF |
|
4 > import os |
|
5 > try: |
|
6 > print(os.getcwd()) |
|
7 > except OSError: |
|
8 > print("<directory is no longer accessible>") |
|
9 > EOF |
2 |
10 |
3 $ NO_RM=--config=experimental.removeemptydirs=0 |
11 $ NO_RM=--config=experimental.removeemptydirs=0 |
4 $ DO_RM=--config=experimental.removeemptydirs=1 |
12 $ DO_RM=--config=experimental.removeemptydirs=1 |
5 $ isdir() { if [ -d $1 ]; then echo yes; else echo no; fi } |
13 $ isdir() { if [ -d $1 ]; then echo yes; else echo no; fi } |
6 $ isfile() { if [ -f $1 ]; then echo yes; else echo no; fi } |
14 $ isfile() { if [ -f $1 ]; then echo yes; else echo no; fi } |
130 histedit_commands |
138 histedit_commands |
131 r0 |
139 r0 |
132 r1 |
140 r1 |
133 r2 |
141 r2 |
134 somedir |
142 somedir |
135 $ pwd |
143 #if windows |
|
144 $ "$PYTHON" "$TESTTMP/pwd.py" |
136 $TESTTMP/hghistedit/somedir |
145 $TESTTMP/hghistedit/somedir |
|
146 #else |
|
147 $ echo ${PWD} # no-pwd-check |
|
148 $TESTTMP/hghistedit/somedir |
|
149 $ "$PYTHON" "$TESTTMP/pwd.py" |
|
150 <directory is no longer accessible> |
|
151 #endif |
137 $ ls -1 $TESTTMP/hghistedit/somedir |
152 $ ls -1 $TESTTMP/hghistedit/somedir |
138 foo |
153 foo |
139 $ ls -1 |
154 $ ls -1 |
140 foo (windows !) |
155 foo (windows !) |
141 |
156 |
142 Get out of the doomed directory |
157 Get out of the doomed directory |
143 |
158 |
144 $ cd $TESTTMP/hghistedit |
159 $ cd $TESTTMP/hghistedit |
|
160 chdir: error retrieving current directory: getcwd: cannot access parent directories: $ENOENT$ (?) |
145 $ hg files --rev . | grep somedir/ |
161 $ hg files --rev . | grep somedir/ |
146 somedir/foo |
162 somedir/foo |
147 |
163 |
148 |
164 |
149 $ cat > histedit_commands <<EOF |
165 $ cat > histedit_commands <<EOF |