##// END OF EJS Templates
i18n: translate abort messages...
liscju -
r29389:98e8313d default
parent child Browse files
Show More
@@ -291,7 +291,7 b' class bundlerepository(localrepo.localre'
291 ".cg%sun" % version)
291 ".cg%sun" % version)
292
292
293 if cgstream is None:
293 if cgstream is None:
294 raise error.Abort('No changegroups found')
294 raise error.Abort(_('No changegroups found'))
295 cgstream.seek(0)
295 cgstream.seek(0)
296
296
297 self.bundle = changegroup.getunbundler(version, cgstream, 'UN')
297 self.bundle = changegroup.getunbundler(version, cgstream, 'UN')
@@ -858,14 +858,14 b' def _pushbundle2(pushop):'
858 try:
858 try:
859 reply = pushop.remote.unbundle(stream, ['force'], 'push')
859 reply = pushop.remote.unbundle(stream, ['force'], 'push')
860 except error.BundleValueError as exc:
860 except error.BundleValueError as exc:
861 raise error.Abort('missing support for %s' % exc)
861 raise error.Abort(_('missing support for %s') % exc)
862 try:
862 try:
863 trgetter = None
863 trgetter = None
864 if pushback:
864 if pushback:
865 trgetter = pushop.trmanager.transaction
865 trgetter = pushop.trmanager.transaction
866 op = bundle2.processbundle(pushop.repo, reply, trgetter)
866 op = bundle2.processbundle(pushop.repo, reply, trgetter)
867 except error.BundleValueError as exc:
867 except error.BundleValueError as exc:
868 raise error.Abort('missing support for %s' % exc)
868 raise error.Abort(_('missing support for %s') % exc)
869 except bundle2.AbortFromPart as exc:
869 except bundle2.AbortFromPart as exc:
870 pushop.ui.status(_('remote: %s\n') % exc)
870 pushop.ui.status(_('remote: %s\n') % exc)
871 raise error.Abort(_('push failed on remote'), hint=exc.hint)
871 raise error.Abort(_('push failed on remote'), hint=exc.hint)
@@ -1325,7 +1325,7 b' def _pullbundle2(pullop):'
1325 try:
1325 try:
1326 op = bundle2.processbundle(pullop.repo, bundle, pullop.gettransaction)
1326 op = bundle2.processbundle(pullop.repo, bundle, pullop.gettransaction)
1327 except error.BundleValueError as exc:
1327 except error.BundleValueError as exc:
1328 raise error.Abort('missing support for %s' % exc)
1328 raise error.Abort(_('missing support for %s') % exc)
1329
1329
1330 if pullop.fetch:
1330 if pullop.fetch:
1331 results = [cg['return'] for cg in op.records['changegroup']]
1331 results = [cg['return'] for cg in op.records['changegroup']]
@@ -484,7 +484,8 b' def clone(ui, peeropts, source, dest=Non'
484 sharepath = os.path.join(
484 sharepath = os.path.join(
485 sharepool, hashlib.sha1(source).hexdigest())
485 sharepool, hashlib.sha1(source).hexdigest())
486 else:
486 else:
487 raise error.Abort('unknown share naming mode: %s' % sharenamemode)
487 raise error.Abort(_('unknown share naming mode: %s') %
488 sharenamemode)
488
489
489 if sharepath:
490 if sharepath:
490 return clonewithshare(ui, peeropts, sharepath, source, srcpeer,
491 return clonewithshare(ui, peeropts, sharepath, source, srcpeer,
@@ -968,7 +968,7 b' class manifest(revlog.revlog):'
968 return self.readdelta(node)
968 return self.readdelta(node)
969 if self._usemanifestv2:
969 if self._usemanifestv2:
970 raise error.Abort(
970 raise error.Abort(
971 "readshallowdelta() not implemented for manifestv2")
971 _("readshallowdelta() not implemented for manifestv2"))
972 r = self.rev(node)
972 r = self.rev(node)
973 d = mdiff.patchtext(self.revdiff(self.deltaparent(r), r))
973 d = mdiff.patchtext(self.revdiff(self.deltaparent(r), r))
974 return manifestdict(d)
974 return manifestdict(d)
@@ -38,7 +38,7 b' def _expandsets(kindpats, ctx, listsubre'
38 for kind, pat, source in kindpats:
38 for kind, pat, source in kindpats:
39 if kind == 'set':
39 if kind == 'set':
40 if not ctx:
40 if not ctx:
41 raise error.Abort("fileset expression with no context")
41 raise error.Abort(_("fileset expression with no context"))
42 s = ctx.getfileset(pat)
42 s = ctx.getfileset(pat)
43 fset.update(s)
43 fset.update(s)
44
44
@@ -600,8 +600,8 b' class obsstore(object):'
600 Take care of filtering duplicate.
600 Take care of filtering duplicate.
601 Return the number of new marker."""
601 Return the number of new marker."""
602 if self._readonly:
602 if self._readonly:
603 raise error.Abort('creating obsolete markers is not enabled on '
603 raise error.Abort(_('creating obsolete markers is not enabled on '
604 'this repo')
604 'this repo'))
605 known = set(self._all)
605 known = set(self._all)
606 new = []
606 new = []
607 for m in markers:
607 for m in markers:
@@ -1234,7 +1234,7 b' def createmarkers(repo, relations, flag='
1234 localmetadata.update(rel[2])
1234 localmetadata.update(rel[2])
1235
1235
1236 if not prec.mutable():
1236 if not prec.mutable():
1237 raise error.Abort("cannot obsolete public changeset: %s"
1237 raise error.Abort(_("cannot obsolete public changeset: %s")
1238 % prec,
1238 % prec,
1239 hint='see "hg help phases" for details')
1239 hint='see "hg help phases" for details')
1240 nprec = prec.node()
1240 nprec = prec.node()
@@ -1243,7 +1243,8 b' def createmarkers(repo, relations, flag='
1243 if not nsucs:
1243 if not nsucs:
1244 npare = tuple(p.node() for p in prec.parents())
1244 npare = tuple(p.node() for p in prec.parents())
1245 if nprec in nsucs:
1245 if nprec in nsucs:
1246 raise error.Abort("changeset %s cannot obsolete itself" % prec)
1246 raise error.Abort(_("changeset %s cannot obsolete itself")
1247 % prec)
1247
1248
1248 # Creating the marker causes the hidden cache to become invalid,
1249 # Creating the marker causes the hidden cache to become invalid,
1249 # which causes recomputation when we ask for prec.parents() above.
1250 # which causes recomputation when we ask for prec.parents() above.
@@ -2663,7 +2663,8 b' def formatspec(expr, *args):'
2663 ret += listexp(list(args[arg]), d)
2663 ret += listexp(list(args[arg]), d)
2664 arg += 1
2664 arg += 1
2665 else:
2665 else:
2666 raise error.Abort('unexpected revspec format character %s' % d)
2666 raise error.Abort(_('unexpected revspec format character %s')
2667 % d)
2667 else:
2668 else:
2668 ret += c
2669 ret += c
2669 pos += 1
2670 pos += 1
@@ -468,7 +468,8 b' class abstractvfs(object):'
468 # have a use case.
468 # have a use case.
469 vfs = getattr(self, 'vfs', self)
469 vfs = getattr(self, 'vfs', self)
470 if getattr(vfs, '_backgroundfilecloser', None):
470 if getattr(vfs, '_backgroundfilecloser', None):
471 raise error.Abort('can only have 1 active background file closer')
471 raise error.Abort(
472 _('can only have 1 active background file closer'))
472
473
473 with backgroundfilecloser(ui, expectedcount=expectedcount) as bfc:
474 with backgroundfilecloser(ui, expectedcount=expectedcount) as bfc:
474 try:
475 try:
@@ -590,8 +591,9 b' class vfs(abstractvfs):'
590
591
591 if backgroundclose:
592 if backgroundclose:
592 if not self._backgroundfilecloser:
593 if not self._backgroundfilecloser:
593 raise error.Abort('backgroundclose can only be used when a '
594 raise error.Abort(_('backgroundclose can only be used when a '
594 'backgroundclosing context manager is active')
595 'backgroundclosing context manager is active')
596 )
595
597
596 fp = delayclosedfile(fp, self._backgroundfilecloser)
598 fp = delayclosedfile(fp, self._backgroundfilecloser)
597
599
@@ -662,7 +664,7 b' class readonlyvfs(abstractvfs, auditvfs)'
662
664
663 def __call__(self, path, mode='r', *args, **kw):
665 def __call__(self, path, mode='r', *args, **kw):
664 if mode not in ('r', 'rb'):
666 if mode not in ('r', 'rb'):
665 raise error.Abort('this vfs is read only')
667 raise error.Abort(_('this vfs is read only'))
666 return self.vfs(path, mode, *args, **kw)
668 return self.vfs(path, mode, *args, **kw)
667
669
668 def join(self, path, *insidef):
670 def join(self, path, *insidef):
@@ -1383,8 +1385,8 b' class backgroundfilecloser(object):'
1383 def close(self, fh):
1385 def close(self, fh):
1384 """Schedule a file for closing."""
1386 """Schedule a file for closing."""
1385 if not self._entered:
1387 if not self._entered:
1386 raise error.Abort('can only call close() when context manager '
1388 raise error.Abort(_('can only call close() when context manager '
1387 'active')
1389 'active'))
1388
1390
1389 # If a background thread encountered an exception, raise now so we fail
1391 # If a background thread encountered an exception, raise now so we fail
1390 # fast. Otherwise we may potentially go on for minutes until the error
1392 # fast. Otherwise we may potentially go on for minutes until the error
@@ -307,7 +307,7 b' class sshpeer(wireproto.wirepeer):'
307 r = self._call(cmd, **args)
307 r = self._call(cmd, **args)
308 if r:
308 if r:
309 # XXX needs to be made better
309 # XXX needs to be made better
310 raise error.Abort('unexpected remote reply: %s' % r)
310 raise error.Abort(_('unexpected remote reply: %s') % r)
311 while True:
311 while True:
312 d = fp.read(4096)
312 d = fp.read(4096)
313 if not d:
313 if not d:
@@ -11,6 +11,7 b' from __future__ import absolute_import'
11 import os
11 import os
12 import sys
12 import sys
13
13
14 from .i18n import _
14 from . import (
15 from . import (
15 error,
16 error,
16 hook,
17 hook,
@@ -40,7 +41,7 b' class sshserver(wireproto.abstractserver'
40 argline = self.fin.readline()[:-1]
41 argline = self.fin.readline()[:-1]
41 arg, l = argline.split()
42 arg, l = argline.split()
42 if arg not in keys:
43 if arg not in keys:
43 raise error.Abort("unexpected parameter %r" % arg)
44 raise error.Abort(_("unexpected parameter %r") % arg)
44 if arg == '*':
45 if arg == '*':
45 star = {}
46 star = {}
46 for k in xrange(int(l)):
47 for k in xrange(int(l)):
@@ -76,15 +76,15 b' except AttributeError:'
76
76
77 def load_verify_locations(self, cafile=None, capath=None, cadata=None):
77 def load_verify_locations(self, cafile=None, capath=None, cadata=None):
78 if capath:
78 if capath:
79 raise error.Abort('capath not supported')
79 raise error.Abort(_('capath not supported'))
80 if cadata:
80 if cadata:
81 raise error.Abort('cadata not supported')
81 raise error.Abort(_('cadata not supported'))
82
82
83 self._cacerts = cafile
83 self._cacerts = cafile
84
84
85 def set_ciphers(self, ciphers):
85 def set_ciphers(self, ciphers):
86 if not self._supportsciphers:
86 if not self._supportsciphers:
87 raise error.Abort('setting ciphers not supported')
87 raise error.Abort(_('setting ciphers not supported'))
88
88
89 self._ciphers = ciphers
89 self._ciphers = ciphers
90
90
@@ -229,7 +229,7 b' def wrapsocket(sock, keyfile, certfile, '
229 to use.
229 to use.
230 """
230 """
231 if not serverhostname:
231 if not serverhostname:
232 raise error.Abort('serverhostname argument is required')
232 raise error.Abort(_('serverhostname argument is required'))
233
233
234 settings = _hostsettings(ui, serverhostname)
234 settings = _hostsettings(ui, serverhostname)
235
235
@@ -1414,7 +1414,7 b' class gitsubrepo(abstractsubrepo):'
1414 if command in ('cat-file', 'symbolic-ref'):
1414 if command in ('cat-file', 'symbolic-ref'):
1415 return retdata, p.returncode
1415 return retdata, p.returncode
1416 # for all others, abort
1416 # for all others, abort
1417 raise error.Abort('git %s error %d in %s' %
1417 raise error.Abort(_('git %s error %d in %s') %
1418 (command, p.returncode, self._relpath))
1418 (command, p.returncode, self._relpath))
1419
1419
1420 return retdata, p.returncode
1420 return retdata, p.returncode
General Comments 0
You need to be logged in to leave comments. Login now