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