Opened 12 years ago
Closed 12 years ago
#10843 closed defect (fixed)
Adding bibfile from svn source fails with Trac 1.0 and tracbibplugin-r12578
Reported by: | anonymous | Owned by: | Roman Mohr |
---|---|---|---|
Priority: | normal | Component: | TracBibPlugin |
Severity: | blocker | Keywords: | BibtexSourceSource |
Cc: | Trac Release: | 1.0 |
Description
On a Trac 1.0 instance I installed the trunk version of tracbibplugin-r12578.zip. Having the following repository setup
[repositories] project.description = This is the ''main'' project repository. project.dir = /var/share/svn/myrepo project.type = svn project.url = https://myserver/repos/myrepo
a wiki page with the BibAdd macro
[[BibAdd(source:project/trunk/vat.bib)]]
produces the following error (the source path was verified to be accessible with a simple [source:project/trunk/vat.bib]
-macro):
2013-01-29 17:32:12,223 Trac[formatter] DEBUG: Executing Wiki macro BibAdd by provider <tracbib.tracbib.BibAddMacro object at 0x7f19eae6dad0> 2013-01-29 17:32:12,227 Trac[formatter] ERROR: Macro BibAdd(source:project/trunk/vat.bib) failed: Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/trac/wiki/formatter.py", line 765, in _macro_formatter return macro.ensure_inline(macro.process(args)) File "/usr/local/lib/python2.7/dist-packages/trac/wiki/formatter.py", line 356, in process text = self.processor(text) File "/usr/local/lib/python2.7/dist-packages/trac/wiki/formatter.py", line 343, in _macro_processor text) File "build/bdist.linux-x86_64/egg/tracbib/tracbib.py", line 198, in expand_macro loaded.append(source.source(formatter.req, args[0])) File "build/bdist.linux-x86_64/egg/tracbib/source.py", line 91, in source bib = repos.get_node(file, revision) AttributeError: 'NoneType' object has no attribute 'get_node'
Attachments (0)
Change History (4)
comment:1 follow-up: 2 Changed 12 years ago by
comment:2 follow-up: 3 Changed 12 years ago by
Replying to stelminator:
I tried your patch(es) with the environment described in this ticket's description:
- 1. (don't hardcode default revision for SVN) doesn't fix the behavior
- 2. (use the new API method) suffices to fix the reported problem
- 1. + 2. (complete patch from stelminator) also fixes the problem
So I hope your patch is going to be part of the next version of TracBibPlugin.
comment:3 Changed 12 years ago by
Replying to anonymous:
Replying to stelminator:
I tried your patch(es) with the environment described in this ticket's description:
- 1. (don't hardcode default revision for SVN) doesn't fix the behavior
- 2. (use the new API method) suffices to fix the reported problem
- 1. + 2. (complete patch from stelminator) also fixes the problem
So I hope your patch is going to be part of the next version of TracBibPlugin.
My description of 1. was incomplete. 'latest'
and None
are functionally equivalent for SVN, but not for other version control systems, where None
is correct. I wouldn't expect it to have any effect for someone using SVN. The rest of the patch compensates for multiple repositories, including the related API changes for Trac 1.0.
Glad to hear that it worked for someone else.
comment:4 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Thank you for your reports! Fixed in r12604.
Tested with git, svn and hg on Trac 1.0 and 0.12.
Roman
yup, I ran into this, too. I think it's do with the default configuration to be for there to not be a default repository. Basically, TracBib is expecting the old style where there's only one repository, and even if there's more than one, for the common use case (and the default configuration in Trac) is for there to be a default repository.
Anyway, looks like TracBib hasn't been updated for multiple repositories (at least not for this use case).
Fix below for
latest
->None
).get_repository_by_path
onRepositoryManager
to just magically do the right thing.tracbib/source.py
'latest'repos = self.env.get_repository()file, revision)