Mercurial > hg
annotate tests/test-removeemptydirs.t @ 49593:e11760daee12 stable
tests: move some lines inside #if windows-#else block test-removeemptydirs.t
This is done to make it's clear that windows is not affected by this test case,
IOW windows and non-windows platforms are now tested separately, because their
results are very different.
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Mon, 14 Nov 2022 19:38:57 +0400 |
parents | 12efb17faee2 |
children | 88a8de821b5e |
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 |
47980
1941064d3713
tests: make removeemptydirs more portable
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47580
diff
changeset
|
3 $ cat >> pwd.py << EOF |
1941064d3713
tests: make removeemptydirs more portable
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47580
diff
changeset
|
4 > import os |
1941064d3713
tests: make removeemptydirs more portable
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47580
diff
changeset
|
5 > try: |
1941064d3713
tests: make removeemptydirs more portable
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47580
diff
changeset
|
6 > print(os.getcwd()) |
1941064d3713
tests: make removeemptydirs more portable
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47580
diff
changeset
|
7 > except OSError: |
1941064d3713
tests: make removeemptydirs more portable
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47580
diff
changeset
|
8 > print("<directory is no longer accessible>") |
1941064d3713
tests: make removeemptydirs more portable
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47580
diff
changeset
|
9 > EOF |
1941064d3713
tests: make removeemptydirs more portable
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47580
diff
changeset
|
10 |
38493
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
11 $ 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
|
12 $ DO_RM=--config=experimental.removeemptydirs=1 |
38493
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
13 $ 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
|
14 $ 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
|
15 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
16 `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
|
17 $ hg init hgrm |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
18 $ cd hgrm |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
19 $ mkdir somedir |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
20 $ echo hi > somedir/foo |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
21 $ hg ci -qAm foo |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
22 $ isdir somedir |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
23 yes |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
24 $ hg rm somedir/foo |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
25 $ isdir somedir |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
26 no |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
27 $ hg revert -qa |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
28 $ isdir somedir |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
29 yes |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
30 $ hg $NO_RM rm somedir/foo |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
31 $ isdir somedir |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
32 yes |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
33 $ ls somedir |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
34 $ cd $TESTTMP |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
35 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
36 `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
|
37 $ hg init hgmv |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
38 $ cd hgmv |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
39 $ mkdir somedir |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
40 $ mkdir destdir |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
41 $ echo hi > somedir/foo |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
42 $ hg ci -qAm 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 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 no |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
48 $ hg revert -qa |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
49 (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
|
50 $ rm destdir/foo |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
51 $ isdir somedir |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
52 yes |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
53 $ 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
|
54 $ isdir somedir |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
55 yes |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
56 $ ls somedir |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
57 $ cd $TESTTMP |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
58 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
59 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
|
60 $ hg init hgupdate |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
61 $ cd hgupdate |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
62 $ echo hi > r0 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
63 $ hg ci -qAm r0 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
64 $ mkdir somedir |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
65 $ echo hi > somedir/foo |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
66 $ hg ci -qAm r1 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
67 $ isdir somedir |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
68 yes |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
69 $ hg co -q -r ".^" |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
70 $ isdir somedir |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
71 no |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
72 $ hg co -q tip |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
73 $ isdir somedir |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
74 yes |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
75 $ hg $NO_RM co -q -r ".^" |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
76 $ isdir somedir |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
77 yes |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
78 $ ls somedir |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
79 $ cd $TESTTMP |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
80 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
81 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
|
82 directory: |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
83 $ hg init hgrebase |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
84 $ cd hgrebase |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
85 $ echo hi > r0 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
86 $ hg ci -qAm r0 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
87 $ mkdir somedir |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
88 $ echo hi > somedir/foo |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
89 $ hg ci -qAm first_rebase_source |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
90 $ hg $NO_RM co -q -r ".^" |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
91 $ echo hi > somedir/bar |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
92 $ hg ci -qAm first_rebase_dest |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
93 $ hg $NO_RM co -q -r ".^" |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
94 $ echo hi > somedir/baz |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
95 $ hg ci -qAm second_rebase_dest |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
96 $ hg co -qr 'desc(first_rebase_source)' |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
97 $ cd $TESTTMP/hgrebase/somedir |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
98 $ 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
|
99 current directory was removed (rmcwd !) |
e5449ff273d6
tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
38662
diff
changeset
|
100 (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
|
101 $ cd $TESTTMP/hgrebase/somedir |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
102 (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
|
103 first_rebase_dest) |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
104 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
|
105 $ 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
|
106 $ cd $TESTTMP |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
107 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
108 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
|
109 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
|
110 |
f2846abd9e21
test-removeemptydirs: clarify the state of things in the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47435
diff
changeset
|
111 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
|
112 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
|
113 |
47580
5f836c10ed3d
test-removeemptydirs: adjust to Windows behavior for the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47579
diff
changeset
|
114 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
|
115 |
38493
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
116 $ hg init hghistedit |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
117 $ cd hghistedit |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
118 $ echo hi > r0 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
119 $ hg ci -qAm r0 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
120 $ echo hi > r1 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
121 $ hg ci -qAm r1 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
122 $ echo hi > r2 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
123 $ hg ci -qAm r2 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
124 $ mkdir somedir |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
125 $ echo hi > somedir/foo |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
126 $ hg ci -qAm migrating_revision |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
127 $ cat > histedit_commands <<EOF |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
128 > pick 89079fab8aee 0 r0 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
129 > pick e6d271df3142 1 r1 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
130 > pick 89e25aa83f0f 3 migrating_revision |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
131 > pick b550aa12d873 2 r2 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
132 > EOF |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
133 $ 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
|
134 $ 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
|
135 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
|
136 (consider changing to repo root: $TESTTMP/hghistedit) (no-windows !) |
49592
12efb17faee2
tests: use ls -A instead of ls -1 in test-removeemptydirs.t
Anton Shestakov <av6@dwimlabs.net>
parents:
47980
diff
changeset
|
137 $ ls -A $TESTTMP/hghistedit/ |
12efb17faee2
tests: use ls -A instead of ls -1 in test-removeemptydirs.t
Anton Shestakov <av6@dwimlabs.net>
parents:
47980
diff
changeset
|
138 .hg |
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
|
139 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
|
140 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
|
141 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
|
142 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
|
143 somedir |
47980
1941064d3713
tests: make removeemptydirs more portable
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47580
diff
changeset
|
144 #if windows |
1941064d3713
tests: make removeemptydirs more portable
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47580
diff
changeset
|
145 $ "$PYTHON" "$TESTTMP/pwd.py" |
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
|
146 $TESTTMP/hghistedit/somedir |
49593
e11760daee12
tests: move some lines inside #if windows-#else block test-removeemptydirs.t
Anton Shestakov <av6@dwimlabs.net>
parents:
49592
diff
changeset
|
147 $ ls -A $TESTTMP/hghistedit/somedir |
e11760daee12
tests: move some lines inside #if windows-#else block test-removeemptydirs.t
Anton Shestakov <av6@dwimlabs.net>
parents:
49592
diff
changeset
|
148 foo |
e11760daee12
tests: move some lines inside #if windows-#else block test-removeemptydirs.t
Anton Shestakov <av6@dwimlabs.net>
parents:
49592
diff
changeset
|
149 $ ls -A |
e11760daee12
tests: move some lines inside #if windows-#else block test-removeemptydirs.t
Anton Shestakov <av6@dwimlabs.net>
parents:
49592
diff
changeset
|
150 foo |
47980
1941064d3713
tests: make removeemptydirs more portable
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47580
diff
changeset
|
151 #else |
1941064d3713
tests: make removeemptydirs more portable
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47580
diff
changeset
|
152 $ echo ${PWD} # no-pwd-check |
1941064d3713
tests: make removeemptydirs more portable
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47580
diff
changeset
|
153 $TESTTMP/hghistedit/somedir |
1941064d3713
tests: make removeemptydirs more portable
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47580
diff
changeset
|
154 $ "$PYTHON" "$TESTTMP/pwd.py" |
1941064d3713
tests: make removeemptydirs more portable
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47580
diff
changeset
|
155 <directory is no longer accessible> |
49592
12efb17faee2
tests: use ls -A instead of ls -1 in test-removeemptydirs.t
Anton Shestakov <av6@dwimlabs.net>
parents:
47980
diff
changeset
|
156 $ ls -A $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
|
157 foo |
49592
12efb17faee2
tests: use ls -A instead of ls -1 in test-removeemptydirs.t
Anton Shestakov <av6@dwimlabs.net>
parents:
47980
diff
changeset
|
158 $ ls -A |
49593
e11760daee12
tests: move some lines inside #if windows-#else block test-removeemptydirs.t
Anton Shestakov <av6@dwimlabs.net>
parents:
49592
diff
changeset
|
159 #endif |
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
|
160 |
f2846abd9e21
test-removeemptydirs: clarify the state of things in the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47435
diff
changeset
|
161 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
|
162 |
f2846abd9e21
test-removeemptydirs: clarify the state of things in the `histedit` case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47435
diff
changeset
|
163 $ cd $TESTTMP/hghistedit |
47980
1941064d3713
tests: make removeemptydirs more portable
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47580
diff
changeset
|
164 chdir: error retrieving current directory: getcwd: cannot access parent directories: $ENOENT$ (?) |
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
|
165 $ 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
|
166 somedir/foo |
38493
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
167 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
168 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
169 $ cat > histedit_commands <<EOF |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
170 > pick 89079fab8aee 0 r0 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
171 > pick 7c7a22c6009f 3 migrating_revision |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
172 > pick e6d271df3142 1 r1 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
173 > pick 40a53c2d4276 2 r2 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
174 > EOF |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
175 $ cd $TESTTMP/hghistedit/somedir |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
176 $ 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
|
177 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
|
178 $ isfile foo |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
179 yes |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
180 $ cd $TESTTMP |
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 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
|
183 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
184 $ hg init issue5826_withrm |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
185 $ cd issue5826_withrm |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
186 |
38662
ad2aa4e85047
removeemptydirs: add test for `hg split` inside a disappearing directory
Kyle Lippincott <spectral@google.com>
parents:
38493
diff
changeset
|
187 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
|
188 $ cat >> .hg/hgrc <<EOF |
38493
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
189 > [extensions] |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
190 > histedit = |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
191 > EOF |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
192 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
|
193 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
194 $ mkdir foo |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
195 $ touch foo/bar |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
196 $ hg commit -qAm "add foo" |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
197 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
198 $ mkdir bar |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
199 $ touch bar/bar |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
200 $ hg commit -qAm "add bar" |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
201 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
202 $ mkdir baz |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
203 $ touch baz/bar |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
204 $ hg commit -qAm "add baz" |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
205 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
206 Enter the first directory: |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
207 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
208 $ cd foo |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
209 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
210 Histedit doing 'pick, pick, fold': |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
211 |
39462
e5449ff273d6
tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
38662
diff
changeset
|
212 #if rmcwd |
e5449ff273d6
tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
38662
diff
changeset
|
213 |
e5449ff273d6
tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
38662
diff
changeset
|
214 $ hg histedit --commands - <<EOF |
38493
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
215 > pick 6274c77c93c3 1 add bar |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
216 > pick ff70a87b588f 0 add foo |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
217 > fold 9992bb0ac0db 2 add baz |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
218 > 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
|
219 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
|
220 (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
|
221 abort: $ENOENT$ |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
222 [255] |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
223 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
224 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
|
225 $ cd $TESTTMP/issue5826_withrm |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
226 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
227 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
|
228 successfully, but doesn't really do anything. |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
229 $ hg histedit --continue |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
230 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
|
231 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
|
232 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
233 $ 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
|
234 2:94e3f9fae1d6 fold-temp-revision 9992bb0ac0db |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
235 1:5c806432464a add foo |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
236 0:d17db4b0303a add bar |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
237 |
39462
e5449ff273d6
tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
38662
diff
changeset
|
238 #else |
e5449ff273d6
tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
38662
diff
changeset
|
239 |
e5449ff273d6
tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
38662
diff
changeset
|
240 $ cd $TESTTMP/issue5826_withrm |
e5449ff273d6
tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
38662
diff
changeset
|
241 |
e5449ff273d6
tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
38662
diff
changeset
|
242 $ hg histedit --commands - <<EOF |
e5449ff273d6
tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
38662
diff
changeset
|
243 > pick 6274c77c93c3 1 add bar |
e5449ff273d6
tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
38662
diff
changeset
|
244 > pick ff70a87b588f 0 add foo |
e5449ff273d6
tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
38662
diff
changeset
|
245 > fold 9992bb0ac0db 2 add baz |
e5449ff273d6
tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
38662
diff
changeset
|
246 > EOF |
e5449ff273d6
tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
38662
diff
changeset
|
247 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
|
248 |
e5449ff273d6
tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
38662
diff
changeset
|
249 $ 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
|
250 1:b9eddaa97cbc add foo |
e5449ff273d6
tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
38662
diff
changeset
|
251 *** |
e5449ff273d6
tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
38662
diff
changeset
|
252 add baz |
e5449ff273d6
tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
38662
diff
changeset
|
253 0:d17db4b0303a add bar |
e5449ff273d6
tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
38662
diff
changeset
|
254 |
e5449ff273d6
tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
38662
diff
changeset
|
255 #endif |
e5449ff273d6
tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
38662
diff
changeset
|
256 |
38493
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
257 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
|
258 $ hg init issue5826_norm |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
259 $ cd issue5826_norm |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
260 |
38662
ad2aa4e85047
removeemptydirs: add test for `hg split` inside a disappearing directory
Kyle Lippincott <spectral@google.com>
parents:
38493
diff
changeset
|
261 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
|
262 $ cat >> .hg/hgrc <<EOF |
38493
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
263 > [extensions] |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
264 > histedit = |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
265 > [experimental] |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
266 > removeemptydirs = false |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
267 > EOF |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
268 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
|
269 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
270 $ mkdir foo |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
271 $ touch foo/bar |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
272 $ hg commit -qAm "add foo" |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
273 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
274 $ mkdir bar |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
275 $ touch bar/bar |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
276 $ hg commit -qAm "add bar" |
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 $ mkdir baz |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
279 $ touch baz/bar |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
280 $ hg commit -qAm "add baz" |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
281 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
282 Enter the first directory: |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
283 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
284 $ cd foo |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
285 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
286 Histedit doing 'pick, pick, fold': |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
287 |
39462
e5449ff273d6
tests: stabilize test-removeemptydirs.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
38662
diff
changeset
|
288 $ hg histedit --commands - <<EOF |
38493
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
289 > pick 6274c77c93c3 1 add bar |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
290 > pick ff70a87b588f 0 add foo |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
291 > fold 9992bb0ac0db 2 add baz |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
292 > EOF |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
293 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
|
294 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
295 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
|
296 --continue' |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
297 |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
298 $ 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
|
299 1:b9eddaa97cbc add foo |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
300 *** |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
301 add baz |
da2a7d8354b2
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
Kyle Lippincott <spectral@google.com>
parents:
diff
changeset
|
302 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
|
303 |
ad2aa4e85047
removeemptydirs: add test for `hg split` inside a disappearing directory
Kyle Lippincott <spectral@google.com>
parents:
38493
diff
changeset
|
304 $ cd $TESTTMP |