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