[Trac-tickets] Re: [The Trac Project] #2353: Timeline out of order when viewing SVK repository

The Trac Project noreply at edgewall.com
Sat Jun 3 08:22:43 CDT 2006


#2353: Timeline out of order when viewing SVK repository
-----------------------------+----------------------------------------------
 Reporter:  kmr at flymine.org  |        Owner:  cboos   
     Type:  defect           |       Status:  assigned
 Priority:  normal           |    Milestone:  0.10    
Component:  timeline         |      Version:  devel   
 Severity:  minor            |   Resolution:          
 Keywords:                   |  
-----------------------------+----------------------------------------------
Changes (by djc at object-craft.com.au):

  * milestone:  0.11 => 0.10

Comment:

 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()
 }}}

-- 
Ticket URL: <http://projects.edgewall.com/trac/ticket/2353>
The Trac Project <http://trac.edgewall.com/>


More information about the Trac-Tickets mailing list