Changes between Initial Version and Version 1 of Ticket #11436, comment 5


Ignore:
Timestamp:
Dec 19, 2013, 11:40:43 AM (17 months ago)
Author:
jun66j5
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11436, comment 5

    initial v1  
    88That sounds good.
    99
    10 {{{#!diff
    11 diff --git a/trachacks/web_ui.py b/trachacks/web_ui.py
    12 index cb277d3..84d34f4 100644
    13 --- a/trachacks/web_ui.py
    14 +++ b/trachacks/web_ui.py
    15 @@ -166,9 +166,6 @@ class TracHacksHandler(Component):
    16          'Default maximum number of hacks to display.')
    17      template = Option('trachacks', 'template', 'NewHackTemplate',
    18          'Name of wiki page that serves as template for new hacks.')
    19 -    svnbase = Option('trachacks', 'subversion_base_url',
    20 -        'http://trac-hacks.org/svn',
    21 -        'Base URL of the Subversion repository.')
    22      lockfile = Option('trachacks', 'lock_file', '/var/tmp/newhack.lock',
    23          'Path and name of lockfile to secure new hack creation')
    24 
    25 @@ -381,13 +378,15 @@ class TracHacksHandler(Component):
    26              context = self.form.validate(data)
    27              data['form_context'] = context
    28 
    29 +            repos = self.env.get_repository()
    30 +
    31              vars = {}
    32              vars['OWNER'] = req.authname
    33              vars['WIKINAME'] = get_page_name(data['name'], data.get('type', ''))
    34              vars['TYPE'] = data.setdefault('type', 'plugin')
    35              vars['TITLE'] = data.setdefault('title', 'No title available')
    36              vars['LCNAME'] = vars['WIKINAME'].lower()
    37 -            vars['SOURCEURL'] = '%s/%s' % (self.svnbase, vars['LCNAME'])
    38 +            vars['SOURCEURL'] = repos.get_path_url(vars['LCNAME'], None) or \
    39 +                                'http://localhost/svn/' + vars['LCNAME']
    40              vars['DESCRIPTION'] = data.setdefault('description',
    41                                                    'No description available')
    42              vars['EXAMPLE'] = data.setdefault('example',
    43 @@ -514,8 +513,8 @@ class TracHacksHandler(Component):
    44 
    45          env = os.environ.copy()
    46          env['LC_ALL'] = env['LANG'] = 'en_US.UTF-8'
    47 -        svn_path = 'file://%s' % self.config.get('trac', 'repository_dir')
    48 -        svn_path = svn_path.rstrip('/')
    49 +        repos = self.env.get_repository()
    50 +        svn_path = ('file://%s' % repos.params['dir']).rstrip('/')
    51          paths = ['%s/%s' % (svn_path, hack_path)]
    52          paths.extend('%s/%s/%s' % (svn_path, hack_path, release)
    53                       for release in selected_releases
    54 }}}
     10Proposed changes in https://github.com/jun66j5/trachacksplugin/compare/t11436.