Modify ↓
Opened 9 years ago
Closed 6 years ago
#12176 closed enhancement (fixed)
MercurialConnector should log the import errors
Reported by: | anonymous | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Milestone: | plugin - mercurial |
Component: | plugin/mercurial | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Log import errors. |
||
API Changes: | |||
Internal Changes: |
Description
If the Browse Source main item is not shown because get_real_repositories() no errors are logged.
With the mercurial plugin it's hard to figure out why it's not working. Nowhere is it logged if the mercurial module can not be imported.
Attachments (0)
Change History (4)
comment:1 by , 9 years ago
Component: | version control → plugin/mercurial |
---|---|
Milestone: | → plugin - mercurial |
comment:2 by , 9 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
Summary: | Log IRepositoryConnector error → MercurialConnector should log the import errors |
-
tracext/hg/backend.py
diff -r 7be798c48b82 tracext/hg/backend.py
a b 118 118 has_phasestr = None 119 119 120 120 except ImportError, e: 121 hg_import_error = e 121 hg_import_error = exception_to_unicode(e) 122 122 ui = object 123 123 124 124 … … 391 391 locale_dir = pkg_resources.resource_filename(__name__, 'locale') 392 392 add_domain(self.env.path, locale_dir) 393 393 self._version = self._version_info = None 394 if not hg_import_error: 394 if hg_import_error: 395 self.log.warn('Failed to load Mercurial bindings (%s)', 396 hg_import_error) 397 else: 395 398 try: 396 399 from mercurial.version import get_version 397 400 self._version = get_version()
After the patch, the following warning would be logged.
11:00:43 PM Trac[backend] WARNING: Failed to load Mercurial bindings (ImportError: No module named mercurial)
comment:4 by , 6 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Pushed changes from comment:2 in [59/mercurial-plugin].
Note:
See TracTickets
for help on using tickets.
TracMercurial should log the import errors, not
IRepositoryConnector
component.