Edgewall Software
Modify

Opened 14 years ago

Closed 13 years ago

#2353 closed defect (fixed)

Timeline out of order when viewing SVK repository

Reported by: kmr@… Owned by: Christian Boos
Priority: normal Milestone: 0.10
Component: version control Version: devel
Severity: minor Keywords:
Cc: Branch:
Release Notes:
API Changes:

Description

My SVK repository has two projects mirrored (call them A and B). I loaded B second, hence it's revision numbers are higher than those from project A. When I initially viewed the timeline for the last 30 days, none of A's changes appeared even though I knew that changes had occurred. Viewing 1000 days worth of changes gave me the full timeline. I think perhaps the changeset timeline code assumes that the dates on the revisions will be in the same order as the revision numbers, which isn't always true when using SVK.

This change seems to fix things, at the expense of some speed:

Index: changeset.py
===================================================================
--- changeset.py	(revision 2530)
+++ changeset.py	(working copy)
@@ -114,7 +114,8 @@ class ChangesetModule(Component):
 
                 chgset = repos.get_changeset(rev)
                 if chgset.date < start:
-                    return
+                    rev = repos.previous_rev(rev)
+                    continue
                 if chgset.date < stop:
                     message = chgset.message or '--'
                     if format == 'rss':

Attachments (0)

Change History (6)

comment:1 by Christian Boos, 14 years ago

Milestone: 0.10
Owner: changed from Jonas Borgström to Christian Boos
Status: newassigned

That should be fixed once CachedRepository.get_changesets() gets implemented.

comment:2 by Christian Boos, 13 years ago

Milestone: 0.100.11

Post-poning.

comment:3 by Alec Thomas, 13 years ago

This also occurs when using svnadmin load to merge multiple repositories.

comment:4 by djc@…, 13 years ago

Milestone: 0.110.10

We just ran into this problem after migrating our CVS projects to SVN so we could use Trac. We ended up using the workflow branch so we could model roundup more closely for our roundup migration.

After spending time on IRC with cmlenz he suggested that CachedRepository is the place to resolve this problem. With much guidance from cmlenz I came up with this patch which makes the timeline work for SVK and multiple cvs2svn.

It goes fast too.

Index: trac/versioncontrol/cache.py
===================================================================
--- trac/versioncontrol/cache.py        (revision 3359)
+++ trac/versioncontrol/cache.py        (working copy)
@@ -43,6 +43,18 @@
         return CachedChangeset(self.repos.normalize_rev(rev), self.db,
                                self.authz)

+    def get_changesets(self, start, stop):
+        if not self.synced:
+            self.sync()
+            self.synced = 1
+        cursor = self.db.cursor()
+        cursor.execute("SELECT rev FROM revision "
+                       "WHERE time >= %s AND time < %s "
+                       "ORDER BY time", (start, stop))
+        for rev, in cursor:
+            if self.authz.has_permission_for_changeset(rev):
+                yield self.get_changeset(rev)
+
     def sync(self):
         self.log.debug("Checking whether sync with repository is needed")
         cursor = self.db.cursor()

comment:5 by Christian Boos, 13 years ago

Component: timelineversion control

Exactly. Thanks for providing the patch!

comment:6 by Christian Boos, 13 years ago

Resolution: fixed
Status: assignedclosed

Above patch committed as r3362.

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'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.