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