##// END OF EJS Templates
histedit tests: fix check-code problems
Augie Fackler -
r17065:949e241b default
parent child Browse files
Show More
@@ -1,190 +1,187 b''
1 $ . "$TESTDIR/histedit-helpers.sh"
1 $ . "$TESTDIR/histedit-helpers.sh"
2
2
3 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
4 > [extensions]
5 > graphlog=
5 > graphlog=
6 > histedit=
6 > histedit=
7 > EOF
7 > EOF
8
8
9 $ hg init r
9 $ hg init r
10 $ cd r
10 $ cd r
11 See if bookmarks are in core. If not, then we don't support bookmark
11
12 motion on this version of hg.
13 $ hg bookmarks || exit 80
14 no bookmarks set
15 $ for x in a b c d e f ; do
12 $ for x in a b c d e f ; do
16 > echo $x > $x
13 > echo $x > $x
17 > hg add $x
14 > hg add $x
18 > hg ci -m $x
15 > hg ci -m $x
19 > done
16 > done
20
17
21 $ hg book -r 1 will-move-backwards
18 $ hg book -r 1 will-move-backwards
22 $ hg book -r 2 two
19 $ hg book -r 2 two
23 $ hg book -r 2 also-two
20 $ hg book -r 2 also-two
24 $ hg book -r 3 three
21 $ hg book -r 3 three
25 $ hg book -r 4 four
22 $ hg book -r 4 four
26 $ hg book -r tip five
23 $ hg book -r tip five
27 $ hg log --graph
24 $ hg log --graph
28 @ changeset: 5:652413bf663e
25 @ changeset: 5:652413bf663e
29 | bookmark: five
26 | bookmark: five
30 | tag: tip
27 | tag: tip
31 | user: test
28 | user: test
32 | date: Thu Jan 01 00:00:00 1970 +0000
29 | date: Thu Jan 01 00:00:00 1970 +0000
33 | summary: f
30 | summary: f
34 |
31 |
35 o changeset: 4:e860deea161a
32 o changeset: 4:e860deea161a
36 | bookmark: four
33 | bookmark: four
37 | user: test
34 | user: test
38 | date: Thu Jan 01 00:00:00 1970 +0000
35 | date: Thu Jan 01 00:00:00 1970 +0000
39 | summary: e
36 | summary: e
40 |
37 |
41 o changeset: 3:055a42cdd887
38 o changeset: 3:055a42cdd887
42 | bookmark: three
39 | bookmark: three
43 | user: test
40 | user: test
44 | date: Thu Jan 01 00:00:00 1970 +0000
41 | date: Thu Jan 01 00:00:00 1970 +0000
45 | summary: d
42 | summary: d
46 |
43 |
47 o changeset: 2:177f92b77385
44 o changeset: 2:177f92b77385
48 | bookmark: also-two
45 | bookmark: also-two
49 | bookmark: two
46 | bookmark: two
50 | user: test
47 | user: test
51 | date: Thu Jan 01 00:00:00 1970 +0000
48 | date: Thu Jan 01 00:00:00 1970 +0000
52 | summary: c
49 | summary: c
53 |
50 |
54 o changeset: 1:d2ae7f538514
51 o changeset: 1:d2ae7f538514
55 | bookmark: will-move-backwards
52 | bookmark: will-move-backwards
56 | user: test
53 | user: test
57 | date: Thu Jan 01 00:00:00 1970 +0000
54 | date: Thu Jan 01 00:00:00 1970 +0000
58 | summary: b
55 | summary: b
59 |
56 |
60 o changeset: 0:cb9a9f314b8b
57 o changeset: 0:cb9a9f314b8b
61 user: test
58 user: test
62 date: Thu Jan 01 00:00:00 1970 +0000
59 date: Thu Jan 01 00:00:00 1970 +0000
63 summary: a
60 summary: a
64
61
65 $ HGEDITOR=cat hg histedit 1
62 $ HGEDITOR=cat hg histedit 1
66 pick d2ae7f538514 1 b
63 pick d2ae7f538514 1 b
67 pick 177f92b77385 2 c
64 pick 177f92b77385 2 c
68 pick 055a42cdd887 3 d
65 pick 055a42cdd887 3 d
69 pick e860deea161a 4 e
66 pick e860deea161a 4 e
70 pick 652413bf663e 5 f
67 pick 652413bf663e 5 f
71
68
72 # Edit history between d2ae7f538514 and 652413bf663e
69 # Edit history between d2ae7f538514 and 652413bf663e
73 #
70 #
74 # Commands:
71 # Commands:
75 # p, pick = use commit
72 # p, pick = use commit
76 # e, edit = use commit, but stop for amending
73 # e, edit = use commit, but stop for amending
77 # f, fold = use commit, but fold into previous commit (combines N and N-1)
74 # f, fold = use commit, but fold into previous commit (combines N and N-1)
78 # d, drop = remove commit from history
75 # d, drop = remove commit from history
79 # m, mess = edit message without changing commit content
76 # m, mess = edit message without changing commit content
80 #
77 #
81 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
78 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
82 $ cat >> commands.txt <<EOF
79 $ cat >> commands.txt <<EOF
83 > pick 177f92b77385 2 c
80 > pick 177f92b77385 2 c
84 > drop d2ae7f538514 1 b
81 > drop d2ae7f538514 1 b
85 > pick 055a42cdd887 3 d
82 > pick 055a42cdd887 3 d
86 > fold e860deea161a 4 e
83 > fold e860deea161a 4 e
87 > pick 652413bf663e 5 f
84 > pick 652413bf663e 5 f
88 > EOF
85 > EOF
89 $ hg histedit 1 --commands commands.txt --verbose | grep histedit
86 $ hg histedit 1 --commands commands.txt --verbose | grep histedit
90 histedit: Should update metadata for the following changes:
87 histedit: Should update metadata for the following changes:
91 histedit: 055a42cdd887 to ae467701c500
88 histedit: 055a42cdd887 to ae467701c500
92 histedit: moving bookmarks three
89 histedit: moving bookmarks three
93 histedit: 652413bf663e to 0efacef7cb48
90 histedit: 652413bf663e to 0efacef7cb48
94 histedit: moving bookmarks five
91 histedit: moving bookmarks five
95 histedit: d2ae7f538514 to cb9a9f314b8b
92 histedit: d2ae7f538514 to cb9a9f314b8b
96 histedit: moving bookmarks will-move-backwards
93 histedit: moving bookmarks will-move-backwards
97 histedit: e860deea161a to ae467701c500
94 histedit: e860deea161a to ae467701c500
98 histedit: moving bookmarks four
95 histedit: moving bookmarks four
99 histedit: 177f92b77385 to d36c0562f908
96 histedit: 177f92b77385 to d36c0562f908
100 histedit: moving bookmarks also-two, two
97 histedit: moving bookmarks also-two, two
101 saved backup bundle to $TESTTMP/r/.hg/strip-backup/d2ae7f538514-backup.hg
98 saved backup bundle to $TESTTMP/r/.hg/strip-backup/d2ae7f538514-backup.hg
102 saved backup bundle to $TESTTMP/r/.hg/strip-backup/34a9919932c1-backup.hg
99 saved backup bundle to $TESTTMP/r/.hg/strip-backup/34a9919932c1-backup.hg
103 $ hg log --graph
100 $ hg log --graph
104 @ changeset: 3:0efacef7cb48
101 @ changeset: 3:0efacef7cb48
105 | bookmark: five
102 | bookmark: five
106 | tag: tip
103 | tag: tip
107 | user: test
104 | user: test
108 | date: Thu Jan 01 00:00:00 1970 +0000
105 | date: Thu Jan 01 00:00:00 1970 +0000
109 | summary: f
106 | summary: f
110 |
107 |
111 o changeset: 2:ae467701c500
108 o changeset: 2:ae467701c500
112 | bookmark: four
109 | bookmark: four
113 | bookmark: three
110 | bookmark: three
114 | user: test
111 | user: test
115 | date: Thu Jan 01 00:00:00 1970 +0000
112 | date: Thu Jan 01 00:00:00 1970 +0000
116 | summary: d
113 | summary: d
117 |
114 |
118 o changeset: 1:d36c0562f908
115 o changeset: 1:d36c0562f908
119 | bookmark: also-two
116 | bookmark: also-two
120 | bookmark: two
117 | bookmark: two
121 | user: test
118 | user: test
122 | date: Thu Jan 01 00:00:00 1970 +0000
119 | date: Thu Jan 01 00:00:00 1970 +0000
123 | summary: c
120 | summary: c
124 |
121 |
125 o changeset: 0:cb9a9f314b8b
122 o changeset: 0:cb9a9f314b8b
126 bookmark: will-move-backwards
123 bookmark: will-move-backwards
127 user: test
124 user: test
128 date: Thu Jan 01 00:00:00 1970 +0000
125 date: Thu Jan 01 00:00:00 1970 +0000
129 summary: a
126 summary: a
130
127
131 $ HGEDITOR=cat hg histedit 1
128 $ HGEDITOR=cat hg histedit 1
132 pick d36c0562f908 1 c
129 pick d36c0562f908 1 c
133 pick ae467701c500 2 d
130 pick ae467701c500 2 d
134 pick 0efacef7cb48 3 f
131 pick 0efacef7cb48 3 f
135
132
136 # Edit history between d36c0562f908 and 0efacef7cb48
133 # Edit history between d36c0562f908 and 0efacef7cb48
137 #
134 #
138 # Commands:
135 # Commands:
139 # p, pick = use commit
136 # p, pick = use commit
140 # e, edit = use commit, but stop for amending
137 # e, edit = use commit, but stop for amending
141 # f, fold = use commit, but fold into previous commit (combines N and N-1)
138 # f, fold = use commit, but fold into previous commit (combines N and N-1)
142 # d, drop = remove commit from history
139 # d, drop = remove commit from history
143 # m, mess = edit message without changing commit content
140 # m, mess = edit message without changing commit content
144 #
141 #
145 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
142 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
146 $ cat > commands.txt << EOF
143 $ cat > commands.txt << EOF
147 > pick d36c0562f908 1 c
144 > pick d36c0562f908 1 c
148 > pick 0efacef7cb48 3 f
145 > pick 0efacef7cb48 3 f
149 > pick ae467701c500 2 d
146 > pick ae467701c500 2 d
150 > EOF
147 > EOF
151 $ hg histedit 1 --commands commands.txt --verbose | grep histedit
148 $ hg histedit 1 --commands commands.txt --verbose | grep histedit
152 histedit: Should update metadata for the following changes:
149 histedit: Should update metadata for the following changes:
153 histedit: 0efacef7cb48 to 1be9c35b4cb2
150 histedit: 0efacef7cb48 to 1be9c35b4cb2
154 histedit: moving bookmarks five
151 histedit: moving bookmarks five
155 histedit: ae467701c500 to 1be9c35b4cb2
152 histedit: ae467701c500 to 1be9c35b4cb2
156 histedit: moving bookmarks four, three
153 histedit: moving bookmarks four, three
157 histedit: 0efacef7cb48 to 7c044e3e33a9
154 histedit: 0efacef7cb48 to 7c044e3e33a9
158 saved backup bundle to $TESTTMP/r/.hg/strip-backup/ae467701c500-backup.hg
155 saved backup bundle to $TESTTMP/r/.hg/strip-backup/ae467701c500-backup.hg
159
156
160 We expect 'five' to stay at tip, since the tipmost bookmark is most
157 We expect 'five' to stay at tip, since the tipmost bookmark is most
161 likely the useful signal.
158 likely the useful signal.
162
159
163 $ hg log --graph
160 $ hg log --graph
164 @ changeset: 3:1be9c35b4cb2
161 @ changeset: 3:1be9c35b4cb2
165 | bookmark: five
162 | bookmark: five
166 | bookmark: four
163 | bookmark: four
167 | bookmark: three
164 | bookmark: three
168 | tag: tip
165 | tag: tip
169 | user: test
166 | user: test
170 | date: Thu Jan 01 00:00:00 1970 +0000
167 | date: Thu Jan 01 00:00:00 1970 +0000
171 | summary: d
168 | summary: d
172 |
169 |
173 o changeset: 2:7c044e3e33a9
170 o changeset: 2:7c044e3e33a9
174 | user: test
171 | user: test
175 | date: Thu Jan 01 00:00:00 1970 +0000
172 | date: Thu Jan 01 00:00:00 1970 +0000
176 | summary: f
173 | summary: f
177 |
174 |
178 o changeset: 1:d36c0562f908
175 o changeset: 1:d36c0562f908
179 | bookmark: also-two
176 | bookmark: also-two
180 | bookmark: two
177 | bookmark: two
181 | user: test
178 | user: test
182 | date: Thu Jan 01 00:00:00 1970 +0000
179 | date: Thu Jan 01 00:00:00 1970 +0000
183 | summary: c
180 | summary: c
184 |
181 |
185 o changeset: 0:cb9a9f314b8b
182 o changeset: 0:cb9a9f314b8b
186 bookmark: will-move-backwards
183 bookmark: will-move-backwards
187 user: test
184 user: test
188 date: Thu Jan 01 00:00:00 1970 +0000
185 date: Thu Jan 01 00:00:00 1970 +0000
189 summary: a
186 summary: a
190
187
@@ -1,62 +1,62 b''
1 This test requires parentrevspec support in revsets, so check for that
1 This test requires parentrevspec support in revsets, so check for that
2 and skip the test if we're on an unusual hg that supports .t tests but
2 and skip the test if we're on an unusual hg that supports .t tests but
3 not parentrevspec.
3 not parentrevspec.
4 $ python -c 'from mercurial import revset ; revset.methods["parentpost"]' || exit 80
4 $ python -c 'from mercurial import revset ; revset.methods["parentpost"]' || exit 80
5
5
6 Enable extensions used by this test.
6 Enable extensions used by this test.
7 $ cat >>$HGRCPATH <<EOF
7 $ cat >>$HGRCPATH <<EOF
8 > [extensions]
8 > [extensions]
9 > graphlog=
9 > graphlog=
10 > histedit=
10 > histedit=
11 > EOF
11 > EOF
12
12
13 Repo setup.
13 Repo setup.
14 $ hg init foo
14 $ hg init foo
15 $ cd foo
15 $ cd foo
16 $ echo alpha >> alpha
16 $ echo alpha >> alpha
17 $ hg addr
17 $ hg addr
18 adding alpha
18 adding alpha
19 $ hg ci -m one
19 $ hg ci -m one
20 $ echo alpha >> alpha
20 $ echo alpha >> alpha
21 $ hg ci -m two
21 $ hg ci -m two
22 $ echo alpha >> alpha
22 $ echo alpha >> alpha
23 $ hg ci -m three
23 $ hg ci -m three
24 $ echo alpha >> alpha
24 $ echo alpha >> alpha
25 $ hg ci -m four
25 $ hg ci -m four
26 $ echo alpha >> alpha
26 $ echo alpha >> alpha
27 $ hg ci -m five
27 $ hg ci -m five
28
28
29 $ hg log --style compact --graph
29 $ hg log --style compact --graph
30 @ 4[tip] 08d98a8350f3 1970-01-01 00:00 +0000 test
30 @ 4[tip] 08d98a8350f3 1970-01-01 00:00 +0000 test
31 | five
31 | five
32 |
32 |
33 o 3 c8e68270e35a 1970-01-01 00:00 +0000 test
33 o 3 c8e68270e35a 1970-01-01 00:00 +0000 test
34 | four
34 | four
35 |
35 |
36 o 2 eb57da33312f 1970-01-01 00:00 +0000 test
36 o 2 eb57da33312f 1970-01-01 00:00 +0000 test
37 | three
37 | three
38 |
38 |
39 o 1 579e40513370 1970-01-01 00:00 +0000 test
39 o 1 579e40513370 1970-01-01 00:00 +0000 test
40 | two
40 | two
41 |
41 |
42 o 0 6058cbb6cfd7 1970-01-01 00:00 +0000 test
42 o 0 6058cbb6cfd7 1970-01-01 00:00 +0000 test
43 one
43 one
44
44
45
45
46 Run a dummy edit to make sure we get tip^^ correctly via revsingle.
46 Run a dummy edit to make sure we get tip^^ correctly via revsingle.
47 $ HGEDITOR=cat hg histedit tip^^
47 $ HGEDITOR=cat hg histedit "tip^^"
48 pick eb57da33312f 2 three
48 pick eb57da33312f 2 three
49 pick c8e68270e35a 3 four
49 pick c8e68270e35a 3 four
50 pick 08d98a8350f3 4 five
50 pick 08d98a8350f3 4 five
51
51
52 # Edit history between eb57da33312f and 08d98a8350f3
52 # Edit history between eb57da33312f and 08d98a8350f3
53 #
53 #
54 # Commands:
54 # Commands:
55 # p, pick = use commit
55 # p, pick = use commit
56 # e, edit = use commit, but stop for amending
56 # e, edit = use commit, but stop for amending
57 # f, fold = use commit, but fold into previous commit (combines N and N-1)
57 # f, fold = use commit, but fold into previous commit (combines N and N-1)
58 # d, drop = remove commit from history
58 # d, drop = remove commit from history
59 # m, mess = edit message without changing commit content
59 # m, mess = edit message without changing commit content
60 #
60 #
61 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
61 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
62
62
General Comments 0
You need to be logged in to leave comments. Login now