Show More
@@ -559,7 +559,7 b' def createlog(ui, directory=None, root=b' | |||
|
559 | 559 | pass # try next encoding |
|
560 | 560 | except LookupError as inst: # unknown encoding, maybe |
|
561 | 561 | raise error.Abort( |
|
562 | inst, | |
|
562 | pycompat.bytestr(inst), | |
|
563 | 563 | hint=_( |
|
564 | 564 | b'check convert.cvsps.logencoding configuration' |
|
565 | 565 | ), |
@@ -207,7 +207,9 b' def tolocal(s):' | |||
|
207 | 207 | # can't round-trip |
|
208 | 208 | return u.encode(_sysstr(encoding), "replace") |
|
209 | 209 | except LookupError as k: |
|
210 | raise error.Abort(k, hint=b"please check your locale settings") | |
|
210 | raise error.Abort( | |
|
211 | pycompat.bytestr(k), hint=b"please check your locale settings" | |
|
212 | ) | |
|
211 | 213 | |
|
212 | 214 | |
|
213 | 215 | def fromlocal(s): |
@@ -1720,7 +1720,7 b' def add_confirm_callback(repo, pullop):' | |||
|
1720 | 1720 | repo = reporef() |
|
1721 | 1721 | cm = _(b'accept incoming changes (yn)?$$ &Yes $$ &No') |
|
1722 | 1722 | if repo.ui.promptchoice(cm): |
|
1723 | raise error.Abort("user aborted") | |
|
1723 | raise error.Abort(b"user aborted") | |
|
1724 | 1724 | |
|
1725 | 1725 | tr.addvalidator(b'900-pull-prompt', prompt) |
|
1726 | 1726 |
@@ -12,7 +12,7 b' from mercurial import (' | |||
|
12 | 12 | def failfilemerge( |
|
13 | 13 | filemergefn, premerge, repo, wctx, mynode, orig, fcd, fco, fca, labels=None |
|
14 | 14 | ): |
|
15 | raise error.Abort("^C") | |
|
15 | raise error.Abort(b"^C") | |
|
16 | 16 | return filemergefn(premerge, repo, mynode, orig, fcd, fco, fca, labels) |
|
17 | 17 | |
|
18 | 18 |
@@ -22,6 +22,7 b' Create an extension to test bundle2 API' | |||
|
22 | 22 | > from mercurial import changegroup |
|
23 | 23 | > from mercurial import error |
|
24 | 24 | > from mercurial import obsolete |
|
25 | > from mercurial import pycompat | |
|
25 | 26 | > from mercurial import registrar |
|
26 | 27 | > from mercurial.utils import procutil |
|
27 | 28 | > |
@@ -169,7 +170,7 b' Create an extension to test bundle2 API' | |||
|
169 | 170 | > for chunk in bundler.getchunks(): |
|
170 | 171 | > file.write(chunk) |
|
171 | 172 | > except RuntimeError as exc: |
|
172 | > raise error.Abort(exc) | |
|
173 | > raise error.Abort(pycompat.bytestr(exc)) | |
|
173 | 174 | > finally: |
|
174 | 175 | > file.flush() |
|
175 | 176 | > |
@@ -74,7 +74,7 b' coherent (issue4353)' | |||
|
74 | 74 | > ) |
|
75 | 75 | > |
|
76 | 76 | > def wraprecordupdates(*args): |
|
77 | > raise error.Abort("simulated error while recording dirstateupdates") | |
|
77 | > raise error.Abort(b"simulated error while recording dirstateupdates") | |
|
78 | 78 | > |
|
79 | 79 | > def reposetup(ui, repo): |
|
80 | 80 | > extensions.wrapfunction(mergestatemod, 'recordupdates', |
@@ -238,7 +238,7 b' Aborting lock does not prevent fncache w' | |||
|
238 | 238 | > def lockexception(orig, vfs, lockname, wait, releasefn, *args, **kwargs): |
|
239 | 239 | > def releasewrap(): |
|
240 | 240 | > l.held = False # ensure __del__ is a noop |
|
241 | > raise error.Abort("forced lock failure") | |
|
241 | > raise error.Abort(b"forced lock failure") | |
|
242 | 242 | > l = orig(vfs, lockname, wait, releasewrap, *args, **kwargs) |
|
243 | 243 | > return l |
|
244 | 244 | > |
@@ -311,7 +311,7 b' check saving last-message.txt, at first' | |||
|
311 | 311 | > def reposetup(ui, repo): |
|
312 | 312 | > class commitfailure(repo.__class__): |
|
313 | 313 | > def commit(self, *args, **kwargs): |
|
314 | > raise error.Abort('emulating unexpected abort') | |
|
314 | > raise error.Abort(b'emulating unexpected abort') | |
|
315 | 315 | > repo.__class__ = commitfailure |
|
316 | 316 | > EOF |
|
317 | 317 | $ cat >> .hg/hgrc <<EOF |
@@ -360,7 +360,7 b" isn't changed on the filesystem (see als" | |||
|
360 | 360 | > ) |
|
361 | 361 | > def applyupdates(orig, *args, **kwargs): |
|
362 | 362 | > orig(*args, **kwargs) |
|
363 | > raise error.Abort('intentional aborting') | |
|
363 | > raise error.Abort(b'intentional aborting') | |
|
364 | 364 | > def extsetup(ui): |
|
365 | 365 | > extensions.wrapfunction(merge, "applyupdates", applyupdates) |
|
366 | 366 | > EOF |
@@ -153,7 +153,7 b' Test saving last-message.txt:' | |||
|
153 | 153 | > def reposetup(ui, repo): |
|
154 | 154 | > class commitfailure(repo.__class__): |
|
155 | 155 | > def commit(self, *args, **kwargs): |
|
156 | > raise error.Abort('emulating unexpected abort') | |
|
156 | > raise error.Abort(b'emulating unexpected abort') | |
|
157 | 157 | > repo.__class__ = commitfailure |
|
158 | 158 | > EOF |
|
159 | 159 |
@@ -256,7 +256,7 b' Test saving last-message.txt' | |||
|
256 | 256 | > def reposetup(ui, repo): |
|
257 | 257 | > class commitfailure(repo.__class__): |
|
258 | 258 | > def commit(self, *args, **kwargs): |
|
259 | > raise error.Abort('emulating unexpected abort') | |
|
259 | > raise error.Abort(b'emulating unexpected abort') | |
|
260 | 260 | > repo.__class__ = commitfailure |
|
261 | 261 | > EOF |
|
262 | 262 | $ cat >> .hg/hgrc <<EOF |
@@ -230,7 +230,7 b' verify that bookmarks are not written on' | |||
|
230 | 230 | > ) |
|
231 | 231 | > def _pullbookmarks(orig, pullop): |
|
232 | 232 | > orig(pullop) |
|
233 | > raise error.HookAbort('forced failure by extension') | |
|
233 | > raise error.HookAbort(b'forced failure by extension') | |
|
234 | 234 | > def extsetup(ui): |
|
235 | 235 | > extensions.wrapfunction(exchange, '_pullbookmarks', _pullbookmarks) |
|
236 | 236 | > EOF |
@@ -153,7 +153,7 b' If importing results in no new rules bei' | |||
|
153 | 153 | > from mercurial import error, sparse |
|
154 | 154 | > def extsetup(ui): |
|
155 | 155 | > def abort_refresh(*args, **kwargs): |
|
156 | > raise error.Abort('sparse._refresh called!') | |
|
156 | > raise error.Abort(b'sparse._refresh called!') | |
|
157 | 157 | > sparse.refreshwdir = abort_refresh |
|
158 | 158 | > EOF |
|
159 | 159 | $ cat >> $HGRCPATH <<EOF |
General Comments 0
You need to be logged in to leave comments.
Login now