プロジェクト

全般

プロフィール

Vote #63240

完了

Using '*' as keyword for repository referencing keywords doesn't work

Admin Redmine さんがほぼ2年前に追加. ほぼ2年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
SCM_3
対象バージョン:
開始日:
2008/05/19
期日:
進捗率:

0%

予定工数:
category_id:
3
version_id:
4
issue_org_id:
1253
author_id:
4
assigned_to_id:
0
comments:
17
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
3
ステータス-->[Closed]

説明

We've set up Redmine-0.7.1 on a Windows XP machine running under mongrel using an http link to our subversion repository. We set the 'referencing keywords' to just contain '*' as indicated in the FAQ here http://www.redmine.org/wiki/redmine/RedmineSettings#32

When we browse the repository, out commit messages that start with a bug number (e.g. #9999) do get hyperlinked to that bug, but the tickets aren't specifically mentioned as referenced. Also, when we browse to that ticket, it has a comment such as 'committed in r8765' and the r8765 also correctly gets hyperlinked, but the ticket doesn't display #9999 as an associated revision.

I see this is working for the official Redmine site. Have posted this in the help forum but haven't been able to resolve it. See http://www.redmine.org/boards/2/topics/show/875

Running:

  • redmine-0.7.1
  • svn-1.4.6 (over http)
  • ruby-1.8.6
  • rails-2.0.2
  • sqlite3-3.5.8
  • mongrel-1.1.4

All other parts of redmine appear to be working correctly for us.


journals

The regexp used to detect issue ids in comments with "*" as keyword is (changeset.rb line 78):
<pre>
([\s\(,-^])#(\d+)(?=[[:punct:]]|\s|<|$)
</pre>

In a range definition, <code>^</code> matches the <code>^</code> character and not the beginning of the line. Using
<pre>
([\s\(,-]|^)#(\d+)(?=[[:punct:]]|\s|<|$)
</pre>
may solve the problem.

From "Programming Ruby The Pragmatic Programmer's Guide":http://www.ruby-doc.org/docs/ProgrammingRuby/html/language.html :

bq. A character class matches any single character between the brackets. The characters <code>|, (, ), [, ^, $, *,</code> and <code>?</code>, which have special meanings elsewhere in patterns, lose their special significance between brackets.
--------------------------------------------------------------------------------
Here is a unit test that goes in changeset_test.rb.

<pre>
def test_ref_keywords_any_line_start
Setting.commit_ref_keywords = '*'

c = Changeset.new(:repository => Project.find(1).repository,
:committed_on => Time.now,
:comments => '#1 is the reason of this commit')
c.scan_comment_for_issue_ids

assert_equal [1], c.issue_ids.sort
end
</pre>
--------------------------------------------------------------------------------
Thanks Pierre, the new regex worked. I did have to delete the repository from the project and re-add it to get it to re-associate the revisions, so perhaps a 're-sync revisions' on the repository settings tab would be good (this would also work then if commit comments get altered which they can with subversion). I'll post a separate ticket about this.
--------------------------------------------------------------------------------
Added #1273 to request a repository history resync method.
--------------------------------------------------------------------------------
Fixed in r1451. Pierre, thanks for your patch.
--------------------------------------------------------------------------------
Hi, this hasn't been merged to the 0.7-stable branch but is marked as fixed for 0.7.2. Will this be merged before the release?

Many thanks

Russell
--------------------------------------------------------------------------------
I've re-opened this because it hasn't been merged to the 0.8 branch (and didn't want it to get forgot if 0.7.2 is released soon). If its not going to be merged, I'll change the target version to 0.8?

Cheers

Russell
--------------------------------------------------------------------------------
Sorry, meant it hadn't been merged to the 0.7-stable branch (in the above comment).
--------------------------------------------------------------------------------
Merged in 0.7-stable in r1474.
--------------------------------------------------------------------------------
This still doesn't work fully. We've got a few cases where we're entering commit comments such as

<pre>
#6,#7 small change to fix to issues
</pre>

Using changeset.rb from 0.7.1, and also with the fix applied, will still only associate #7 with the commit. It appears to be to do with the ',' after the bug number causing an issue. We've got other commit comments like this:

<pre>
Fixed #8, removed a bug in the locking code
</pre>

And this won't be associated with an issue, but if I edit the log message, remove the ',' so the message reads @Fixed #8 removed a bug in the locking code@, then delete and re-add the repository so the history is re-fetched, then the association with issue 8 works correctly.

FWIW, whatever passes the revision history to display the hyperlinks for the bugs on the repository browser picks all these tickets out correctly. Should they not just use the same regex?

It would be good to get this fixed before 0.7.2 as we have to keep deleting and re-adding our repositories to our projects to re-sync the history as theirs no 're-sync' option.

Thanks

Russell

--------------------------------------------------------------------------------
We have also noticed the issue where having a comma after a defect # will prevent redmine from being able to associate the commit with the issue.
--------------------------------------------------------------------------------
Lane, I can't reproduce your bug. I commited a message like "foo #1, bar" and the issue 1 was associated with the commit.
--------------------------------------------------------------------------------
Hi Lane, Piere, do you both have referencing keywords set to *? We also have 'fixes' keywords set to '' and every commit we've got on like this, the issue preceding the ',' isn't associated.

Pierre, have you tried a commit such as @#1,#2 foo bar@ to see if both 1 and 2 are associated?

Cheers

Russell
--------------------------------------------------------------------------------
Hi Lane, hi Russel. I still can't reproduce the bug. I used the 0.7-stable branch with this configuration :
* Referencing keywords : *
* Fixing keywords : fixes

Both commits with "#1,#2 foo bar" and "foo #1, bar" messages associate right.
--------------------------------------------------------------------------------
Hi Pierre, can you try with 0.7.1 then? I've applied the above regex fix to our installation and that fixed the issue where the bug number was at the start of the commit, but not the ',' case. Perhaps something else has been changed on the stable branch that has affected this also?

I'll try and get hold of the stable branch at some point and give it a go too.

Cheers

Russell
--------------------------------------------------------------------------------
OK, I've just done a checkout of 0.7-stable and a commit of

<pre>
#1,#2,#3 Created trunk, branches and tags
</pre>

associated the revision correctly.

On our production installation, I've edited changeset.rb as you described above, and this did fix the start of line issue, but commas after issue numbers don't work so I wonder if something else went in to 0.7-stable post 0.7.1 that touched this issue.

Anyway, seems to be working on 0.7-stable so looks like this report can be closed again.

Cheers

Russell
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

Admin Redmine さんがほぼ2年前に更新

  • カテゴリSCM_3 にセット
  • 対象バージョン0.7.2_4 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0