diff --git a/tracext/hg/backend.py b/tracext/hg/backend.py
|
a
|
b
|
|
| 217 | 217 | else: |
| 218 | 218 | yield ("hg", 8) |
| 219 | 219 | |
| 220 | | def get_repository(self, type, dir, repo_options): |
| | 220 | def get_repository(self, type, dir, params): |
| 221 | 221 | """Return a `MercurialRepository`""" |
| 222 | 222 | if not self._version: |
| 223 | 223 | try: |
| … |
… |
|
| 236 | 236 | options = {} |
| 237 | 237 | for key, val in self.config.options(type): |
| 238 | 238 | options[key] = val |
| 239 | | if isinstance(repo_options, basestring): # 0.11 compat |
| 240 | | repo_options = {'username': repo_options} |
| 241 | | options.update(repo_options) |
| | 239 | options.update(params) |
| 242 | 240 | if not self.ui: |
| 243 | 241 | self._setup_ui(options.get('hgrc')) |
| 244 | | repos = MercurialRepository(repo_options['name'], repo_options['id'], |
| 245 | | dir, self.log, self.ui, options) |
| | 242 | repos = MercurialRepository(dir, options, self.log, self.ui) |
| 246 | 243 | repos.version_info = self._version_info |
| 247 | 244 | return repos |
| 248 | 245 | |
| … |
… |
|
| 324 | 321 | additional changeset properties. |
| 325 | 322 | """ |
| 326 | 323 | |
| 327 | | def __init__(self, reponame, id, path, log, ui, options): |
| | 324 | def __init__(self, path, params, log, ui): |
| 328 | 325 | self.ui = ui |
| 329 | | self.options = options |
| 330 | | self.reponame = None |
| 331 | 326 | # TODO: per repository ui and options? |
| 332 | 327 | if isinstance(path, unicode): |
| 333 | 328 | str_path = path.encode('utf-8') |
| … |
… |
|
| 340 | 335 | except RepoError, e: |
| 341 | 336 | self.path = None |
| 342 | 337 | self._show_rev = True |
| 343 | | if 'show_rev' in options and not options['show_rev'] in TRUE: |
| | 338 | if 'show_rev' in params and not params['show_rev'] in TRUE: |
| 344 | 339 | self._show_rev = False |
| 345 | | self._node_fmt = 'node_format' in options \ |
| 346 | | and options['node_format'] # will default to 'short' |
| | 340 | self._node_fmt = 'node_format' in params \ |
| | 341 | and params['node_format'] # will default to 'short' |
| 347 | 342 | if self.path is None: |
| 348 | 343 | raise TracError(_("%(path)s does not appear to contain a Mercurial" |
| 349 | 344 | " repository.", path=path)) |
| 350 | | Repository.__init__(self, reponame, id, 'hg:%s' % path, None, log) |
| | 345 | Repository.__init__(self, 'hg:%s' % path, params, None, log) |
| 351 | 346 | |
| 352 | 347 | def hg_time(self, timeinfo): |
| 353 | 348 | # [hg b47f96a178a3] introduced an API change: |
| … |
… |
|
| 449 | 444 | pass |
| 450 | 445 | |
| 451 | 446 | def get_path_url(self, path, rev): |
| 452 | | url = self.options.get('url') |
| | 447 | url = self.params.get('url') |
| 453 | 448 | if url and (not path or path == '/'): |
| 454 | 449 | if not rev: |
| 455 | 450 | return url |
| … |
… |
|
| 809 | 804 | def get_content_type(self): |
| 810 | 805 | if self.isdir: |
| 811 | 806 | return None |
| 812 | | if 'mq' in self.repos.options: |
| | 807 | if 'mq' in self.repos.params: |
| 813 | 808 | if self.path not in ('.hgignore', 'series'): |
| 814 | 809 | return 'text/x-diff' |
| 815 | 810 | return '' |