annotate tests/test-removeemptydirs.t @ 47580:5f836c10ed3d

test-removeemptydirs: adjust to Windows behavior for the `histedit` case Windows stay in the "same" directory and the warning message is not applicable. This make `tests/test-removeemptydirs.t` pass on Windows. Differential Revision: https://phab.mercurial-scm.org/D11055
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 10 Jul 2021 02:25:06 +0200
parents f2846abd9e21
children 1941064d3713
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38493
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
1 Tests for experimental.removeemptydirs
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
2
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
3 $ NO_RM=--config=experimental.removeemptydirs=0
47579
f2846abd9e21 test-removeemptydirs: clarify the state of things in the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47435
diff changeset
4 $ DO_RM=--config=experimental.removeemptydirs=1
38493
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
5 $ isdir() { if [ -d $1 ]; then echo yes; else echo no; fi }
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
6 $ isfile() { if [ -f $1 ]; then echo yes; else echo no; fi }
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
7
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
8 `hg rm` of the last file in a directory:
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
9 $ hg init hgrm
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
10 $ cd hgrm
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
11 $ mkdir somedir
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
12 $ echo hi > somedir/foo
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
13 $ hg ci -qAm foo
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
14 $ isdir somedir
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
15 yes
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
16 $ hg rm somedir/foo
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
17 $ isdir somedir
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
18 no
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
19 $ hg revert -qa
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
20 $ isdir somedir
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
21 yes
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
22 $ hg $NO_RM rm somedir/foo
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
23 $ isdir somedir
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
24 yes
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
25 $ ls somedir
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
26 $ cd $TESTTMP
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
27
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
28 `hg mv` of the last file in a directory:
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
29 $ hg init hgmv
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
30 $ cd hgmv
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
31 $ mkdir somedir
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
32 $ mkdir destdir
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
33 $ echo hi > somedir/foo
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
34 $ hg ci -qAm foo
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
35 $ isdir somedir
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
36 yes
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
37 $ hg mv somedir/foo destdir/foo
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
38 $ isdir somedir
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
39 no
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
40 $ hg revert -qa
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
41 (revert doesn't get rid of destdir/foo?)
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
42 $ rm destdir/foo
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
43 $ isdir somedir
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
44 yes
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
45 $ hg $NO_RM mv somedir/foo destdir/foo
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
46 $ isdir somedir
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
47 yes
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
48 $ ls somedir
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
49 $ cd $TESTTMP
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
50
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
51 Updating to a commit that doesn't have the directory:
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
52 $ hg init hgupdate
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
53 $ cd hgupdate
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
54 $ echo hi > r0
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
55 $ hg ci -qAm r0
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
56 $ mkdir somedir
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
57 $ echo hi > somedir/foo
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
58 $ hg ci -qAm r1
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
59 $ isdir somedir
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
60 yes
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
61 $ hg co -q -r ".^"
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
62 $ isdir somedir
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
63 no
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
64 $ hg co -q tip
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
65 $ isdir somedir
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
66 yes
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
67 $ hg $NO_RM co -q -r ".^"
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
68 $ isdir somedir
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
69 yes
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
70 $ ls somedir
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
71 $ cd $TESTTMP
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
72
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
73 Rebasing across a commit that doesn't have the directory, from inside the
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
74 directory:
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
75 $ hg init hgrebase
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
76 $ cd hgrebase
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
77 $ echo hi > r0
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
78 $ hg ci -qAm r0
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
79 $ mkdir somedir
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
80 $ echo hi > somedir/foo
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
81 $ hg ci -qAm first_rebase_source
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
82 $ hg $NO_RM co -q -r ".^"
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
83 $ echo hi > somedir/bar
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
84 $ hg ci -qAm first_rebase_dest
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
85 $ hg $NO_RM co -q -r ".^"
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
86 $ echo hi > somedir/baz
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
87 $ hg ci -qAm second_rebase_dest
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
88 $ hg co -qr 'desc(first_rebase_source)'
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
89 $ cd $TESTTMP/hgrebase/somedir
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
90 $ hg --config extensions.rebase= rebase -qr . -d 'desc(first_rebase_dest)'
39462
e5449ff273d6 tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 38662
diff changeset
91 current directory was removed (rmcwd !)
e5449ff273d6 tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 38662
diff changeset
92 (consider changing to repo root: $TESTTMP/hgrebase) (rmcwd !)
38493
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
93 $ cd $TESTTMP/hgrebase/somedir
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
94 (The current node is the rebased first_rebase_source on top of
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
95 first_rebase_dest)
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
96 This should not output anything about current directory being removed:
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
97 $ hg $NO_RM --config extensions.rebase= rebase -qr . -d 'desc(second_rebase_dest)'
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
98 $ cd $TESTTMP
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
99
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
100 Histediting across a commit that doesn't have the directory, from inside the
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
101 directory (reordering nodes):
47579
f2846abd9e21 test-removeemptydirs: clarify the state of things in the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47435
diff changeset
102
f2846abd9e21 test-removeemptydirs: clarify the state of things in the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47435
diff changeset
103 A directory with the right pass exists at the end of the run, but it is a
f2846abd9e21 test-removeemptydirs: clarify the state of things in the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47435
diff changeset
104 different directory than the current one.
f2846abd9e21 test-removeemptydirs: clarify the state of things in the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47435
diff changeset
105
47580
5f836c10ed3d test-removeemptydirs: adjust to Windows behavior for the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47579
diff changeset
106 Windows is not affected
5f836c10ed3d test-removeemptydirs: adjust to Windows behavior for the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47579
diff changeset
107
38493
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
108 $ hg init hghistedit
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
109 $ cd hghistedit
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
110 $ echo hi > r0
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
111 $ hg ci -qAm r0
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
112 $ echo hi > r1
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
113 $ hg ci -qAm r1
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
114 $ echo hi > r2
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
115 $ hg ci -qAm r2
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
116 $ mkdir somedir
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
117 $ echo hi > somedir/foo
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
118 $ hg ci -qAm migrating_revision
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
119 $ cat > histedit_commands <<EOF
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
120 > pick 89079fab8aee 0 r0
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
121 > pick e6d271df3142 1 r1
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
122 > pick 89e25aa83f0f 3 migrating_revision
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
123 > pick b550aa12d873 2 r2
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
124 > EOF
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
125 $ cd $TESTTMP/hghistedit/somedir
47579
f2846abd9e21 test-removeemptydirs: clarify the state of things in the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47435
diff changeset
126 $ hg $DO_RM --config extensions.histedit= histedit -q --commands ../histedit_commands
47580
5f836c10ed3d test-removeemptydirs: adjust to Windows behavior for the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47579
diff changeset
127 current directory was removed (no-windows !)
5f836c10ed3d test-removeemptydirs: adjust to Windows behavior for the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47579
diff changeset
128 (consider changing to repo root: $TESTTMP/hghistedit) (no-windows !)
47579
f2846abd9e21 test-removeemptydirs: clarify the state of things in the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47435
diff changeset
129 $ ls -1 $TESTTMP/hghistedit/
f2846abd9e21 test-removeemptydirs: clarify the state of things in the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47435
diff changeset
130 histedit_commands
f2846abd9e21 test-removeemptydirs: clarify the state of things in the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47435
diff changeset
131 r0
f2846abd9e21 test-removeemptydirs: clarify the state of things in the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47435
diff changeset
132 r1
f2846abd9e21 test-removeemptydirs: clarify the state of things in the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47435
diff changeset
133 r2
f2846abd9e21 test-removeemptydirs: clarify the state of things in the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47435
diff changeset
134 somedir
f2846abd9e21 test-removeemptydirs: clarify the state of things in the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47435
diff changeset
135 $ pwd
f2846abd9e21 test-removeemptydirs: clarify the state of things in the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47435
diff changeset
136 $TESTTMP/hghistedit/somedir
f2846abd9e21 test-removeemptydirs: clarify the state of things in the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47435
diff changeset
137 $ ls -1 $TESTTMP/hghistedit/somedir
f2846abd9e21 test-removeemptydirs: clarify the state of things in the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47435
diff changeset
138 foo
f2846abd9e21 test-removeemptydirs: clarify the state of things in the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47435
diff changeset
139 $ ls -1
47580
5f836c10ed3d test-removeemptydirs: adjust to Windows behavior for the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47579
diff changeset
140 foo (windows !)
47579
f2846abd9e21 test-removeemptydirs: clarify the state of things in the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47435
diff changeset
141
f2846abd9e21 test-removeemptydirs: clarify the state of things in the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47435
diff changeset
142 Get out of the doomed directory
f2846abd9e21 test-removeemptydirs: clarify the state of things in the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47435
diff changeset
143
f2846abd9e21 test-removeemptydirs: clarify the state of things in the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47435
diff changeset
144 $ cd $TESTTMP/hghistedit
f2846abd9e21 test-removeemptydirs: clarify the state of things in the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47435
diff changeset
145 $ hg files --rev . | grep somedir/
f2846abd9e21 test-removeemptydirs: clarify the state of things in the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47435
diff changeset
146 somedir/foo
38493
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
147
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
148
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
149 $ cat > histedit_commands <<EOF
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
150 > pick 89079fab8aee 0 r0
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
151 > pick 7c7a22c6009f 3 migrating_revision
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
152 > pick e6d271df3142 1 r1
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
153 > pick 40a53c2d4276 2 r2
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
154 > EOF
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
155 $ cd $TESTTMP/hghistedit/somedir
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
156 $ hg $NO_RM --config extensions.histedit= histedit -q --commands ../histedit_commands
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
157 Regardless of system, we should always get a 'yes' here.
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
158 $ isfile foo
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
159 yes
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
160 $ cd $TESTTMP
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
161
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
162 This is essentially the exact test from issue5826, just cleaned up a little:
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
163
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
164 $ hg init issue5826_withrm
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
165 $ cd issue5826_withrm
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
166
38662
ad2aa4e85047 removeemptydirs: add test for `hg split` inside a disappearing directory
Kyle Lippincott <spectral@google.com>
parents: 38493
diff changeset
167 Let's only turn this on for this repo so that we don't contaminate later tests.
ad2aa4e85047 removeemptydirs: add test for `hg split` inside a disappearing directory
Kyle Lippincott <spectral@google.com>
parents: 38493
diff changeset
168 $ cat >> .hg/hgrc <<EOF
38493
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
169 > [extensions]
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
170 > histedit =
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
171 > EOF
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
172 Commit three revisions that each create a directory:
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
173
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
174 $ mkdir foo
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
175 $ touch foo/bar
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
176 $ hg commit -qAm "add foo"
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
177
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
178 $ mkdir bar
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
179 $ touch bar/bar
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
180 $ hg commit -qAm "add bar"
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
181
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
182 $ mkdir baz
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
183 $ touch baz/bar
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
184 $ hg commit -qAm "add baz"
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
185
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
186 Enter the first directory:
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
187
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
188 $ cd foo
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
189
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
190 Histedit doing 'pick, pick, fold':
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
191
39462
e5449ff273d6 tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 38662
diff changeset
192 #if rmcwd
e5449ff273d6 tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 38662
diff changeset
193
e5449ff273d6 tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 38662
diff changeset
194 $ hg histedit --commands - <<EOF
38493
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
195 > pick 6274c77c93c3 1 add bar
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
196 > pick ff70a87b588f 0 add foo
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
197 > fold 9992bb0ac0db 2 add baz
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
198 > EOF
47435
e9fbf8fd5f33 histedit: don't swallow errors that happen when updating the working copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 41966
diff changeset
199 current directory was removed
e9fbf8fd5f33 histedit: don't swallow errors that happen when updating the working copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 41966
diff changeset
200 (consider changing to repo root: $TESTTMP/issue5826_withrm)
38493
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
201 abort: $ENOENT$
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
202 [255]
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
203
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
204 Go back to the repo root after losing it as part of that operation:
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
205 $ cd $TESTTMP/issue5826_withrm
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
206
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
207 Note the lack of a non-zero exit code from this function - it exits
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
208 successfully, but doesn't really do anything.
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
209 $ hg histedit --continue
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
210 9992bb0ac0db: cannot fold - working copy is not a descendant of previous commit 5c806432464a
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
211 saved backup bundle to $TESTTMP/issue5826_withrm/.hg/strip-backup/ff70a87b588f-e94f9789-histedit.hg
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
212
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
213 $ hg log -T '{rev}:{node|short} {desc}\n'
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
214 2:94e3f9fae1d6 fold-temp-revision 9992bb0ac0db
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
215 1:5c806432464a add foo
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
216 0:d17db4b0303a add bar
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
217
39462
e5449ff273d6 tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 38662
diff changeset
218 #else
e5449ff273d6 tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 38662
diff changeset
219
e5449ff273d6 tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 38662
diff changeset
220 $ cd $TESTTMP/issue5826_withrm
e5449ff273d6 tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 38662
diff changeset
221
e5449ff273d6 tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 38662
diff changeset
222 $ hg histedit --commands - <<EOF
e5449ff273d6 tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 38662
diff changeset
223 > pick 6274c77c93c3 1 add bar
e5449ff273d6 tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 38662
diff changeset
224 > pick ff70a87b588f 0 add foo
e5449ff273d6 tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 38662
diff changeset
225 > fold 9992bb0ac0db 2 add baz
e5449ff273d6 tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 38662
diff changeset
226 > EOF
e5449ff273d6 tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 38662
diff changeset
227 saved backup bundle to $TESTTMP/issue5826_withrm/.hg/strip-backup/5c806432464a-cd4c8d86-histedit.hg
e5449ff273d6 tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 38662
diff changeset
228
e5449ff273d6 tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 38662
diff changeset
229 $ hg log -T '{rev}:{node|short} {desc}\n'
e5449ff273d6 tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 38662
diff changeset
230 1:b9eddaa97cbc add foo
e5449ff273d6 tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 38662
diff changeset
231 ***
e5449ff273d6 tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 38662
diff changeset
232 add baz
e5449ff273d6 tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 38662
diff changeset
233 0:d17db4b0303a add bar
e5449ff273d6 tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 38662
diff changeset
234
e5449ff273d6 tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 38662
diff changeset
235 #endif
e5449ff273d6 tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 38662
diff changeset
236
38493
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
237 Now test that again with experimental.removeemptydirs=false:
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
238 $ hg init issue5826_norm
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
239 $ cd issue5826_norm
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
240
38662
ad2aa4e85047 removeemptydirs: add test for `hg split` inside a disappearing directory
Kyle Lippincott <spectral@google.com>
parents: 38493
diff changeset
241 Let's only turn this on for this repo so that we don't contaminate later tests.
ad2aa4e85047 removeemptydirs: add test for `hg split` inside a disappearing directory
Kyle Lippincott <spectral@google.com>
parents: 38493
diff changeset
242 $ cat >> .hg/hgrc <<EOF
38493
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
243 > [extensions]
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
244 > histedit =
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
245 > [experimental]
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
246 > removeemptydirs = false
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
247 > EOF
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
248 Commit three revisions that each create a directory:
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
249
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
250 $ mkdir foo
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
251 $ touch foo/bar
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
252 $ hg commit -qAm "add foo"
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
253
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
254 $ mkdir bar
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
255 $ touch bar/bar
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
256 $ hg commit -qAm "add bar"
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
257
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
258 $ mkdir baz
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
259 $ touch baz/bar
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
260 $ hg commit -qAm "add baz"
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
261
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
262 Enter the first directory:
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
263
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
264 $ cd foo
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
265
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
266 Histedit doing 'pick, pick, fold':
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
267
39462
e5449ff273d6 tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 38662
diff changeset
268 $ hg histedit --commands - <<EOF
38493
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
269 > pick 6274c77c93c3 1 add bar
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
270 > pick ff70a87b588f 0 add foo
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
271 > fold 9992bb0ac0db 2 add baz
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
272 > EOF
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
273 saved backup bundle to $TESTTMP/issue5826_withrm/issue5826_norm/.hg/strip-backup/5c806432464a-cd4c8d86-histedit.hg
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
274
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
275 Note the lack of a 'cd' being necessary here, and we don't need to 'histedit
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
276 --continue'
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
277
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
278 $ hg log -T '{rev}:{node|short} {desc}\n'
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
279 1:b9eddaa97cbc add foo
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
280 ***
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
281 add baz
da2a7d8354b2 unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff changeset
282 0:d17db4b0303a add bar
38662
ad2aa4e85047 removeemptydirs: add test for `hg split` inside a disappearing directory
Kyle Lippincott <spectral@google.com>
parents: 38493
diff changeset
283
ad2aa4e85047 removeemptydirs: add test for `hg split` inside a disappearing directory
Kyle Lippincott <spectral@google.com>
parents: 38493
diff changeset
284 $ cd $TESTTMP