Indefero

Issue 730: Link to source in comments: no default revision

Reported by Tudor Sandu, Aug 31, 2011

A construction like

src:src/IDF/Template/IssueComment.php@v1.1.2

links to the specified source file, but if you ommit the revision

src:src/IDF/Template/IssueComment.php

then the link is no longer created. There should be a default 
version (i.e. the latest) to link to in case an explicit revision is 
not specified.

Comment 1 by Tudor Sandu, Aug 31, 2011

This is a subset of the issues listed in #729. I created this issue 
as instructed by Thomas here 
http://projects.ceondo.com/p/indefero/issues/729/#ic2998

Comment 2 by Thomas Keller, Aug 31, 2011

I think there was just a quotation mark missing in the regex. Could 
you have a look if the linking works as expected now for you?

Labels: Milestone:Release1.2
Status: Accepted
Owner: tommyd
Relations: is related to 729

Comment 3 by Thomas Keller, Sep 12, 2011

@Tudor: Have you had time to look into the patch?

Comment 4 by Tudor Sandu, Sep 12, 2011

Hey! Sorry, I had a hectic week at work and this slipped out of 
mind.

I was looking at the patch and it seems something's not right... 
That's not even valid PHP syntax in there. I don't know what quote 
you are referring to, either.

Then I realized that there's a bug in diff (most likely) which trims 
off characters at the end.

Anyway, postpending a question mark to non-capturing group  
(?:\@([^\s#,]+)) fixed it.

The correct (and full) regex is

=(src:)([^\s@#,\(\)\\\\]+(?:(\\\\)[\s@#][^\s@#,\(\)\\\\]+){0,})+(?:\@
([^\s#,]+))?(?:#(\d+))?=im


Thanks for your help

Comment 5 by Thomas Keller, Sep 12, 2011

I think this was my fault, but yes, you got it right. Fixed in 
revision 1f0791d.
Status: Fixed

Created: 1 year 9 months ago by Tudor Sandu

Updated: 1 year 9 months ago

Status: Fixed

Owner: Thomas Keller

Labels:
Type:Defect
Priority:Medium
Milestone:Release1.2

This issue is related to
729 - Link to source in comments