Edgewall Software
Modify

Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#10652 closed enhancement (fixed)

[Patch] Suppress repeated file changes for collapsed changesets on timeline

Reported by: Mikael Relbe Owned by: Mikael Relbe
Priority: normal Milestone: 1.0
Component: timeline Version: 0.13dev
Severity: normal Keywords: patch
Cc: Branch:
Release Notes:

Collapsed changesets in timeline won't show duplicated modified file entries.

API Changes:
Internal Changes:

Description

Repeated changes of a file causes it to be reported repeatedly within a collapsed changeset event on the timeline when trac.ini is configured like this:

[timeline]
changeset_collapse_events = true
changeset_show_files = -1

Example of timeline event report:

8:57 Changesets [1-4]
     (edit) test/text.txt
     (edit) test/text.txt
     (edit) test/text.txt
     (add)  test/text.txt

This ticket suggests that identical file changes within a collapsed changeset event are suppressed.

The example above would then become:

8:57 Changesets [1-4]
     (edit) test/text.txt
     (add)  test/text.txt

Attachments (2)

t10652-suppress-files-11028.patch (1.4 KB ) - added by Mikael Relbe 13 years ago.
patch to be applied on r11028
t10652-suppress-files-11028.2.patch (1.4 KB ) - added by Mikael Relbe 13 years ago.
use set instead of list for filter

Download all attachments as: .zip

Change History (16)

by Mikael Relbe, 13 years ago

patch to be applied on r11028

comment:1 by Christian Boos, 13 years ago

Good idea! But rather use a set for filter.

by Mikael Relbe, 13 years ago

use set instead of list for filter

comment:2 by Mikael Relbe, 13 years ago

The supplied patch t10652-suppress-files-11028.2.patch might be rough, but does the job. (Long time since I contributed here, I'm therefore a bit rusty.)

Last edited 13 years ago by Mikael Relbe (previous) (diff)

comment:3 by Mikael Relbe, 13 years ago

Summary: Suppress repeated file changes for collapsed changesets on timeline[Patch] Suppress repeated file changes for collapsed changesets on timeline

comment:4 by Mikael Relbe, 13 years ago

Keywords: patch added

comment:5 by Remy Blank, 12 years ago

Should the entries be sorted after de-duping?

comment:6 by Remy Blank, 12 years ago

Milestone: 1.01.0-triage

Preparing for 1.0.

in reply to:  5 comment:7 by Mikael Relbe, 12 years ago

Replying to rblank:

Should the entries be sorted after de-duping?

The patch does not affect the order, but sorted entries would be prefered I think (I don't remember if the default behaviour is sorted entries or not).

comment:8 by Christian Boos, 12 years ago

Milestone: 1.0-triage1.0
Resolution: fixed
Status: newclosed

The files from get_changes() are sorted, at least for svn, hg and git. I tested the patch a while ago and it was working fine.

Committed as r11069, thanks!

comment:9 by Christian Boos, 12 years ago

Owner: set to Mikael Relbe

in reply to:  8 comment:10 by Remy Blank, 12 years ago

Replying to cboos:

The files from get_changes() are sorted, at least for svn, hg and git.

They are sorted within a changeset, but not across changesets. For example, if you have two changesets with the same message:

  • [123]
    • zzz/file.txt
  • [124]
    • aaa/file.txt

Then the collapsed event will be:

  • [123-124]
    • zzz/file.txt
    • aaa/file.txt

How about sorting by (filename, event_type) before adding the elements to the list?

Last edited 12 years ago by Remy Blank (previous) (diff)

comment:11 by Christian Boos, 12 years ago

Ah well, you're right.

Looking for "unique sort python" led me to so:479897sorted(set(myList)). Given we already have the set, we could just sort it.

Follow-up: repos:cboos.git:t10652/suppress-files.2

comment:12 by Remy Blank, 12 years ago

Looks good!

comment:13 by Christian Boos, 12 years ago

Applied in r11091.

comment:14 by Christian Boos, 12 years ago

Release Notes: modified (diff)

Modify Ticket

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