##// END OF EJS Templates
test-commit-interactive-curses: backout 852801178a63...
Matt Harbison -
r24435:1356086a default
parent child Browse files
Show More
@@ -1,185 +1,184 b''
1 #require tic
2 Set up a repo
1 Set up a repo
3
2
4 $ cat <<EOF >> $HGRCPATH
3 $ cat <<EOF >> $HGRCPATH
5 > [ui]
4 > [ui]
6 > interactive = true
5 > interactive = true
7 > [experimental]
6 > [experimental]
8 > crecord = true
7 > crecord = true
9 > crecordtest = testModeCommands
8 > crecordtest = testModeCommands
10 > EOF
9 > EOF
11
10
12 $ hg init a
11 $ hg init a
13 $ cd a
12 $ cd a
14
13
15 Committing some changes but stopping on the way
14 Committing some changes but stopping on the way
16
15
17 $ echo "a" > a
16 $ echo "a" > a
18 $ hg add a
17 $ hg add a
19 $ cat <<EOF >testModeCommands
18 $ cat <<EOF >testModeCommands
20 > TOGGLE
19 > TOGGLE
21 > X
20 > X
22 > EOF
21 > EOF
23 $ hg commit -i -m "a" -d "0 0"
22 $ hg commit -i -m "a" -d "0 0"
24 no changes to record
23 no changes to record
25 $ hg tip
24 $ hg tip
26 changeset: -1:000000000000
25 changeset: -1:000000000000
27 tag: tip
26 tag: tip
28 user:
27 user:
29 date: Thu Jan 01 00:00:00 1970 +0000
28 date: Thu Jan 01 00:00:00 1970 +0000
30
29
31
30
32 Committing some changes
31 Committing some changes
33
32
34 $ cat <<EOF >testModeCommands
33 $ cat <<EOF >testModeCommands
35 > X
34 > X
36 > EOF
35 > EOF
37 $ hg commit -i -m "a" -d "0 0"
36 $ hg commit -i -m "a" -d "0 0"
38 $ hg tip
37 $ hg tip
39 changeset: 0:cb9a9f314b8b
38 changeset: 0:cb9a9f314b8b
40 tag: tip
39 tag: tip
41 user: test
40 user: test
42 date: Thu Jan 01 00:00:00 1970 +0000
41 date: Thu Jan 01 00:00:00 1970 +0000
43 summary: a
42 summary: a
44
43
45 Committing only one file
44 Committing only one file
46
45
47 $ echo "a" >> a
46 $ echo "a" >> a
48 >>> open('b', 'wb').write("1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n")
47 >>> open('b', 'wb').write("1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n")
49 $ hg add b
48 $ hg add b
50 $ cat <<EOF >testModeCommands
49 $ cat <<EOF >testModeCommands
51 > TOGGLE
50 > TOGGLE
52 > KEY_DOWN
51 > KEY_DOWN
53 > X
52 > X
54 > EOF
53 > EOF
55 $ hg commit -i -m "one file" -d "0 0"
54 $ hg commit -i -m "one file" -d "0 0"
56 $ hg tip
55 $ hg tip
57 changeset: 1:fb2705a663ea
56 changeset: 1:fb2705a663ea
58 tag: tip
57 tag: tip
59 user: test
58 user: test
60 date: Thu Jan 01 00:00:00 1970 +0000
59 date: Thu Jan 01 00:00:00 1970 +0000
61 summary: one file
60 summary: one file
62
61
63 $ hg cat -r tip a
62 $ hg cat -r tip a
64 a
63 a
65 $ cat a
64 $ cat a
66 a
65 a
67 a
66 a
68
67
69 Committing only one hunk
68 Committing only one hunk
70
69
71 - Untoggle all the hunks, go down to the second file
70 - Untoggle all the hunks, go down to the second file
72 - unfold it
71 - unfold it
73 - go down to second hunk (1 for the first hunk, 1 for the first hunkline, 1 for the second hunk, 1 for the second hunklike)
72 - go down to second hunk (1 for the first hunk, 1 for the first hunkline, 1 for the second hunk, 1 for the second hunklike)
74 - toggle the second hunk
73 - toggle the second hunk
75 - commit
74 - commit
76
75
77 $ echo "x" > c
76 $ echo "x" > c
78 $ cat b >> c
77 $ cat b >> c
79 $ echo "y" >> c
78 $ echo "y" >> c
80 $ mv c b
79 $ mv c b
81 $ cat <<EOF >testModeCommands
80 $ cat <<EOF >testModeCommands
82 > A
81 > A
83 > KEY_DOWN
82 > KEY_DOWN
84 > f
83 > f
85 > KEY_DOWN
84 > KEY_DOWN
86 > KEY_DOWN
85 > KEY_DOWN
87 > KEY_DOWN
86 > KEY_DOWN
88 > KEY_DOWN
87 > KEY_DOWN
89 > TOGGLE
88 > TOGGLE
90 > X
89 > X
91 > EOF
90 > EOF
92 $ hg commit -i -m "one hunk" -d "0 0"
91 $ hg commit -i -m "one hunk" -d "0 0"
93 $ hg tip
92 $ hg tip
94 changeset: 2:7d10dfe755a8
93 changeset: 2:7d10dfe755a8
95 tag: tip
94 tag: tip
96 user: test
95 user: test
97 date: Thu Jan 01 00:00:00 1970 +0000
96 date: Thu Jan 01 00:00:00 1970 +0000
98 summary: one hunk
97 summary: one hunk
99
98
100 $ hg cat -r tip b
99 $ hg cat -r tip b
101 1
100 1
102 2
101 2
103 3
102 3
104 4
103 4
105 5
104 5
106 6
105 6
107 7
106 7
108 8
107 8
109 9
108 9
110 10
109 10
111 y
110 y
112 $ cat b
111 $ cat b
113 x
112 x
114 1
113 1
115 2
114 2
116 3
115 3
117 4
116 4
118 5
117 5
119 6
118 6
120 7
119 7
121 8
120 8
122 9
121 9
123 10
122 10
124 y
123 y
125 $ hg commit -m "other hunks"
124 $ hg commit -m "other hunks"
126 $ hg tip
125 $ hg tip
127 changeset: 3:a6735021574d
126 changeset: 3:a6735021574d
128 tag: tip
127 tag: tip
129 user: test
128 user: test
130 date: Thu Jan 01 00:00:00 1970 +0000
129 date: Thu Jan 01 00:00:00 1970 +0000
131 summary: other hunks
130 summary: other hunks
132
131
133 $ hg cat -r tip b
132 $ hg cat -r tip b
134 x
133 x
135 1
134 1
136 2
135 2
137 3
136 3
138 4
137 4
139 5
138 5
140 6
139 6
141 7
140 7
142 8
141 8
143 9
142 9
144 10
143 10
145 y
144 y
146
145
147 Editing patch of newly added file
146 Editing patch of newly added file
148
147
149 $ cat > editor.sh << '__EOF__'
148 $ cat > editor.sh << '__EOF__'
150 > cat "$1" | sed "s/first/very/g" > tt
149 > cat "$1" | sed "s/first/very/g" > tt
151 > mv tt "$1"
150 > mv tt "$1"
152 > __EOF__
151 > __EOF__
153 $ cat > newfile << '__EOF__'
152 $ cat > newfile << '__EOF__'
154 > This is the first line
153 > This is the first line
155 > This is the second line
154 > This is the second line
156 > This is the third line
155 > This is the third line
157 > __EOF__
156 > __EOF__
158 $ hg add newfile
157 $ hg add newfile
159 $ cat <<EOF >testModeCommands
158 $ cat <<EOF >testModeCommands
160 > f
159 > f
161 > KEY_DOWN
160 > KEY_DOWN
162 > KEY_DOWN
161 > KEY_DOWN
163 > KEY_DOWN
162 > KEY_DOWN
164 > e
163 > e
165 > X
164 > X
166 > EOF
165 > EOF
167 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i -d '23 0' -medit-patch-new
166 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i -d '23 0' -medit-patch-new
168 $ hg tip
167 $ hg tip
169 changeset: 4:6a0a43e9eff5
168 changeset: 4:6a0a43e9eff5
170 tag: tip
169 tag: tip
171 user: test
170 user: test
172 date: Thu Jan 01 00:00:23 1970 +0000
171 date: Thu Jan 01 00:00:23 1970 +0000
173 summary: edit-patch-new
172 summary: edit-patch-new
174
173
175 $ hg cat -r tip newfile
174 $ hg cat -r tip newfile
176 This is the very line
175 This is the very line
177 This is the second line
176 This is the second line
178 This is the third line
177 This is the third line
179
178
180 $ cat newfile
179 $ cat newfile
181 This is the first line
180 This is the first line
182 This is the second line
181 This is the second line
183 This is the third line
182 This is the third line
184
183
185
184
General Comments 0
You need to be logged in to leave comments. Login now