1 Tests for experimental.removeemptydirs |
1 Tests for experimental.removeemptydirs |
2 |
2 |
3 $ NO_RM=--config=experimental.removeemptydirs=0 |
3 $ NO_RM=--config=experimental.removeemptydirs=0 |
|
4 $ DO_RM=--config=experimental.removeemptydirs=1 |
4 $ isdir() { if [ -d $1 ]; then echo yes; else echo no; fi } |
5 $ isdir() { if [ -d $1 ]; then echo yes; else echo no; fi } |
5 $ isfile() { if [ -f $1 ]; then echo yes; else echo no; fi } |
6 $ isfile() { if [ -f $1 ]; then echo yes; else echo no; fi } |
6 |
7 |
7 `hg rm` of the last file in a directory: |
8 `hg rm` of the last file in a directory: |
8 $ hg init hgrm |
9 $ hg init hgrm |
96 $ hg $NO_RM --config extensions.rebase= rebase -qr . -d 'desc(second_rebase_dest)' |
97 $ hg $NO_RM --config extensions.rebase= rebase -qr . -d 'desc(second_rebase_dest)' |
97 $ cd $TESTTMP |
98 $ cd $TESTTMP |
98 |
99 |
99 Histediting across a commit that doesn't have the directory, from inside the |
100 Histediting across a commit that doesn't have the directory, from inside the |
100 directory (reordering nodes): |
101 directory (reordering nodes): |
|
102 |
|
103 A directory with the right pass exists at the end of the run, but it is a |
|
104 different directory than the current one. |
|
105 |
101 $ hg init hghistedit |
106 $ hg init hghistedit |
102 $ cd hghistedit |
107 $ cd hghistedit |
103 $ echo hi > r0 |
108 $ echo hi > r0 |
104 $ hg ci -qAm r0 |
109 $ hg ci -qAm r0 |
105 $ echo hi > r1 |
110 $ echo hi > r1 |
114 > pick e6d271df3142 1 r1 |
119 > pick e6d271df3142 1 r1 |
115 > pick 89e25aa83f0f 3 migrating_revision |
120 > pick 89e25aa83f0f 3 migrating_revision |
116 > pick b550aa12d873 2 r2 |
121 > pick b550aa12d873 2 r2 |
117 > EOF |
122 > EOF |
118 $ cd $TESTTMP/hghistedit/somedir |
123 $ cd $TESTTMP/hghistedit/somedir |
119 $ hg --config extensions.histedit= histedit -q --commands ../histedit_commands |
124 $ hg $DO_RM --config extensions.histedit= histedit -q --commands ../histedit_commands |
120 current directory was removed |
125 current directory was removed |
121 (consider changing to repo root: $TESTTMP/hghistedit) |
126 (consider changing to repo root: $TESTTMP/hghistedit) |
122 |
127 $ ls -1 $TESTTMP/hghistedit/ |
|
128 histedit_commands |
|
129 r0 |
|
130 r1 |
|
131 r2 |
|
132 somedir |
|
133 $ pwd |
|
134 $TESTTMP/hghistedit/somedir |
|
135 $ ls -1 $TESTTMP/hghistedit/somedir |
|
136 foo |
|
137 $ ls -1 |
|
138 |
|
139 Get out of the doomed directory |
123 |
140 |
124 $ cd $TESTTMP/hghistedit |
141 $ cd $TESTTMP/hghistedit |
|
142 $ hg files --rev . | grep somedir/ |
|
143 somedir/foo |
|
144 |
|
145 |
125 $ cat > histedit_commands <<EOF |
146 $ cat > histedit_commands <<EOF |
126 > pick 89079fab8aee 0 r0 |
147 > pick 89079fab8aee 0 r0 |
127 > pick 7c7a22c6009f 3 migrating_revision |
148 > pick 7c7a22c6009f 3 migrating_revision |
128 > pick e6d271df3142 1 r1 |
149 > pick e6d271df3142 1 r1 |
129 > pick 40a53c2d4276 2 r2 |
150 > pick 40a53c2d4276 2 r2 |