Edgewall Software
Modify

Opened 21 months ago

Last modified 14 months ago

#12176 assigned enhancement

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:
Release Notes:
API 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 (3)

comment:1 Changed 21 months ago by Jun Omae

Component: version controlplugin/mercurial
Milestone: plugin - mercurial

TracMercurial should log the import errors, not IRepositoryConnector component.

comment:2 Changed 21 months ago by Jun Omae

Owner: set to Jun Omae
Status: newassigned
Summary: Log IRepositoryConnector errorMercurialConnector should log the import errors
  • tracext/hg/backend.py

    diff -r 7be798c48b82 tracext/hg/backend.py
    a b  
    118118    has_phasestr = None
    119119
    120120except ImportError, e:
    121     hg_import_error = e
     121    hg_import_error = exception_to_unicode(e)
    122122    ui = object
    123123
    124124
     
    391391        locale_dir = pkg_resources.resource_filename(__name__, 'locale')
    392392        add_domain(self.env.path, locale_dir)
    393393        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:
    395398            try:
    396399                from mercurial.version import get_version
    397400                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)
Last edited 21 months ago by Jun Omae (previous) (diff)

comment:3 Changed 14 months ago by Jun Omae

#11911 was closed as duplicate.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as assigned The owner will remain Jun Omae.
The ticket will be disowned. Next status will be 'new'.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from Jun Omae to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .

 
Note: See TracTickets for help on using tickets.