Bazaar repository not visible from redmine
Added by Gabriele Garuglieri over 14 years ago
(I've posted a similar question to Bazaar people)
Hi all,
I'm trying the following combination under Win XP Pro sp3:
Bazaar standalone installer 2.1.1 (i also have python 2.5.2 installed but i preferred to have a self contained installation instead of hunting around for requisites) (python is not in windows path)
redmine 0.9.3
Jruby 1.4.0 (equiv to ruby 1.8.7).
The problem is that i cannot configure any bazaar branch as redmine repository. The redmine bazaar adapter fails to parse the output from the following command bzr ls -v --show-ids -r-1 "C:\home\Bazaar\bzrRepo/" (bzrRepo is a plain branch and not a shared repo).
The adapter uses the following regexp (?-mix:^V\s+C:\/home\/Bazaar\/bzrRepo\/(\/?)([^\/]+)(\/?)\s+(\S+)$) that fails to match.
To obtain a match i had to change the regexp as (?-mix:^V\s+(C:\/home\/Bazaar\/bzrRepo\/)?\/?([^\/\s]+)(\/?)\s+(\S+)\s+$) (it's not completely correct since the ([^\/\s]+) won't accept file names with spaces but it was a quick and dirty debugging attempt) but then it fails later.
This means that the "ls" command output is significantly different from what redmine expects.
Redmine doc says that it supports bazaar up to 2.0.4 and i can believe it since googling around i found many reports of users using redmine with bazaar so my questions are:
1- are you aware of any change between bazaar 2.0.4 and 2.1.1 about commands output?
2- are you aware of commands output differences when running in windows instead of linux/unix?
3- are you aware of differences in regexp processing between jruby and native ruby for windows?
4- any hint to understand if i'm doing anything wrong would be really appreciated
Thanks for your attention,
Gabriele
Replies (3)
RE: Bazaar repository not visible from redmine - Added by Gabriele Garuglieri over 14 years ago
Hi all,
please ignore this request.
It turned out that it was a Jruby issue.
I didn't investigate further but i trashed Jruby, installed windows native Ruby and now everything is working as expected.
Sorry for bothering you,
Gabriele
RE: Bazaar repository not visible from redmine - Added by Gabriele Garuglieri over 14 years ago
Ok guys,
please forgive me, first time at redmine, ruby and bazaar and i managed to make a mess.
Definitely this is a problem both with ruby and jruby.
I cannot list the content of a bazaar repository unless i change the regexp into lib\redmine\scm\adapters\bazaar_adapter.rb "entries" method(?).
I don't know if bazaar behaves differently under unix but in windows the 'bzr ls -v --show-ids -r-1 "C:\home\Bazaar\bzrRepo/"' (substitite path for whatever you like, i made several attempts with different repositories, both with and without spaces in the path) command output never show any path in front of file names so the expression "#{Regexp.escape(prefix)}" must be made at least optional "(#{Regexp.escape(prefix)})?".
Then the expression ([^\/]+) is greedy and if it doesn't match the (\/?) immediately after like for directory entries, it eats everything till the eol.
To obtain a match i have to use ([^\/\t]+) to allow for file names with spaces.
Conclusion, just changing the regexp line
re = %r{^V\s+#{Regexp.escape(prefix)}(\/?)([^\/]+)(\/?)\s+(\S+)$}
into
re = %r{^V\s+(#{Regexp.escape(prefix)})?\/?([^\/\t]+)(\/?)\s+(\S+)\s+$}
makes everything working as expected.
Pls, any comment?
Thanks,
Gabriele
RE: Bazaar repository not visible from redmine - Added by Eric Seigne over 14 years ago
Yahoo it works !
Gabriele, thanks a lot ! i've just change re= line and everything is now viewable on my redmine+bzr.
Éric