1
Suggest Debian packages for some optional dependencies.
3
diff -r 06d10c5c850e hgext/bugzilla.py
4
--- a/hgext/bugzilla.py
5
+++ b/hgext/bugzilla.py
9
except ImportError, err:
10
- raise util.Abort(_('python mysql support not available: %s') % err)
11
+ raise util.Abort(_('python mysql support not available: %s') % err +
12
+ _(' (try installing the %s package)') % 'python-mysqldb')
15
raise util.Abort(_('hook type %s does not pass a changeset id') %
16
diff -r 06d10c5c850e hgext/convert/bzr.py
17
--- a/hgext/convert/bzr.py
18
+++ b/hgext/convert/bzr.py
23
- raise NoRepo('Bazaar modules could not be loaded')
24
+ raise NoRepo('Bazaar modules could not be loaded' +
25
+ _(' (try installing the %s package)') % 'bzr')
27
if not os.path.exists(os.path.join(path, '.bzr')):
28
raise NoRepo('%s does not look like a Bazaar repo' % path)
29
diff -r 06d10c5c850e hgext/convert/common.py
30
--- a/hgext/convert/common.py
31
+++ b/hgext/convert/common.py
34
class MissingTool(Exception): pass
36
-def checktool(exe, name=None, abort=True):
37
+def checktool(exe, name=None, abort=True, debname=None):
39
if not util.find_exe(exe):
40
exc = abort and util.Abort or MissingTool
41
- raise exc(_('cannot find required "%s" tool') % name)
42
+ raise exc(_('cannot find required "%s" tool') % name +
43
+ (debname and _(' (try installing the %s package)') % debname or ''))
45
class NoRepo(Exception): pass
47
diff -r 06d10c5c850e hgext/convert/cvs.py
48
--- a/hgext/convert/cvs.py
49
+++ b/hgext/convert/cvs.py
51
if not os.path.exists(cvs):
52
raise NoRepo("%s does not look like a CVS checkout" % path)
55
+ checktool('cvs', debname='cvs')
56
self.cmd = ui.config('convert', 'cvsps', 'builtin')
57
cvspsexe = self.cmd.split(None, 1)[0]
58
self.builtin = cvspsexe == 'builtin'
59
diff -r 06d10c5c850e hgext/convert/darcs.py
60
--- a/hgext/convert/darcs.py
61
+++ b/hgext/convert/darcs.py
63
if not os.path.exists(os.path.join(path, '_darcs')):
64
raise NoRepo("%s does not look like a darcs repo" % path)
67
+ checktool('darcs', debname='darcs')
69
if ElementTree is None:
70
- raise util.Abort(_("Python ElementTree module is not available"))
71
+ raise util.Abort(_("Python ElementTree module is not available") +
72
+ _(" (try installing the %s package)") % 'python-celementtree')
74
if not os.path.exists(os.path.join(path, '_darcs', 'inventory')):
75
raise NoRepo("%s does not look like a darcs repo" % path)
76
diff -r 06d10c5c850e hgext/convert/git.py
77
--- a/hgext/convert/git.py
78
+++ b/hgext/convert/git.py
80
if not os.path.exists(path + "/objects"):
81
raise NoRepo("%s does not look like a Git repo" % path)
83
- checktool('git', 'git')
84
+ checktool('git', 'git', debname='git-core')
88
diff -r 06d10c5c850e hgext/convert/gnuarch.py
89
--- a/hgext/convert/gnuarch.py
90
+++ b/hgext/convert/gnuarch.py
92
if util.find_exe('tla'):
95
- raise util.Abort(_('cannot find a GNU Arch tool'))
96
+ raise util.Abort(_('cannot find a GNU Arch tool') +
97
+ _(' (try installing the %s package)') % 'tla')
99
commandline.__init__(self, ui, self.execmd)
101
diff -r 06d10c5c850e hgext/convert/monotone.py
102
--- a/hgext/convert/monotone.py
103
+++ b/hgext/convert/monotone.py
105
if not os.path.exists(path):
108
- checktool('mtn', abort=False)
109
+ checktool('mtn', abort=False, debname='monotone')
111
# test if there are any revisions
113
diff -r 06d10c5c850e hgext/convert/subversion.py
114
--- a/hgext/convert/subversion.py
115
+++ b/hgext/convert/subversion.py
118
from common import NoRepo, MissingTool, commit, encodeargs, decodeargs
119
from common import commandline, converter_source, converter_sink, mapfile
120
+from common import checktool
123
from svn.core import SubversionException, Pool
124
@@ -155,16 +156,19 @@
128
- raise MissingTool(_('Subversion python bindings could not be loaded'))
129
+ raise MissingTool(_('Subversion python bindings could not be loaded') +
130
+ _(' (try installing the %s package)') % 'python-subversion')
133
version = svn.core.SVN_VER_MAJOR, svn.core.SVN_VER_MINOR
135
raise MissingTool(_('Subversion python bindings %d.%d found, '
136
- '1.4 or later required') % version)
137
+ '1.4 or later required') % version +
138
+ _(' (try upgrading the %s package)') % 'python-subversion')
139
except AttributeError:
140
raise MissingTool(_('Subversion python bindings are too old, 1.4 '
141
- 'or later required'))
142
+ 'or later required') +
143
+ _(' (try upgrading the %s package)') % 'python-subversion')
145
self.encoding = locale.getpreferredencoding()
148
return self.join('hg-authormap')
150
def __init__(self, ui, path):
151
+ checktool('svn', debname='subversion')
152
+ checktool('svnadmin', debname='subversion')
154
converter_sink.__init__(self, ui, path)
155
commandline.__init__(self, ui, 'svn')
157
diff -r 06d10c5c850e mercurial/hgweb/server.py
158
--- a/mercurial/hgweb/server.py
159
+++ b/mercurial/hgweb/server.py
161
from OpenSSL import SSL
162
ctx = SSL.Context(SSL.SSLv23_METHOD)
164
- raise util.Abort(_("SSL support is unavailable"))
165
+ raise util.Abort(_("SSL support is unavailable") +
166
+ _(" (try installing the %s package)") % 'python-openssl')
167
ctx.use_privatekey_file(ssl_cert)
168
ctx.use_certificate_file(ssl_cert)
169
sock = socket.socket(self.address_family, self.socket_type)