Opened 19 years ago
Closed 19 years ago
#2353 closed defect (fixed)
Timeline out of order when viewing SVK repository
Reported by: | Owned by: | Christian Boos | |
---|---|---|---|
Priority: | normal | Milestone: | 0.10 |
Component: | version control | Version: | devel |
Severity: | minor | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal 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 , 19 years ago
Milestone: | → 0.10 |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:3 by , 19 years ago
This also occurs when using svnadmin load
to merge multiple repositories.
comment:4 by , 19 years ago
Milestone: | 0.11 → 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()
comment:5 by , 19 years ago
Component: | timeline → version control |
---|
Exactly. Thanks for providing the patch!
comment:6 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Above patch committed as r3362.
That should be fixed once
CachedRepository.get_changesets()
gets implemented.