Edgewall Software

Ticket #2353 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

Timeline out of order when viewing SVK repository

Reported by: kmr@… Owned by: cboos
Priority: normal Milestone: 0.10
Component: version control Version: devel
Severity: minor Keywords:
Cc:

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

Change History

Changed 3 years ago by cboos

  • owner changed from jonas to cboos
  • status changed from new to assigned
  • milestone set to 0.10

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

Changed 2 years ago by cboos

  • milestone changed from 0.10 to 0.11

Post-poning.

Changed 2 years ago by athomas

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

Changed 2 years ago by djc@…

  • milestone changed from 0.11 to 0.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()

Changed 2 years ago by cboos

  • component changed from timeline to version control

Exactly. Thanks for providing the patch!

Changed 2 years ago by cboos

  • status changed from assigned to closed
  • resolution set to fixed

Above patch committed as r3362.

Add/Change #2353 (Timeline out of order when viewing SVK repository)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.