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