Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#2451 closed enhancement (fixed)

Add "Commited x units ago" to changeset viewer

Reported by: mcarpenter@… Owned by: Christian Boos
Priority: high Milestone: 0.10
Component: version control/changeset view Version: 0.9
Severity: minor Keywords: review
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Many other places (roadmap for one) in trac show time like "3 months ago". It would be nice if the changeset viewer also did this. So the timestamp for [1] would show:

Timestamp: 11/22/05 16:57:13 (3 months ago)

Attachments (1)

T2451-for-r2625.patch (3.9 KB ) - added by Christian Boos 19 years ago.
Implements the feature, while being cache friendly

Download all attachments as: .zip

Change History (8)

comment:1 by Christian Boos, 19 years ago

Milestone: 1.0
Owner: changed from Jonas Borgström to Christian Boos
Severity: normaltrivial
Status: newassigned

Here you are:

  • templates/changeset.cs

    a b  
    102102
    103103<dl id="overview">
    104104 <dt class="time">Timestamp:</dt>
    105  <dd class="time"><?cs var:changeset.time ?></dd>
     105 <dd class="time"><?cs var:changeset.time ?> (<?cs var:changeset.age ?> ago)</dd>
    106106 <dt class="author">Author:</dt>
    107107 <dd class="author"><?cs var:changeset.author ?></dd>
    108108 <dt class="message">Message:</dt>
  • trac/versioncontrol/web_ui/changeset.py

    diff -r 6dc4bfcb2b7c -r 0865b028da97 trac/versioncontrol/web_ui/changeset.py
    a b  
    153153        req.hdf['changeset'] = {
    154154            'revision': chgset.rev,
    155155            'time': util.format_datetime(chgset.date),
     156            'age': util.pretty_timedelta(chgset.date),
    156157            'author': util.escape(chgset.author or 'anonymous'),
    157158            'message': wiki_to_html(chgset.message or '--', self.env, req,
    158159                                    escape_newlines=True)

comment:2 by Christopher Lenz, 19 years ago

You'd also have to completely remove the caching support (req.check_modified()).

comment:3 by Christian Boos, 19 years ago

Severity: trivialminor

Ah yes, didn't think about that. But maybe the cacheing can be improved by sending a hash key that has been computed from all the elements that are susceptible to change:

  • youngest rev or not
  • "pretty" time (as per this ticket)
  • commit log message (as per #781)

by Christian Boos, 19 years ago

Attachment: T2451-for-r2625.patch added

Implements the feature, while being cache friendly

comment:4 by Christian Boos, 19 years ago

Priority: lownormal

The attachment:T2451-for-r2625.patch does what I suggested above.

In addition, the (… ago) message will be (less than one hour ago) for recent changes, which is more cache friendly.

Now that I think about it, I should have added repos.name to the mix, as this would additionally trigger a reload in the case of a switch to another repository, even if the change only affects the scope of the repository.

comment:5 by Christian Boos, 19 years ago

Keywords: review added
Priority: normalhigh

Ok with the changes?

comment:6 by Christian Boos, 19 years ago

Resolution: fixed
Status: assignedclosed

Reviewed patch applied in r2636.

comment:7 by Christopher Lenz, 19 years ago

Milestone: 1.00.10

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos 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.