Opened 8 years ago
Last modified 7 years ago
#12631 closed defect
TracSvnPoliciesPlugin and Trac 1.0 — at Initial Version
Reported by: | Owned by: | Robert Corsaro | |
---|---|---|---|
Priority: | normal | Component: | TracSvnPoliciesPlugin |
Severity: | critical | Keywords: | |
Cc: | Trac Release: | 1.0 |
Description
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 projects.
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 ?