Edgewall Software
Modify

Opened 15 years ago

Closed 15 years ago

#8891 closed defect (fixed)

trac-admin resync crashes for TracMercurial because of extsetup

Reported by: antonxx@… Owned by: Christian Boos
Priority: high Milestone: plugin - mercurial
Component: plugin/mercurial Version: 0.11.6
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I use trac-admin (0.11.6) and do a resync of my hg repositories, and trac-admin crashes.

In the TracMercurial plugin the code in backend.py is:

if extsetup:
   extsetup()

which is wrong.

Reason: extsetup needs a parameter

I changed it to, the following:

if extsetup:
   extsetup(self.ui) #bugfix

Now trac-admin does not crash.. but I am not sure if my workaround is correct

See:

http://trac.edgewall.org/browser/sandbox/mercurial-plugin-0.11/tracext/hg/backend.py?rev=8907#L188

Attachments (0)

Change History (3)

comment:1 by Christian Boos, 15 years ago

Milestone: 0.12mercurial-plugin

Could you please confirm the following fix?

  • tracext/hg/backend.py

     
    185185                # setup extensions
    186186                extsetup = getattr(module, 'extsetup', None)
    187187                if extsetup:
    188                     extsetup()
     188                    if arity(extsetup) == 1:
     189                        extsetup(self.ui)
     190                    else:
     191                        extsetup()
    189192
    190193    def get_supported_types(self):
    191194        """Support for `repository_type = hg`"""

comment:2 by antonxx@…, 15 years ago

OK thanks,

it does not crash anymore.

I leave it up to you to close this ticket as soon as you have patched the sources ;-)

Anton

comment:3 by Christian Boos, 15 years ago

Resolution: fixed
Status: newclosed

Thanks for testing, committed in r8963 and r8964.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos 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.