Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

Last modified 17 years ago

#5153 closed defect (fixed)

Reverse order of changesets in quick succession

Reported by: Matt Shin Owned by: Matthew Good
Priority: normal Milestone: 0.11
Component: timeline Version: 0.10.3
Severity: trivial Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Having committed a few changesets in quick succession (all committed in the same second) in a Subversion repository, I have discovered an odd behaviour in the Trac timeline, where the events are sorted in ascending order, e.g.:

10:58 Changeset [4] by matt 10:58 Changeset [5] by matt 10:58 Changeset [6] by matt

Normally, I would expect things to be arranged in the usual reverse chronological order, like:

10:58 Changeset [6] by matt 10:58 Changeset [5] by matt 10:58 Changeset [4] by matt

An oversight?

Attachments (0)

Change History (8)

comment:1 by hyuga <hyugaricdeau@…>, 18 years ago

I'm confused… maybe this is a stupid question, but how did you manage to commit multiple changesets in the same *second*?

Regardless, I would imagine this would more likely be a bug in Subversion than Trac, but I don't know…

comment:2 by Matthew Good, 18 years ago

Owner: changed from Christian Boos to Matthew Good
Severity: normaltrivial

There is no defined ordering for timeline events that have the same timestamp. You can see discussion of this on the MailingList here: http://groups.google.com/group/trac-dev/browse_thread/thread/1ac11d8838f7f77e/b8b665ac1bffcadf?lnk=gst&q=heap&rnum=1#b8b665ac1bffcadf

I mentioned using the title, but besides the changesets it doesn't seem to make sense to order events in reverse order by title. I'll have to give this some thought.

in reply to:  1 comment:3 by Matt Shin, 18 years ago

Replying to hyuga <hyugaricdeau@gmail.com>:

I'm confused… maybe this is a stupid question, but how did you manage to commit multiple changesets in the same *second*?

Regardless, I would imagine this would more likely be a bug in Subversion than Trac, but I don't know…

I did several cheap copies and directory creates using a script. It manages to do 3 commits in the same second.

comment:4 by Christian Boos, 18 years ago

  • web_ui.py

     
    146146                self._provider_failure(e, req, provider, filters,
    147147                                       [f[0] for f in available_filters])
    148148
    149         events = sorted(events, key=lambda e: to_timestamp(e.date), reverse=True)
     149        events = sorted(events, key=lambda e: e.date, reverse=True)
    150150
    151151        # prepare sorted global list
    152152        if maxrows:

should be enough to fix this issue. to_timestamp convert to seconds, which looses the subsecond information present in the original datetime objects (and initially provided by subversion dates as well).

That should be enough for all but the cases where the times are exactly the same (i.e. same microsecond), and for those situations the order doesn't really matter.

in reply to:  4 comment:5 by anonymous, 18 years ago

Replying to cboos:

That should be enough for all but the cases where the times are exactly the same (i.e. same microsecond), and for those situations the order doesn't really matter.

Thanks for the simple and quick fix. I don't think we'll ever manage to commit in the same microsecond (unless we set the revision property "svn:date" manually…).

comment:6 by Matthew Good, 18 years ago

Resolution: fixed
Status: newclosed

Ah right, I forgot to remove the to_timestamp() call which was unnecessary when using the sorted method. It's been done in r5209.

in reply to:  6 comment:7 by Matt Shin, 18 years ago

Milestone: 0.11

Replying to mgood:

Ah right, I forgot to remove the to_timestamp() call which was unnecessary when using the sorted method. It's been done in r5209.

Since you have committed the fix to the source:trunk, I guess it will be scheduled for milestone:0.11. I hope you don't mind me setting the milestone for you.

comment:8 by Emmanuel Blot, 17 years ago

See also related ticket #5819

Modify Ticket

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