Edgewall Software
Modify

Opened 14 years ago

Closed 14 years ago

Last modified 10 years ago

#9570 closed enhancement (fixed)

Merge RepoRevisionSyntaxPlugin into core?

Reported by: shesek Owned by: Remy Blank
Priority: normal Milestone: 0.12.1
Component: general Version:
Severity: normal Keywords: WikiFormatting, traclinks
Cc: trbs@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

When using multiple repositories, all the WikiFormatting / TracLinks has a syntax for linking to a changeset/revision of a specific repository ([123/repo] and [changeset:123/repo]), other than the r123 syntax.

I find the r123 syntax the most readable one and think its weird that it can't be used when using multiple repositories. Therefore, I suggest merging the functionality of RepoRevisionSyntaxPlugin (disclosure: this is a plugin I wrote) to core, or using some alternative syntax (repo/r123 maybe?) that allows using this syntax with multiple repositories somehow.

Attachments (1)

9570-restrict-path-r10006.patch (3.7 KB ) - added by Remy Blank 14 years ago.
Allow r123/path and r123:456/path syntax.

Download all attachments as: .zip

Change History (14)

comment:1 by Remy Blank, 14 years ago

Milestone: 0.13
Owner: set to Remy Blank

Why use the syntax r123repo, and not e.g. r123/repo, which would be very similar to the [123/repo] syntax? Also, AFAIK the current regexp for the r123 syntax allows hexadecimal revisions (hashes), so without a separator, this might conflict with the repository name (e.g. revision 12 in repository "best" would be written "r12best", which could also be interpreted as revision 12b in repository "est", or revision 12be in repository "st").

So, how about r123/repo (which can conveniently be read as "revision 123 in repository "repo")?

comment:2 by shesek, 14 years ago

Sure, as I said - any syntax will be fine. In the plugin itself I noted that the only reason I used the r123repo syntax is that Trac parsed the r123 part before my plugin did, so I couldn't implement any `repo/r123' or 'r123/repo' syntax.

I do think that r123/repo is a better choice.

BTW, when does Trac has non-numeric revisions? it seems like 'r1b79' isn't getting parsed to a TracLink

comment:3 by Remy Blank, 14 years ago

Let's see: r12ab [12ab]

But: r12ab34cd [12ab34cd]

You are right, the hexadecimal revision numbers are only supported with the bracket syntax, and only for 8-digit revisions or longer. The r123 syntax only supports digits. So there should be no ambiguity, but I still prefer r123/repo :)

comment:4 by shesek, 14 years ago

Yeah, I agree. Any chance this syntax will be used by CommitTicketUpdater too, or make the syntax used by it configurable in TracIni?

in reply to:  4 comment:5 by Remy Blank, 14 years ago

Replying to shesek:

Any chance this syntax will be used by CommitTicketUpdater too, or make the syntax used by it configurable in TracIni?

Nah, it looks too ugly with hexadecimal changesets. But you could create a small plugin that subclasses CommitTicketUpdater and overrides make_ticket_comment() to format the ticket comment differently.

comment:6 by trbs <trbs@…>, 14 years ago

Cc: trbs@… added

by Remy Blank, 14 years ago

Allow r123/path and r123:456/path syntax.

comment:7 by Remy Blank, 14 years ago

9570-restrict-path-r10006.patch adds the r123/path syntax for changesets and r123:456/path for the log.

However, contrary to the [123/path] syntax, the path is limited to characters in [a-zA-Z0-9_/.+-]. Indeed, using a word boundary or whitespace as the end of path would make the comma part of the path in "changed in r123/path, and …". The dot could also be removed, for the typical phrase "fixed in r123/path.". If characters outside of that set are needed, the [123/path] syntax should be used instead.

Please test.

Version 0, edited 14 years ago by Remy Blank (next)

comment:8 by shesek, 14 years ago

Seems to work fine here. I do think that period should not be matched too, and the [123/path] syntax should be used instead on those cases to support "fixed in r123/path." cases. BTW, I never used (nor knew it was possible to use) an entire path and not just the repository name there. Good to know.

in reply to:  8 comment:9 by Remy Blank, 14 years ago

Replying to shesek:

I do think that period should not be matched too, and the [123/path] syntax should be used instead on those cases to support "fixed in r123/path." cases.

Agreed. I'll fix that before applying. Thanks for testing!

comment:10 by Remy Blank, 14 years ago

Milestone: 0.130.12.1
Resolution: fixed
Status: newclosed

Patch applied in [10008] (to 0.12-stable by mistake, sorry).

comment:11 by Ryan J Ollos, 10 years ago

Keywords: traclinks added; TracLinks removed

comment:12 by Ryan J Ollos, 10 years ago

Keywords: traclink added; traclinks removed

comment:13 by Ryan J Ollos, 10 years ago

Keywords: traclinks added; traclink removed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Remy Blank.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Remy Blank to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.