#3533 closed enhancement (fixed)
Display shortened revision numbers
Reported by: | Owned by: | Remy Blank | |
---|---|---|---|
Priority: | normal | Milestone: | 0.12 |
Component: | version control | Version: | devel |
Severity: | minor | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
Version control systems other than subversion might have substantial longer revision identifiers (e.g. Mercurial, Monotone). These revision ids should not always be displayed to the user in their entirety.
To solve this, a method should be added to the vc-api that lets the vc-backend convert a "full" revision id into a "displayed" revision number.
An additional parameter could choose the style ("short", "mid-size", "full", whatever…), depending on the context where the revision id is to be displayed.
(The alternate approach, to modify the backend so that it always hands shortened revision ids to trac, seems very hackish to me.)
Attachments (0)
Change History (9)
comment:1 by , 18 years ago
Owner: | changed from | to
---|---|
Severity: | normal → minor |
follow-up: 3 comment:2 by , 18 years ago
Milestone: | 0.11 → 0.10 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
… during my first VcRefactoring for 0.10.
Note that after the upcoming blame support, the short_rev
has an additional use, as we'll require that Node.get_annotations
returns a list of short revs, whereas Changeset.rev
can still be either a short or a long rev.
follow-up: 6 comment:3 by , 18 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Replying to cboos:
Repository.short_rev(rev)
(Return a compact representation of a revision in the repos) was added a while back (r2669) …
Yeah, I know, but it was only used for the diffs of the changeset view. But the timeline for example shows the complete revision, which is 40 chars wide for TracMonotone, and thus clutters up the timeline view.
I think we should have three sizes (proposed lengths for monotone in parens)
- short (4 chars): for diff and annotate
- middle (8 chars): for the timeline
- normal (40 chars): elsewhere
Replying to cboos:
Note that after the upcoming blame support, the
short_rev
has an additional use, as we'll require thatNode.get_annotations
returns a list of short revs,
Which is not good. Inside Trac, we should never use shortened revision numbers as they can be ambiguous! It would not be clear to which changeset (i.e. revision) the shortened revision id should be linked to.
It's only about not always displaying the revision numbers in their entire length to the user, not about using any form of shortened rev internally.
comment:4 by , 18 years ago
Milestone: | 0.10 → 0.12 |
---|
Setting the milestone to 0.12, there are probably some more vc refactorings to be done.
comment:5 by , 18 years ago
See also: https://pacopablo.com/irclogs/2006/05/13#T14:15:31 for the archived version of a discussion on irc about that issue.
follow-up: 7 comment:6 by , 18 years ago
Replying to moschny:
Replying to cboos:
Repository.short_rev(rev)
(Return a compact representation of a revision in the repos) was added a while back (r2669) …Yeah, I know, but it was only used for the diffs of the changeset view. But the timeline for example shows the complete revision, which is 40 chars wide for TracMonotone, and thus clutters up the timeline view.
I think we should have three sizes (proposed lengths for monotone in parens)
- short (4 chars): for diff and annotate
- middle (8 chars): for the timeline
- normal (40 chars): elsewhere
Ok… thanks for the reminder ;)
Replying to cboos:
Note that after the upcoming blame support, the
short_rev
has an additional use, as we'll require thatNode.get_annotations
returns a list of short revs,Which is not good. Inside Trac, we should never use shortened revision numbers as they can be ambiguous! It would not be clear to which changeset (i.e. revision) the shortened revision id should be linked to.
You're absolutely right, sorry about that. There were two reasons for that:
- the rev is used in a CSS class attribute, so I didn't want to get the ":" character in it (which Mercurial adds when
[hg] show_rev = true
. That was admittedly a hack ;) - I wanted to be able to display an histogram of the changes, and for that a sequence number was handy. But that's also not the proper spec for the
short_rev
(it only happens to be that for svn and hg).
So I'll change this to use normalized revs.
comment:7 by , 18 years ago
comment:8 by , 15 years ago
Milestone: | next-major-0.1X → 0.12 |
---|---|
Resolution: | → fixed |
Status: | reopened → closed |
comment:9 by , 15 years ago
Owner: | changed from | to
---|
Repository.short_rev(rev)
(Return a compact representation of a revision in the repos) was added a while back (r2669) …