Opened 20 years ago
Closed 20 years ago
#2011 closed enhancement (fixed)
Use SVN-like peg revisions instead of own syntax
| Reported by: | Manuzhai | Owned by: | Christian Boos |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.9 |
| Component: | version control/browser | Version: | 0.9b1 |
| Severity: | minor | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
With the source browser, there is currently the source:/#2100 syntax. In Subversion, peg revisions can be used with the command line client that have an @: source:/@1200. I think we should support the latter syntax and maybe deprecate the former.
Attachments (0)
Change History (4)
comment:1 by , 20 years ago
| Owner: | changed from to |
|---|---|
| Severity: | normal → minor |
| Status: | new → assigned |
| Summary: | Use SVN-like peg revisions instead of invented syntax → Use SVN-like peg revisions instead of own syntax |
comment:2 by , 20 years ago
| Milestone: | → 0.9 |
|---|
… and as a follow-up to r2199, the link to the Rev of the file
inside the Revision Log View could be displayed as @xyz.
-
log.cs
108 108 <td class="date"><?cs var:log.changes[item.rev].date ?></td> 109 109 <td class="rev"> 110 110 <a href="<?cs var:item.browser_href ?>" 111 title="Browse at revision <?cs var:item.rev ?>"> <?cs var:item.rev ?></a>111 title="Browse at revision <?cs var:item.rev ?>">@<?cs var:item.rev ?></a> 112 112 </td> 113 113 <td class="chgset"> 114 114 <a href="<?cs var:item.changeset_href ?>"
I think this change is important to bring in 0.9, as it will make it easier for people to adopt the new notation and deprecate the old one.
The symbol # should be used in a way consistent with
the wiki page name syntax, to refer to a location within an object.
In the case of source: links, this could be the line number (see #2035).
comment:3 by , 20 years ago
By the way, I just realized that supporting line number targets with "#" will not necessarily introduce an incompatibility: simply make the "@rev" part mandatory when referring to line number, which seems a good thing to do anyway… (line 100 of the "head"… which head?)
So:
- source:trunk/README#head or source:trunk/README#123
the old notation for the revision, would still work. - source:trunk/README@head or source:trunk/README@123
the new peg revision notation - source:trunk/README@123#100
the new peg revision notation, with line number (line 100 in revision 123) - source:trunk/README@123#100:110
line number range support?
Yes, one could still write source:trunk/README@head#100, but then the potential problem with that is made quite obvious…
comment:4 by , 20 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |



Yes; I'd prefer explaining things once to my users, and not have to answer questions like: why does Subversion use
@and Trac uses#?…The fix is easy:
Index: trac/versioncontrol/web_ui/util.py =================================================================== --- trac/versioncontrol/web_ui/util.py (revision 2198) +++ trac/versioncontrol/web_ui/util.py (working copy) @@ -24,7 +24,7 @@ __all__ = [ 'get_changes', 'get_path_links', 'get_path_rev' ] -rev_re = re.compile(r"([^#]*)#(.+)") +rev_re = re.compile(r"([^@#]*)[@#](.+)") # also support SVN's peg revision def get_changes(env, repos, revs, full=None, req=None, format=None): db = env.get_db_cnx()As a side-effect, the
log:syntax will also support peg revisions:log:trunk@2000:2200