Package: mercurial / 4.9-2

deb_specific__optional-dependencies Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
Suggest Debian packages for some optional dependencies.

--- mercurial.orig/hgext/bugzilla.py
+++ mercurial/hgext/bugzilla.py
@@ -455,7 +455,8 @@ class bzmysql(bzaccess):
             import MySQLdb as mysql
             bzmysql._MySQLdb = mysql
         except ImportError as err:
-            raise error.Abort(_('python mysql support not available: %s') % err)
+            raise error.Abort(_('python mysql support not available: %s') % err +
+                              _(' (try installing the %s package)') % 'python-mysqldb')
 
         bzaccess.__init__(self, ui)
 
--- mercurial.orig/hgext/convert/bzr.py
+++ mercurial/hgext/convert/bzr.py
@@ -55,7 +55,8 @@ class bzr_source(common.converter_source
             # access bzrlib stuff
             bzrdir
         except NameError:
-            raise common.NoRepo(_('Bazaar modules could not be loaded'))
+            raise common.NoRepo(_('Bazaar modules could not be loaded') +
+                         _(' (try installing the %s package)') % 'bzr')
 
         path = os.path.abspath(path)
         self._checkrepotype(path)
--- mercurial.orig/hgext/convert/common.py
+++ mercurial/hgext/convert/common.py
@@ -97,14 +97,15 @@ def decodeargs(s):
 class MissingTool(Exception):
     pass
 
-def checktool(exe, name=None, abort=True):
+def checktool(exe, name=None, abort=True, debname=None):
     name = name or exe
     if not procutil.findexe(exe):
         if abort:
             exc = error.Abort
         else:
             exc = MissingTool
-        raise exc(_('cannot find required "%s" tool') % name)
+        raise exc(_('cannot find required "%s" tool') % name +
+                  (debname and _(' (try installing the %s package)') % debname or ''))
 
 class NoRepo(Exception):
     pass
--- mercurial.orig/hgext/convert/cvs.py
+++ mercurial/hgext/convert/cvs.py
@@ -42,7 +42,7 @@ class convert_cvs(converter_source):
         if not os.path.exists(cvs):
             raise NoRepo(_("%s does not look like a CVS checkout") % path)
 
-        checktool('cvs')
+        checktool('cvs', debname='cvs')
 
         self.changeset = None
         self.files = {}
--- mercurial.orig/hgext/convert/darcs.py
+++ mercurial/hgext/convert/darcs.py
@@ -51,14 +51,15 @@ class darcs_source(common.converter_sour
         if not os.path.exists(os.path.join(path, '_darcs')):
             raise NoRepo(_("%s does not look like a darcs repository") % path)
 
-        common.checktool('darcs')
+        common.checktool('darcs', debname='darcs')
         version = self.run0('--version').splitlines()[0].strip()
         if version < '2.1':
             raise error.Abort(_('darcs version 2.1 or newer needed (found %r)')
                               % version)
 
         if "ElementTree" not in globals():
-            raise error.Abort(_("Python ElementTree module is not available"))
+            raise error.Abort(_("Python ElementTree module is not available") +
+                              _(" (try installing the %s package)") % 'python-celementtree')
 
         self.path = os.path.realpath(path)
 
--- mercurial.orig/hgext/convert/git.py
+++ mercurial/hgext/convert/git.py
@@ -95,7 +95,7 @@ class convert_git(common.converter_sourc
         else:
             self.simopt = []
 
-        common.checktool('git', 'git')
+        common.checktool('git', 'git', debname="git-core")
 
         self.path = path
         self.submodules = []
--- mercurial.orig/hgext/convert/gnuarch.py
+++ mercurial/hgext/convert/gnuarch.py
@@ -56,7 +56,8 @@ class gnuarch_source(common.converter_so
             if procutil.findexe('tla'):
                 self.execmd = 'tla'
             else:
-                raise error.Abort(_('cannot find a GNU Arch tool'))
+                raise error.Abort(_('cannot find a GNU Arch tool') +
+                                  _(' (try installing the %s package)') % 'tla')
 
         common.commandline.__init__(self, ui, self.execmd)
 
--- mercurial.orig/hgext/convert/monotone.py
+++ mercurial/hgext/convert/monotone.py
@@ -76,7 +76,7 @@ class monotone_source(common.converter_s
         self.files = None
         self.dirs  = None
 
-        common.checktool('mtn', abort=False)
+        common.checktool('mtn', abort=False, debname='monotone')
 
     def mtnrun(self, *args, **kwargs):
         if self.automatestdio:
--- mercurial.orig/hgext/convert/subversion.py
+++ mercurial/hgext/convert/subversion.py
@@ -299,16 +299,19 @@ class svn_source(converter_source):
             raise NoRepo(_("%s does not look like a Subversion repository")
                          % url)
         if svn is None:
-            raise MissingTool(_('could not load Subversion python bindings'))
+            raise MissingTool(_('could not load Subversion python bindings') +
+                              _(' (try installing the %s package)') % 'python-subversion')
 
         try:
             version = svn.core.SVN_VER_MAJOR, svn.core.SVN_VER_MINOR
             if version < (1, 4):
                 raise MissingTool(_('Subversion python bindings %d.%d found, '
-                                    '1.4 or later required') % version)
+                                    '1.4 or later required') % version +
+                                  _(' (try upgrading the %s package)') % 'python-subversion')
         except AttributeError:
             raise MissingTool(_('Subversion python bindings are too old, 1.4 '
-                                'or later required'))
+                                'or later required') +
+                              _(' (try upgrading the %s package)') % 'python-subversion')
 
         self.lastrevs = {}
 
@@ -1119,6 +1122,8 @@ class svn_sink(converter_sink, commandli
         return self.join('hg-authormap')
 
     def __init__(self, ui, repotype, path):
+        common.checktool('svn', debname='subversion')
+        common.checktool('svnadmin', debname='subversion')
 
         converter_sink.__init__(self, ui, repotype, path)
         commandline.__init__(self, ui, 'svn')
--- mercurial.orig/mercurial/hgweb/server.py
+++ mercurial/mercurial/hgweb/server.py
@@ -271,7 +271,8 @@ class _httprequesthandlerssl(_httpreques
             from .. import sslutil
             sslutil.modernssl
         except ImportError:
-            raise error.Abort(_("SSL support is unavailable"))
+            raise error.Abort(_("SSL support is unavailable") +
+                              _(" (try installing the %s package)") % 'python-openssl')
 
         certfile = ui.config('web', 'certificate')
 
--- mercurial.orig/mercurial/sslutil.py
+++ mercurial/mercurial/sslutil.py
@@ -253,7 +253,9 @@ def _hostsettings(ui, hostname):
                 cafile = util.expandpath(cafile)
                 if not os.path.exists(cafile):
                     raise error.Abort(_('could not find web.cacerts: %s') %
-                                      cafile)
+                                      cafile +
+                                      _(' (try installing the %s package)') %
+                                        'ca-certificates')
             elif s['allowloaddefaultcerts']:
                 # CAs not defined in config. Try to find system bundles.
                 cafile = _defaultcacerts(ui)
--- mercurial.orig/tests/test-https.t
+++ mercurial/tests/test-https.t
@@ -29,7 +29,7 @@ cacert not found
 
   $ hg in --config web.cacerts=no-such.pem https://localhost:$HGPORT/
   warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
-  abort: could not find web.cacerts: no-such.pem
+  abort: could not find web.cacerts: no-such.pem (try installing the ca-certificates package)
   [255]
 
 Test server address cannot be reused