Opened 4 years ago
Last modified 2 years ago
#8417 new defect
CachedRepository support in TracMercurial
| Reported by: | asterix@… | Owned by: | cboos |
|---|---|---|---|
| Priority: | high | Milestone: | plugin - mercurial |
| Component: | plugin/mercurial | Version: | 0.11.1 |
| Severity: | critical | Keywords: | mercurial changeset |
| Cc: | awagner@…, richard.liao.i@…, bkocherov@…, miguel.araujo.perez@…, ismael@…, macke@…, me@…, leho@… | ||
| Release Notes: | |||
| API Changes: | |||
Description
I used trac with svn, and switched to mercurial. the revision table in postgres is no more updated with new changesets. So when I do a search in changesets, new changesets are not listed. Did I forgot to configure something?
Attachments (6)
Change History (22)
comment:1 Changed 4 years ago by cboos
- Milestone set to not applicable
- Priority changed from normal to high
- Severity changed from normal to major
comment:2 Changed 4 years ago by cboos
- Summary changed from revision table not updated to CachedRepository support in TracMercurial
comment:3 Changed 3 years ago by cboos
- Milestone changed from not applicable to mercurial-plugin
- Severity changed from major to critical
comment:4 Changed 3 years ago by awagner@…
- Cc awagner@… added
comment:5 Changed 3 years ago by richard.liao.i@…
- Cc richard.liao.i@… added
comment:6 Changed 3 years ago by miguel.araujo.perez@…
I have developed a plugin called TracMercurialChangesetPlugin? for fixing this issue. It allows you to sync revision table if you are using Mercurial. Then you can create a hook to keep it synced :) I hope it helps. I have mailed cboos about it, see If he can integrate into Trac-Mercurial.
comment:7 Changed 3 years ago by bkocherov@…
2miguel.araujo.perez
That do you think about use FULLHASH as 'rev' in opposite
NUMBER:SHORTHASH? I think only fullhash real unique. If repository very distributed then in different placess world changesets can be different NUMBER.
comment:8 Changed 3 years ago by Boris Kocherov <bkocherov@…>
- Cc bkocherov@… added
comment:9 Changed 3 years ago by Miguel Araujo <miguel.araujo.perez@…>
- Cc miguel.araujo.perez@… added
comment:10 Changed 3 years ago by Ismael de Esteban <ismael@…>
- Cc ismael@… added
comment:11 Changed 3 years ago by Marcus Lindblom <macke@…>
- Cc macke@… added
Changed 2 years ago by me@…
I have implemented a naive version of MecrurialCachedRepository? using a backward-traversing resync which overrides the default resync algorithm.
comment:13 Changed 2 years ago by me@…
The above version is not complete yet. It's quick & dirty demo.
I'm inspecting its bug(?) that newly commited/pushed changesets are not synced correctly after the resync, as well as ticket commit updates.
Changed 2 years ago by me@…
Revised patch: applied the set diff algorithm by miguel.araujo.perez and now ticket commit updater works correctly
comment:14 Changed 2 years ago by lkraav <leho@…>
- Cc leho@… added
comment:15 Changed 2 years ago by Joongi Kim <me@…>
The remaining issue:
- We need some efficient implementation like hg incoming/outgoing to find out which changesets should be synchronized. (The current "whole set comparison" would not scale well with very large repositories with more than 10k changesets.)
One mistake: must delete import pdb; pdb.set_trace() in line 744 of the patched backend.py before applying the patch to the trunk.
comment:16 Changed 2 years ago by Joongi Kim <me@…>
Another idea:
- Currently CachedRepository only have one sync() method which is called by both 'resync' and 'commit ticket updater'. For the latter case, we can use hints from the commit ticket updater to determine which revisions should be synchronized since they are given as the command line arguments. We do not have to the same thing twice. We could add optional arguments to sync() method to handle it.



No, I forgot to implement it ;-)
More seriously, TracMercurial works quite well now even for big repositories, without a cache.
However the cache would be needed for enabling the search in changesets and for getting faster and more accurate results for the timeline, so it's about time this gets implemented…