Show More
@@ -1,442 +1,442 b'' | |||||
1 | setup repo |
|
1 | setup repo | |
2 | $ hg init t |
|
2 | $ hg init t | |
3 | $ cd t |
|
3 | $ cd t | |
4 | $ echo a > a |
|
4 | $ echo a > a | |
5 |
$ hg |
|
5 | $ hg add a | |
6 | adding a |
|
6 | $ hg commit -m 'add a' | |
7 | $ hg verify -q |
|
7 | $ hg verify -q | |
8 | $ hg parents |
|
8 | $ hg parents | |
9 | changeset: 0:1f0dee641bb7 |
|
9 | changeset: 0:1f0dee641bb7 | |
10 | tag: tip |
|
10 | tag: tip | |
11 | user: test |
|
11 | user: test | |
12 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
12 | date: Thu Jan 01 00:00:00 1970 +0000 | |
13 | summary: add a |
|
13 | summary: add a | |
14 |
|
14 | |||
15 |
|
15 | |||
16 | rollback to null revision |
|
16 | rollback to null revision | |
17 | $ hg status |
|
17 | $ hg status | |
18 | $ hg rollback |
|
18 | $ hg rollback | |
19 | repository tip rolled back to revision -1 (undo commit) |
|
19 | repository tip rolled back to revision -1 (undo commit) | |
20 | working directory now based on revision -1 |
|
20 | working directory now based on revision -1 | |
21 | $ hg verify -q |
|
21 | $ hg verify -q | |
22 | $ hg parents |
|
22 | $ hg parents | |
23 | $ hg status |
|
23 | $ hg status | |
24 | A a |
|
24 | A a | |
25 |
|
25 | |||
26 | Two changesets this time so we rollback to a real changeset |
|
26 | Two changesets this time so we rollback to a real changeset | |
27 | $ hg commit -m'add a again' |
|
27 | $ hg commit -m'add a again' | |
28 | $ echo a >> a |
|
28 | $ echo a >> a | |
29 | $ hg commit -m'modify a' |
|
29 | $ hg commit -m'modify a' | |
30 |
|
30 | |||
31 | Test issue 902 (current branch is preserved) |
|
31 | Test issue 902 (current branch is preserved) | |
32 | $ hg branch test |
|
32 | $ hg branch test | |
33 | marked working directory as branch test |
|
33 | marked working directory as branch test | |
34 | (branches are permanent and global, did you want a bookmark?) |
|
34 | (branches are permanent and global, did you want a bookmark?) | |
35 | $ hg rollback |
|
35 | $ hg rollback | |
36 | repository tip rolled back to revision 0 (undo commit) |
|
36 | repository tip rolled back to revision 0 (undo commit) | |
37 | working directory now based on revision 0 |
|
37 | working directory now based on revision 0 | |
38 | $ hg branch |
|
38 | $ hg branch | |
39 | default |
|
39 | default | |
40 |
|
40 | |||
41 | Test issue 1635 (commit message saved) |
|
41 | Test issue 1635 (commit message saved) | |
42 | $ cat .hg/last-message.txt ; echo |
|
42 | $ cat .hg/last-message.txt ; echo | |
43 | modify a |
|
43 | modify a | |
44 |
|
44 | |||
45 | Test rollback of hg before issue 902 was fixed |
|
45 | Test rollback of hg before issue 902 was fixed | |
46 |
|
46 | |||
47 | $ hg commit -m "test3" |
|
47 | $ hg commit -m "test3" | |
48 | $ hg branch test |
|
48 | $ hg branch test | |
49 | marked working directory as branch test |
|
49 | marked working directory as branch test | |
50 | (branches are permanent and global, did you want a bookmark?) |
|
50 | (branches are permanent and global, did you want a bookmark?) | |
51 | $ rm .hg/undo.branch |
|
51 | $ rm .hg/undo.branch | |
52 | $ hg rollback |
|
52 | $ hg rollback | |
53 | repository tip rolled back to revision 0 (undo commit) |
|
53 | repository tip rolled back to revision 0 (undo commit) | |
54 | named branch could not be reset: current branch is still 'test' |
|
54 | named branch could not be reset: current branch is still 'test' | |
55 | working directory now based on revision 0 |
|
55 | working directory now based on revision 0 | |
56 | $ hg branch |
|
56 | $ hg branch | |
57 | test |
|
57 | test | |
58 |
|
58 | |||
59 | working dir unaffected by rollback: do not restore dirstate et. al. |
|
59 | working dir unaffected by rollback: do not restore dirstate et. al. | |
60 | $ hg log --template '{rev} {branch} {desc|firstline}\n' |
|
60 | $ hg log --template '{rev} {branch} {desc|firstline}\n' | |
61 | 0 default add a again |
|
61 | 0 default add a again | |
62 | $ hg status |
|
62 | $ hg status | |
63 | M a |
|
63 | M a | |
64 | $ hg bookmark foo |
|
64 | $ hg bookmark foo | |
65 | $ hg commit -m'modify a again' |
|
65 | $ hg commit -m'modify a again' | |
66 | $ echo b > b |
|
66 | $ echo b > b | |
67 | $ hg bookmark bar -r default #making bar active, before the transaction |
|
67 | $ hg bookmark bar -r default #making bar active, before the transaction | |
68 | $ hg commit -Am'add b' |
|
68 | $ hg commit -Am'add b' | |
69 | adding b |
|
69 | adding b | |
70 | $ hg log --template '{rev} {branch} {desc|firstline}\n' |
|
70 | $ hg log --template '{rev} {branch} {desc|firstline}\n' | |
71 | 2 test add b |
|
71 | 2 test add b | |
72 | 1 test modify a again |
|
72 | 1 test modify a again | |
73 | 0 default add a again |
|
73 | 0 default add a again | |
74 | $ hg update bar |
|
74 | $ hg update bar | |
75 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
75 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
76 | (activating bookmark bar) |
|
76 | (activating bookmark bar) | |
77 | $ cat .hg/undo.branch ; echo |
|
77 | $ cat .hg/undo.branch ; echo | |
78 | test |
|
78 | test | |
79 | $ hg rollback -f |
|
79 | $ hg rollback -f | |
80 | repository tip rolled back to revision 1 (undo commit) |
|
80 | repository tip rolled back to revision 1 (undo commit) | |
81 | $ hg id -n |
|
81 | $ hg id -n | |
82 | 0 |
|
82 | 0 | |
83 | $ hg branch |
|
83 | $ hg branch | |
84 | default |
|
84 | default | |
85 | $ cat .hg/bookmarks.current ; echo |
|
85 | $ cat .hg/bookmarks.current ; echo | |
86 | bar |
|
86 | bar | |
87 | $ hg bookmark --delete foo bar |
|
87 | $ hg bookmark --delete foo bar | |
88 |
|
88 | |||
89 | rollback by pretxncommit saves commit message (issue1635) |
|
89 | rollback by pretxncommit saves commit message (issue1635) | |
90 |
|
90 | |||
91 | $ echo a >> a |
|
91 | $ echo a >> a | |
92 | $ hg --config hooks.pretxncommit=false commit -m"precious commit message" |
|
92 | $ hg --config hooks.pretxncommit=false commit -m"precious commit message" | |
93 | transaction abort! |
|
93 | transaction abort! | |
94 | rollback completed |
|
94 | rollback completed | |
95 | abort: pretxncommit hook exited with status * (glob) |
|
95 | abort: pretxncommit hook exited with status * (glob) | |
96 | [40] |
|
96 | [40] | |
97 | $ cat .hg/last-message.txt ; echo |
|
97 | $ cat .hg/last-message.txt ; echo | |
98 | precious commit message |
|
98 | precious commit message | |
99 |
|
99 | |||
100 | same thing, but run $EDITOR |
|
100 | same thing, but run $EDITOR | |
101 |
|
101 | |||
102 | $ cat > editor.sh << '__EOF__' |
|
102 | $ cat > editor.sh << '__EOF__' | |
103 | > echo "another precious commit message" > "$1" |
|
103 | > echo "another precious commit message" > "$1" | |
104 | > __EOF__ |
|
104 | > __EOF__ | |
105 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg --config hooks.pretxncommit=false commit 2>&1 |
|
105 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg --config hooks.pretxncommit=false commit 2>&1 | |
106 | transaction abort! |
|
106 | transaction abort! | |
107 | rollback completed |
|
107 | rollback completed | |
108 | note: commit message saved in .hg/last-message.txt |
|
108 | note: commit message saved in .hg/last-message.txt | |
109 | note: use 'hg commit --logfile .hg/last-message.txt --edit' to reuse it |
|
109 | note: use 'hg commit --logfile .hg/last-message.txt --edit' to reuse it | |
110 | abort: pretxncommit hook exited with status * (glob) |
|
110 | abort: pretxncommit hook exited with status * (glob) | |
111 | [40] |
|
111 | [40] | |
112 | $ cat .hg/last-message.txt |
|
112 | $ cat .hg/last-message.txt | |
113 | another precious commit message |
|
113 | another precious commit message | |
114 |
|
114 | |||
115 | test rollback on served repository |
|
115 | test rollback on served repository | |
116 |
|
116 | |||
117 | #if serve |
|
117 | #if serve | |
118 | $ hg commit -m "precious commit message" |
|
118 | $ hg commit -m "precious commit message" | |
119 | $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
|
119 | $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log | |
120 | $ cat hg.pid >> $DAEMON_PIDS |
|
120 | $ cat hg.pid >> $DAEMON_PIDS | |
121 | $ cd .. |
|
121 | $ cd .. | |
122 | $ hg clone http://localhost:$HGPORT u |
|
122 | $ hg clone http://localhost:$HGPORT u | |
123 | requesting all changes |
|
123 | requesting all changes | |
124 | adding changesets |
|
124 | adding changesets | |
125 | adding manifests |
|
125 | adding manifests | |
126 | adding file changes |
|
126 | adding file changes | |
127 | added 3 changesets with 2 changes to 1 files (+1 heads) |
|
127 | added 3 changesets with 2 changes to 1 files (+1 heads) | |
128 | new changesets 23b0221f3370:068774709090 |
|
128 | new changesets 23b0221f3370:068774709090 | |
129 | updating to branch default |
|
129 | updating to branch default | |
130 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
130 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
131 | $ cd u |
|
131 | $ cd u | |
132 | $ hg id default |
|
132 | $ hg id default | |
133 | 068774709090 |
|
133 | 068774709090 | |
134 |
|
134 | |||
135 | now rollback and observe that 'hg serve' reloads the repository and |
|
135 | now rollback and observe that 'hg serve' reloads the repository and | |
136 | presents the correct tip changeset: |
|
136 | presents the correct tip changeset: | |
137 |
|
137 | |||
138 | $ hg -R ../t rollback |
|
138 | $ hg -R ../t rollback | |
139 | repository tip rolled back to revision 1 (undo commit) |
|
139 | repository tip rolled back to revision 1 (undo commit) | |
140 | working directory now based on revision 0 |
|
140 | working directory now based on revision 0 | |
141 | $ hg id default |
|
141 | $ hg id default | |
142 | 791dd2169706 |
|
142 | 791dd2169706 | |
143 |
|
143 | |||
144 | $ killdaemons.py |
|
144 | $ killdaemons.py | |
145 | #endif |
|
145 | #endif | |
146 |
|
146 | |||
147 | update to older changeset and then refuse rollback, because |
|
147 | update to older changeset and then refuse rollback, because | |
148 | that would lose data (issue2998) |
|
148 | that would lose data (issue2998) | |
149 | $ cd ../t |
|
149 | $ cd ../t | |
150 | $ hg -q update |
|
150 | $ hg -q update | |
151 | $ rm `hg status -un` |
|
151 | $ rm `hg status -un` | |
152 | $ template='{rev}:{node|short} [{branch}] {desc|firstline}\n' |
|
152 | $ template='{rev}:{node|short} [{branch}] {desc|firstline}\n' | |
153 | $ echo 'valuable new file' > b |
|
153 | $ echo 'valuable new file' > b | |
154 | $ echo 'valuable modification' >> a |
|
154 | $ echo 'valuable modification' >> a | |
155 | $ hg commit -A -m'a valuable change' |
|
155 | $ hg commit -A -m'a valuable change' | |
156 | adding b |
|
156 | adding b | |
157 | $ hg update 0 |
|
157 | $ hg update 0 | |
158 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
158 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
159 | $ hg rollback |
|
159 | $ hg rollback | |
160 | abort: rollback of last commit while not checked out may lose data |
|
160 | abort: rollback of last commit while not checked out may lose data | |
161 | (use -f to force) |
|
161 | (use -f to force) | |
162 | [255] |
|
162 | [255] | |
163 | $ hg tip -q |
|
163 | $ hg tip -q | |
164 | 2:4d9cd3795eea |
|
164 | 2:4d9cd3795eea | |
165 | $ hg rollback -f |
|
165 | $ hg rollback -f | |
166 | repository tip rolled back to revision 1 (undo commit) |
|
166 | repository tip rolled back to revision 1 (undo commit) | |
167 | $ hg status |
|
167 | $ hg status | |
168 | $ hg log --removed b # yep, it's gone |
|
168 | $ hg log --removed b # yep, it's gone | |
169 |
|
169 | |||
170 | same again, but emulate an old client that doesn't write undo.desc |
|
170 | same again, but emulate an old client that doesn't write undo.desc | |
171 | $ hg -q update |
|
171 | $ hg -q update | |
172 | $ echo 'valuable modification redux' >> a |
|
172 | $ echo 'valuable modification redux' >> a | |
173 | $ hg commit -m'a valuable change redux' |
|
173 | $ hg commit -m'a valuable change redux' | |
174 | $ rm .hg/undo.desc |
|
174 | $ rm .hg/undo.desc | |
175 | $ hg update 0 |
|
175 | $ hg update 0 | |
176 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
176 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
177 | $ hg rollback |
|
177 | $ hg rollback | |
178 | rolling back unknown transaction |
|
178 | rolling back unknown transaction | |
179 | $ cat a |
|
179 | $ cat a | |
180 | a |
|
180 | a | |
181 |
|
181 | |||
182 | corrupt journal test |
|
182 | corrupt journal test | |
183 | $ echo "foo" > .hg/store/journal |
|
183 | $ echo "foo" > .hg/store/journal | |
184 | $ hg recover --verify -q |
|
184 | $ hg recover --verify -q | |
185 | couldn't read journal entry 'foo\n'! |
|
185 | couldn't read journal entry 'foo\n'! | |
186 |
|
186 | |||
187 | rollback disabled by config |
|
187 | rollback disabled by config | |
188 | $ cat >> $HGRCPATH <<EOF |
|
188 | $ cat >> $HGRCPATH <<EOF | |
189 | > [ui] |
|
189 | > [ui] | |
190 | > rollback = false |
|
190 | > rollback = false | |
191 | > EOF |
|
191 | > EOF | |
192 | $ echo narf >> pinky-sayings.txt |
|
192 | $ echo narf >> pinky-sayings.txt | |
193 | $ hg add pinky-sayings.txt |
|
193 | $ hg add pinky-sayings.txt | |
194 | $ hg ci -m 'First one.' |
|
194 | $ hg ci -m 'First one.' | |
195 | $ hg rollback |
|
195 | $ hg rollback | |
196 | abort: rollback is disabled because it is unsafe |
|
196 | abort: rollback is disabled because it is unsafe | |
197 | (see `hg help -v rollback` for information) |
|
197 | (see `hg help -v rollback` for information) | |
198 | [255] |
|
198 | [255] | |
199 |
|
199 | |||
200 | $ cd .. |
|
200 | $ cd .. | |
201 |
|
201 | |||
202 | I/O errors on stdio are handled properly (issue5658) |
|
202 | I/O errors on stdio are handled properly (issue5658) | |
203 |
|
203 | |||
204 | $ cat > badui.py << EOF |
|
204 | $ cat > badui.py << EOF | |
205 | > import errno |
|
205 | > import errno | |
206 | > from mercurial.i18n import _ |
|
206 | > from mercurial.i18n import _ | |
207 | > from mercurial import ( |
|
207 | > from mercurial import ( | |
208 | > error, |
|
208 | > error, | |
209 | > registrar, |
|
209 | > registrar, | |
210 | > ui as uimod, |
|
210 | > ui as uimod, | |
211 | > ) |
|
211 | > ) | |
212 | > |
|
212 | > | |
213 | > configtable = {} |
|
213 | > configtable = {} | |
214 | > configitem = registrar.configitem(configtable) |
|
214 | > configitem = registrar.configitem(configtable) | |
215 | > |
|
215 | > | |
216 | > configitem(b'ui', b'ioerrors', |
|
216 | > configitem(b'ui', b'ioerrors', | |
217 | > default=list, |
|
217 | > default=list, | |
218 | > ) |
|
218 | > ) | |
219 | > |
|
219 | > | |
220 | > def pretxncommit(ui, repo, **kwargs): |
|
220 | > def pretxncommit(ui, repo, **kwargs): | |
221 | > ui.warn(b'warn during pretxncommit\n') |
|
221 | > ui.warn(b'warn during pretxncommit\n') | |
222 | > |
|
222 | > | |
223 | > def pretxnclose(ui, repo, **kwargs): |
|
223 | > def pretxnclose(ui, repo, **kwargs): | |
224 | > ui.warn(b'warn during pretxnclose\n') |
|
224 | > ui.warn(b'warn during pretxnclose\n') | |
225 | > |
|
225 | > | |
226 | > def txnclose(ui, repo, **kwargs): |
|
226 | > def txnclose(ui, repo, **kwargs): | |
227 | > ui.warn(b'warn during txnclose\n') |
|
227 | > ui.warn(b'warn during txnclose\n') | |
228 | > |
|
228 | > | |
229 | > def txnabort(ui, repo, **kwargs): |
|
229 | > def txnabort(ui, repo, **kwargs): | |
230 | > ui.warn(b'warn during abort\n') |
|
230 | > ui.warn(b'warn during abort\n') | |
231 | > |
|
231 | > | |
232 | > class fdproxy(object): |
|
232 | > class fdproxy(object): | |
233 | > def __init__(self, ui, o): |
|
233 | > def __init__(self, ui, o): | |
234 | > self._ui = ui |
|
234 | > self._ui = ui | |
235 | > self._o = o |
|
235 | > self._o = o | |
236 | > |
|
236 | > | |
237 | > def __getattr__(self, attr): |
|
237 | > def __getattr__(self, attr): | |
238 | > return getattr(self._o, attr) |
|
238 | > return getattr(self._o, attr) | |
239 | > |
|
239 | > | |
240 | > def write(self, msg): |
|
240 | > def write(self, msg): | |
241 | > errors = set(self._ui.configlist(b'ui', b'ioerrors')) |
|
241 | > errors = set(self._ui.configlist(b'ui', b'ioerrors')) | |
242 | > pretxncommit = msg == b'warn during pretxncommit\n' |
|
242 | > pretxncommit = msg == b'warn during pretxncommit\n' | |
243 | > pretxnclose = msg == b'warn during pretxnclose\n' |
|
243 | > pretxnclose = msg == b'warn during pretxnclose\n' | |
244 | > txnclose = msg == b'warn during txnclose\n' |
|
244 | > txnclose = msg == b'warn during txnclose\n' | |
245 | > txnabort = msg == b'warn during abort\n' |
|
245 | > txnabort = msg == b'warn during abort\n' | |
246 | > msgabort = msg == _(b'transaction abort!\n') |
|
246 | > msgabort = msg == _(b'transaction abort!\n') | |
247 | > msgrollback = msg == _(b'rollback completed\n') |
|
247 | > msgrollback = msg == _(b'rollback completed\n') | |
248 | > |
|
248 | > | |
249 | > if pretxncommit and b'pretxncommit' in errors: |
|
249 | > if pretxncommit and b'pretxncommit' in errors: | |
250 | > raise IOError(errno.EPIPE, 'simulated epipe') |
|
250 | > raise IOError(errno.EPIPE, 'simulated epipe') | |
251 | > if pretxnclose and b'pretxnclose' in errors: |
|
251 | > if pretxnclose and b'pretxnclose' in errors: | |
252 | > raise IOError(errno.EIO, 'simulated eio') |
|
252 | > raise IOError(errno.EIO, 'simulated eio') | |
253 | > if txnclose and b'txnclose' in errors: |
|
253 | > if txnclose and b'txnclose' in errors: | |
254 | > raise IOError(errno.EBADF, 'simulated badf') |
|
254 | > raise IOError(errno.EBADF, 'simulated badf') | |
255 | > if txnabort and b'txnabort' in errors: |
|
255 | > if txnabort and b'txnabort' in errors: | |
256 | > raise IOError(errno.EPIPE, 'simulated epipe') |
|
256 | > raise IOError(errno.EPIPE, 'simulated epipe') | |
257 | > if msgabort and b'msgabort' in errors: |
|
257 | > if msgabort and b'msgabort' in errors: | |
258 | > raise IOError(errno.EBADF, 'simulated ebadf') |
|
258 | > raise IOError(errno.EBADF, 'simulated ebadf') | |
259 | > if msgrollback and b'msgrollback' in errors: |
|
259 | > if msgrollback and b'msgrollback' in errors: | |
260 | > raise IOError(errno.EIO, 'simulated eio') |
|
260 | > raise IOError(errno.EIO, 'simulated eio') | |
261 | > |
|
261 | > | |
262 | > return self._o.write(msg) |
|
262 | > return self._o.write(msg) | |
263 | > |
|
263 | > | |
264 | > def uisetup(ui): |
|
264 | > def uisetup(ui): | |
265 | > class badui(ui.__class__): |
|
265 | > class badui(ui.__class__): | |
266 | > def _write(self, dest, *args, **kwargs): |
|
266 | > def _write(self, dest, *args, **kwargs): | |
267 | > olderr = self.ferr |
|
267 | > olderr = self.ferr | |
268 | > try: |
|
268 | > try: | |
269 | > if dest is self.ferr: |
|
269 | > if dest is self.ferr: | |
270 | > self.ferr = dest = fdproxy(self, olderr) |
|
270 | > self.ferr = dest = fdproxy(self, olderr) | |
271 | > return super(badui, self)._write(dest, *args, **kwargs) |
|
271 | > return super(badui, self)._write(dest, *args, **kwargs) | |
272 | > finally: |
|
272 | > finally: | |
273 | > self.ferr = olderr |
|
273 | > self.ferr = olderr | |
274 | > |
|
274 | > | |
275 | > ui.__class__ = badui |
|
275 | > ui.__class__ = badui | |
276 | > |
|
276 | > | |
277 | > def reposetup(ui, repo): |
|
277 | > def reposetup(ui, repo): | |
278 | > ui.setconfig(b'hooks', b'pretxnclose.badui', pretxnclose, b'badui') |
|
278 | > ui.setconfig(b'hooks', b'pretxnclose.badui', pretxnclose, b'badui') | |
279 | > ui.setconfig(b'hooks', b'txnclose.badui', txnclose, b'badui') |
|
279 | > ui.setconfig(b'hooks', b'txnclose.badui', txnclose, b'badui') | |
280 | > ui.setconfig(b'hooks', b'pretxncommit.badui', pretxncommit, b'badui') |
|
280 | > ui.setconfig(b'hooks', b'pretxncommit.badui', pretxncommit, b'badui') | |
281 | > ui.setconfig(b'hooks', b'txnabort.badui', txnabort, b'badui') |
|
281 | > ui.setconfig(b'hooks', b'txnabort.badui', txnabort, b'badui') | |
282 | > EOF |
|
282 | > EOF | |
283 |
|
283 | |||
284 | $ cat >> $HGRCPATH << EOF |
|
284 | $ cat >> $HGRCPATH << EOF | |
285 | > [extensions] |
|
285 | > [extensions] | |
286 | > badui = $TESTTMP/badui.py |
|
286 | > badui = $TESTTMP/badui.py | |
287 | > EOF |
|
287 | > EOF | |
288 |
|
288 | |||
289 | An I/O error during pretxncommit is handled |
|
289 | An I/O error during pretxncommit is handled | |
290 |
|
290 | |||
291 | $ hg init ioerror-pretxncommit |
|
291 | $ hg init ioerror-pretxncommit | |
292 | $ cd ioerror-pretxncommit |
|
292 | $ cd ioerror-pretxncommit | |
293 | $ echo 0 > foo |
|
293 | $ echo 0 > foo | |
294 | $ hg -q commit -A -m initial |
|
294 | $ hg -q commit -A -m initial | |
295 | warn during pretxncommit |
|
295 | warn during pretxncommit | |
296 | warn during pretxnclose |
|
296 | warn during pretxnclose | |
297 | warn during txnclose |
|
297 | warn during txnclose | |
298 | $ echo 1 > foo |
|
298 | $ echo 1 > foo | |
299 | $ hg --config ui.ioerrors=pretxncommit commit -m 'error during pretxncommit' |
|
299 | $ hg --config ui.ioerrors=pretxncommit commit -m 'error during pretxncommit' | |
300 | warn during pretxnclose |
|
300 | warn during pretxnclose | |
301 | warn during txnclose |
|
301 | warn during txnclose | |
302 |
|
302 | |||
303 | $ hg commit -m 'commit 1' |
|
303 | $ hg commit -m 'commit 1' | |
304 | nothing changed |
|
304 | nothing changed | |
305 | [1] |
|
305 | [1] | |
306 |
|
306 | |||
307 | $ cd .. |
|
307 | $ cd .. | |
308 |
|
308 | |||
309 | An I/O error during pretxnclose is handled |
|
309 | An I/O error during pretxnclose is handled | |
310 |
|
310 | |||
311 | $ hg init ioerror-pretxnclose |
|
311 | $ hg init ioerror-pretxnclose | |
312 | $ cd ioerror-pretxnclose |
|
312 | $ cd ioerror-pretxnclose | |
313 | $ echo 0 > foo |
|
313 | $ echo 0 > foo | |
314 | $ hg -q commit -A -m initial |
|
314 | $ hg -q commit -A -m initial | |
315 | warn during pretxncommit |
|
315 | warn during pretxncommit | |
316 | warn during pretxnclose |
|
316 | warn during pretxnclose | |
317 | warn during txnclose |
|
317 | warn during txnclose | |
318 |
|
318 | |||
319 | $ echo 1 > foo |
|
319 | $ echo 1 > foo | |
320 | $ hg --config ui.ioerrors=pretxnclose commit -m 'error during pretxnclose' |
|
320 | $ hg --config ui.ioerrors=pretxnclose commit -m 'error during pretxnclose' | |
321 | warn during pretxncommit |
|
321 | warn during pretxncommit | |
322 | warn during txnclose |
|
322 | warn during txnclose | |
323 |
|
323 | |||
324 | $ hg commit -m 'commit 1' |
|
324 | $ hg commit -m 'commit 1' | |
325 | nothing changed |
|
325 | nothing changed | |
326 | [1] |
|
326 | [1] | |
327 |
|
327 | |||
328 | $ cd .. |
|
328 | $ cd .. | |
329 |
|
329 | |||
330 | An I/O error during txnclose is handled |
|
330 | An I/O error during txnclose is handled | |
331 |
|
331 | |||
332 | $ hg init ioerror-txnclose |
|
332 | $ hg init ioerror-txnclose | |
333 | $ cd ioerror-txnclose |
|
333 | $ cd ioerror-txnclose | |
334 | $ echo 0 > foo |
|
334 | $ echo 0 > foo | |
335 | $ hg -q commit -A -m initial |
|
335 | $ hg -q commit -A -m initial | |
336 | warn during pretxncommit |
|
336 | warn during pretxncommit | |
337 | warn during pretxnclose |
|
337 | warn during pretxnclose | |
338 | warn during txnclose |
|
338 | warn during txnclose | |
339 |
|
339 | |||
340 | $ echo 1 > foo |
|
340 | $ echo 1 > foo | |
341 | $ hg --config ui.ioerrors=txnclose commit -m 'error during txnclose' |
|
341 | $ hg --config ui.ioerrors=txnclose commit -m 'error during txnclose' | |
342 | warn during pretxncommit |
|
342 | warn during pretxncommit | |
343 | warn during pretxnclose |
|
343 | warn during pretxnclose | |
344 |
|
344 | |||
345 | $ hg commit -m 'commit 1' |
|
345 | $ hg commit -m 'commit 1' | |
346 | nothing changed |
|
346 | nothing changed | |
347 | [1] |
|
347 | [1] | |
348 |
|
348 | |||
349 | $ cd .. |
|
349 | $ cd .. | |
350 |
|
350 | |||
351 | An I/O error writing "transaction abort" is handled |
|
351 | An I/O error writing "transaction abort" is handled | |
352 |
|
352 | |||
353 | $ hg init ioerror-msgabort |
|
353 | $ hg init ioerror-msgabort | |
354 | $ cd ioerror-msgabort |
|
354 | $ cd ioerror-msgabort | |
355 |
|
355 | |||
356 | $ echo 0 > foo |
|
356 | $ echo 0 > foo | |
357 | $ hg -q commit -A -m initial |
|
357 | $ hg -q commit -A -m initial | |
358 | warn during pretxncommit |
|
358 | warn during pretxncommit | |
359 | warn during pretxnclose |
|
359 | warn during pretxnclose | |
360 | warn during txnclose |
|
360 | warn during txnclose | |
361 |
|
361 | |||
362 | $ echo 1 > foo |
|
362 | $ echo 1 > foo | |
363 | $ hg --config ui.ioerrors=msgabort --config hooks.pretxncommit=false commit -m 'error during abort message' |
|
363 | $ hg --config ui.ioerrors=msgabort --config hooks.pretxncommit=false commit -m 'error during abort message' | |
364 | warn during abort |
|
364 | warn during abort | |
365 | rollback completed |
|
365 | rollback completed | |
366 | abort: pretxncommit hook exited with status 1 |
|
366 | abort: pretxncommit hook exited with status 1 | |
367 | [40] |
|
367 | [40] | |
368 |
|
368 | |||
369 | $ hg commit -m 'commit 1' |
|
369 | $ hg commit -m 'commit 1' | |
370 | warn during pretxncommit |
|
370 | warn during pretxncommit | |
371 | warn during pretxnclose |
|
371 | warn during pretxnclose | |
372 | warn during txnclose |
|
372 | warn during txnclose | |
373 |
|
373 | |||
374 | $ cd .. |
|
374 | $ cd .. | |
375 |
|
375 | |||
376 | An I/O error during txnabort should still result in rollback |
|
376 | An I/O error during txnabort should still result in rollback | |
377 |
|
377 | |||
378 | $ hg init ioerror-txnabort |
|
378 | $ hg init ioerror-txnabort | |
379 | $ cd ioerror-txnabort |
|
379 | $ cd ioerror-txnabort | |
380 |
|
380 | |||
381 | $ echo 0 > foo |
|
381 | $ echo 0 > foo | |
382 | $ hg -q commit -A -m initial |
|
382 | $ hg -q commit -A -m initial | |
383 | warn during pretxncommit |
|
383 | warn during pretxncommit | |
384 | warn during pretxnclose |
|
384 | warn during pretxnclose | |
385 | warn during txnclose |
|
385 | warn during txnclose | |
386 |
|
386 | |||
387 | $ echo 1 > foo |
|
387 | $ echo 1 > foo | |
388 | $ hg --config ui.ioerrors=txnabort --config hooks.pretxncommit=false commit -m 'error during abort' |
|
388 | $ hg --config ui.ioerrors=txnabort --config hooks.pretxncommit=false commit -m 'error during abort' | |
389 | transaction abort! |
|
389 | transaction abort! | |
390 | rollback completed |
|
390 | rollback completed | |
391 | abort: pretxncommit hook exited with status 1 |
|
391 | abort: pretxncommit hook exited with status 1 | |
392 | [40] |
|
392 | [40] | |
393 |
|
393 | |||
394 | $ hg commit -m 'commit 1' |
|
394 | $ hg commit -m 'commit 1' | |
395 | warn during pretxncommit |
|
395 | warn during pretxncommit | |
396 | warn during pretxnclose |
|
396 | warn during pretxnclose | |
397 | warn during txnclose |
|
397 | warn during txnclose | |
398 |
|
398 | |||
399 | $ cd .. |
|
399 | $ cd .. | |
400 |
|
400 | |||
401 | An I/O error writing "rollback completed" is handled |
|
401 | An I/O error writing "rollback completed" is handled | |
402 |
|
402 | |||
403 | $ hg init ioerror-msgrollback |
|
403 | $ hg init ioerror-msgrollback | |
404 | $ cd ioerror-msgrollback |
|
404 | $ cd ioerror-msgrollback | |
405 |
|
405 | |||
406 | $ echo 0 > foo |
|
406 | $ echo 0 > foo | |
407 | $ hg -q commit -A -m initial |
|
407 | $ hg -q commit -A -m initial | |
408 | warn during pretxncommit |
|
408 | warn during pretxncommit | |
409 | warn during pretxnclose |
|
409 | warn during pretxnclose | |
410 | warn during txnclose |
|
410 | warn during txnclose | |
411 |
|
411 | |||
412 | $ echo 1 > foo |
|
412 | $ echo 1 > foo | |
413 |
|
413 | |||
414 | $ hg --config ui.ioerrors=msgrollback --config hooks.pretxncommit=false commit -m 'error during rollback message' |
|
414 | $ hg --config ui.ioerrors=msgrollback --config hooks.pretxncommit=false commit -m 'error during rollback message' | |
415 | transaction abort! |
|
415 | transaction abort! | |
416 | warn during abort |
|
416 | warn during abort | |
417 | abort: pretxncommit hook exited with status 1 |
|
417 | abort: pretxncommit hook exited with status 1 | |
418 | [40] |
|
418 | [40] | |
419 |
|
419 | |||
420 | $ hg verify -q |
|
420 | $ hg verify -q | |
421 |
|
421 | |||
422 | $ cd .. |
|
422 | $ cd .. | |
423 |
|
423 | |||
424 | Multiple I/O errors after transaction open are handled. |
|
424 | Multiple I/O errors after transaction open are handled. | |
425 | This is effectively what happens if a peer disconnects in the middle |
|
425 | This is effectively what happens if a peer disconnects in the middle | |
426 | of a transaction. |
|
426 | of a transaction. | |
427 |
|
427 | |||
428 | $ hg init ioerror-multiple |
|
428 | $ hg init ioerror-multiple | |
429 | $ cd ioerror-multiple |
|
429 | $ cd ioerror-multiple | |
430 | $ echo 0 > foo |
|
430 | $ echo 0 > foo | |
431 | $ hg -q commit -A -m initial |
|
431 | $ hg -q commit -A -m initial | |
432 | warn during pretxncommit |
|
432 | warn during pretxncommit | |
433 | warn during pretxnclose |
|
433 | warn during pretxnclose | |
434 | warn during txnclose |
|
434 | warn during txnclose | |
435 |
|
435 | |||
436 | $ echo 1 > foo |
|
436 | $ echo 1 > foo | |
437 |
|
437 | |||
438 | $ hg --config ui.ioerrors=pretxncommit,pretxnclose,txnclose,txnabort,msgabort,msgrollback commit -m 'multiple errors' |
|
438 | $ hg --config ui.ioerrors=pretxncommit,pretxnclose,txnclose,txnabort,msgabort,msgrollback commit -m 'multiple errors' | |
439 |
|
439 | |||
440 | $ hg verify -q |
|
440 | $ hg verify -q | |
441 |
|
441 | |||
442 | $ cd .. |
|
442 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now