Modify

Opened 8 years ago

Closed 7 years ago

#12631 closed defect (fixed)

TracSvnPoliciesPlugin and Trac 1.0

Reported by: esj@… Owned by: Ryan J Ollos
Priority: normal Component: TracSvnPoliciesPlugin
Severity: critical Keywords:
Cc: Trac Release: 1.0

Description (last modified by Ryan J Ollos)

This plugin is not compatible with Trac 1.0: it causes an error when submitting its main web-form. After reading the code, I discover that the problem lies in the _get_svn_hook_path function, because the repository_type and repository_dir fields are no longer in the [trac] section but in the [repositories] section, moreover with new names since Trac 1.0 allows multiple repositories.

Here is a new definition assuming there is a default SVN repository declared with .alias in the [repositories] section:

    def _get_svn_hook_path(self):
        """
        This method returns the path on the system where the
        svn server expects the hook file to be present. The trac 
        configuration file provides the svn repository information.
        
        @return: String
        If a error ocurs in the process of getting the path the method 
        returns None.
        """
        return None
        try :
            rep_type = self.config.get('trac', 'repository_type') 
            repository = self.config.get('trac', 'repository_dir')
            if (rep_type == 'svn') and path.isdir(repository) :
                return str(repository) + os.path.sep +'hooks'
            else :
                proj = self.config.get('repositories', '.alias')
                rep_type = self.config.get('repositories', proj + '.type') 
                repository = self.config.get('repositories',  proj + '.dir')
                if (rep_type == 'svn') and path.isdir(repository) :
                    return str(repository) + os.path.sep +'hooks'

        except Exception, e:
            self.log.error(traceback.format_exc())
            self.log.error(e)
            return None

Does anyone has rights to commit the proposed definition ? However, this plugin should be rewritten more drastically to fully handle multiple projects. Is is still maintained ?

Attachments (0)

Change History (5)

comment:1 in reply to:  description Changed 8 years ago by Ryan J Ollos

Owner: Robert Corsaro deleted

Replying to esj@…:

Is is still maintained ?

The plugin author is no longer involved with Trac development. I've added the needsadoption tag to the project page.

comment:2 Changed 7 years ago by Ryan J Ollos

Description: modified (diff)

comment:3 in reply to:  description Changed 7 years ago by Ryan J Ollos

Replying to esj@…:

This plugin is not compatible with Trac 1.0: it causes an error when submitting its main web-form. After reading the code, I discover that the problem lies in the _get_svn_hook_path function, because the repository_type and repository_dir fields are no longer in the [trac] section but in the [repositories] section, moreover with new names since Trac 1.0 allows multiple repositories.

Your patch was applied in r15259. I'll commit some modifications that will support the case of a repository defined in a DbRepositoryProvider.

I won't address multi-repository support now. If anyone really needs it, please open a new ticket.

comment:4 Changed 7 years ago by Ryan J Ollos

Owner: set to Ryan J Ollos
Status: newaccepted

comment:5 Changed 7 years ago by Ryan J Ollos

Resolution: fixed
Status: acceptedclosed

In 16090:

1.0dev: Make compatible with Trac 1.0 and later

  • Read default repository from any provider. Fixes #12631.
  • Moved to Version Control section of admin panel
  • Removed permission PROJECT_ADMIN
  • TRAC_ADMIN restricts access to the admin panels. TracFineGrainedPermissions can be used to grant access to the resource general/svnpolicies
  • Fixed threading problems due to class-scope attributes (some possible issues remain)
  • Enable post-commit hook when enabling ticket control commands. Fixes #4049.
  • Remove dependency on trac-post-commit-hook. Fixes #4038.
  • Conform to PEP8

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.