#13271 closed defect (fixed)
PlantUML macro path parameter cannot reference a file in a repo other than the default
Reported by: | james.close | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Component: | PlantUmlMacro |
Severity: | normal | Keywords: | MultipleRepository |
Cc: | Álvaro Iradier | Trac Release: | 1.2 |
Description
System:
PlantUML: 2.0dev-r14362 Trac: 1.2.2 Server: Apache/2.4.7 (Ubuntu) Database: PostgreSQL 9.3.14 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4, 64-bit OS: Ubuntu 14.04.2 LTS (GNU/Linux 3.13.0-100-generic x86_64) Repository 1 (Default): Subversion version 1.8.8 (r1568071). Repository 2 mygitrepo: git version 1.9.1
With two repos set-up as above (default SVN) second is git.
Referencing a PlantUML file from the second repo does not work.
# This works fine with the default repo: {{{#!PlantUml path="/Some/Path/In/Default/Repo/To/The/PlantUMLFile.plant" }}} # This does not work: {{{#!PlantUml path="mygitrepo/Some/Path/In/Second/Repo/To/The/PlantUMLFile.plant@branch" }}} # Returns the error: # File not found in repository: mygitrepo/Some/Path/To/The/GitPlantUMLFile@branch
I believe the issue is around the code for splitting the path does not remove the "mygitrepo" element of the path before searching for the file. I have a workaround by changing the code in macro.py line 199 to:
path, rev = _split_path(src_path) if not repos.has_node(path, rev): # JC 12 Sep 2017 - Bug fix # maybe the path has the reponame at the start strip it out! pos = path.find('/') if pos != -1: path = path[pos:] if repos.has_node(path, rev): node = repos.get_node(path, rev) content = node.get_content().read() exists = True
Attachments (0)
Change History (11)
comment:1 Changed 7 years ago by
Owner: | changed from Álvaro Iradier to Ryan J Ollos |
---|---|
Status: | new → accepted |
comment:2 Changed 7 years ago by
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
comment:4 Changed 7 years ago by
If you can confirm it's working I'll publish the latest to pypi:TracPlantUml.
comment:5 Changed 7 years ago by
I can confirm that the fix is working on my environment.
I see your fix is the "proper" way of doing it I had not read this in the RepositoryManager API
Returns:
a (reponame, repos, path) triple, where path is the remaining part of path once the reponame has been truncated, if needed.
Thanks for the quick turn around!
comment:8 follow-up: 9 Changed 7 years ago by
Oh boy, I have tried everything here. Still not working for local svn repo
comment:9 Changed 7 years ago by
Replying to clubturbo:
Oh boy, I have tried everything here. Still not working for local svn repo
Please ask on MailingList and explain what you mean by "not working".
comment:10 Changed 7 years ago by
No biggie, the discussion was on PlantUML displaying
{{{#!plantuml path="/path/to/repository" ... }}} {{{#!plantuml path="/repos/path/to/repository@rev" ... }}}
&
[[PlantUml(/path/to/repository)]] [[PlantUml(/path/to/repository@rev)]]
Of which I can't get working.
I did get
{{{#!PlantUml @startuml Alice -> Bob: Authentication Request Bob --> Alice: Authentication Response Alice -> Bob: Another authentication Request Alice <-- Bob: another authentication Response @enduml }}}
Working as it should.
Really no biggie. I am working up a means to test all this with https://pharo.org/ and see what gives there.
comment:11 Changed 7 years ago by
I've tested the following examples:
[[PlantUml(/proj1/trunk/dir with space/plantuml_example)]] [[PlantUml(/proj1/trunk/dir with space/plantuml_example@219)]] [[PlantUml(/proj1/trunk/dir with space/plantuml_example@220)]] {{{#!plantuml path="/proj1/trunk/dir with space/plantuml_example" }}} {{{#!plantuml path="/proj1/trunk/dir with space/plantuml_example@219" }}} {{{#!plantuml path="/proj1/trunk/dir with space/plantuml_example@220" }}}
Are you using a repository-scoped path?
Please show a concrete example in which it doesn't work so I can look for hints as to what the problem might be.
Make sure you've installed the latest from trunk (2.3dev) or pypi (2.2).
In 16809: