#10759 closed defect (fixed)
CachedRepository doesn't cache non-latest changesets after caching latest changeset
| Reported by: | Jun Omae | Owned by: | Jun Omae |
|---|---|---|---|
| Priority: | high | Milestone: | 0.12.4 |
| Component: | version control | Version: | 0.12 |
| Severity: | normal | Keywords: | git cache |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
CachedRepository caches newer changesets than youngest_rev in metadata. In subversion, a committed changeset is always newer than the cached changesets and will be cached. However, in Git, a pushed change is not always newer and will not be cached….
Reproduce
- Setup Trac 0.12-stable with git-plugin (or 1.0dev with tracopt.git)
- Setup git://github.com/jun66j5/trac-git-cache.git
jun66j5@gotanda:1672$ git log --all --oneline --graph * 9f5e555 [master] third | * 97cbb3c [dev] second |/ * 57fa298 [master] first
- Push
masterbranch.57fa298and9f5e555will be cached. - Push
devbranch.97cbb3cwill NOT be cached.
Workaournd
If the changeset is not cached at CachedRepository.sync_changeset(rev), creates revision and node_change records.
Attachments (0)
Change History (9)
comment:1 by , 13 years ago
| Milestone: | next-minor-0.12.x → next-stable-1.0.x |
|---|
follow-up: 6 comment:5 by , 13 years ago
Also, it's a change on 0.12-stable, so is there a reason why you thought that to be too risky for 0.12.4? I'd be OK with 0.12.4, provided a few more testing.
comment:6 by , 13 years ago
| Milestone: | next-stable-1.0.x → 0.12.4 |
|---|
Jun, did you have the chance to validate my follow-up?
Looks good, Thanks.
Also, it's a change on 0.12-stable, so is there a reason why you thought that to be too risky for 0.12.4? I'd be OK with 0.12.4, provided a few more testing.
No reason, however, I think that there is a little risk.
I want to push to 0.12.4 and I'll provide unit tests for the changes to avoid the risk.
comment:8 by , 13 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:9 by , 13 years ago
| Owner: | set to |
|---|



This is somehow related to the changeset hook ticket #10730: we could probably try to detect all what's new since last time, starting from all the refs, but better do that proactively by using hooks and then update the cache when changes are pushed in (or "deleted").
Now about the proposed workaround, it looks OK but would probably benefit from a little refactoring (I'll follow-up on this).