Edgewall Software
Modify

Opened 15 years ago

Last modified 2 years ago

#8417 new enhancement

CachedRepository support in TracMercurial

Reported by: asterix@… Owned by: Christian Boos
Priority: high Milestone: plugin - mercurial
Component: plugin/mercurial Version: 0.11.1
Severity: major Keywords: mercurial changeset patch
Cc: awagner@…, richard.liao.i@…, bkocherov@…, miguel.araujo.perez@…, ismael@…, macke@…, me@…, leho@…, dev@…, mmitar@… Branch:
Release Notes:
API Changes:
Internal 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)

backend.py (57.2 KB ) - added by me@… 13 years ago.
I have implemented a naive version of MecrurialCachedRepository using a backward-traversing resync which overrides the default resync algorithm.
backend.py.patch (13.4 KB ) - added by me@… 13 years ago.
And this is the diff.
backend.2.py (54.6 KB ) - added by me@… 13 years ago.
Revised patch: applied the set diff algorithm by miguel.araujo.perez and now ticket commit updater works correctly
backend.py.2.patch (10.9 KB ) - added by me@… 13 years ago.
Diff for the revised patch
backend.3.py (55.1 KB ) - added by me@… 13 years ago.
Revised again: error handling & branch display in the timeline
backend.py.3.patch (11.4 KB ) - added by me@… 13 years ago.
Diff for the revised patch

Download all attachments as: .zip

Change History (29)

comment:1 by Christian Boos, 15 years ago

Milestone: not applicable
Priority: normalhigh
Severity: normalmajor

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…

comment:2 by Christian Boos, 15 years ago

Summary: revision table not updatedCachedRepository support in TracMercurial

comment:3 by Christian Boos, 15 years ago

Milestone: not applicablemercurial-plugin
Severity: majorcritical

comment:4 by awagner@…, 14 years ago

Cc: awagner@… added

comment:5 by richard.liao.i@…, 14 years ago

Cc: richard.liao.i@… added

comment:6 by miguel.araujo.perez@…, 14 years ago

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.

http://github.com/maraujop/TracMercurialChangesetPlugin

comment:7 by bkocherov@…, 14 years ago

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 by Boris Kocherov <bkocherov@…>, 14 years ago

Cc: bkocherov@… added

comment:9 by Miguel Araujo <miguel.araujo.perez@…>, 14 years ago

Cc: miguel.araujo.perez@… added

comment:10 by Ismael de Esteban <ismael@…>, 14 years ago

Cc: ismael@… added

comment:11 by Marcus Lindblom <macke@…>, 14 years ago

Cc: macke@… added

comment:12 by Christian Boos, 13 years ago

Cc: me@… added

#10135 was closed as duplicate.

by me@…, 13 years ago

Attachment: backend.py added

I have implemented a naive version of MecrurialCachedRepository using a backward-traversing resync which overrides the default resync algorithm.

by me@…, 13 years ago

Attachment: backend.py.patch added

And this is the diff.

comment:13 by me@…, 13 years ago

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.

by me@…, 13 years ago

Attachment: backend.2.py added

Revised patch: applied the set diff algorithm by miguel.araujo.perez and now ticket commit updater works correctly

by me@…, 13 years ago

Attachment: backend.py.2.patch added

Diff for the revised patch

by me@…, 13 years ago

Attachment: backend.3.py added

Revised again: error handling & branch display in the timeline

by me@…, 13 years ago

Attachment: backend.py.3.patch added

Diff for the revised patch

comment:14 by lkraav <leho@…>, 13 years ago

Cc: leho@… added

comment:15 by Joongi Kim <me@…>, 13 years ago

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 by Joongi Kim <me@…>, 13 years ago

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.

comment:17 by dev@…, 11 years ago

Cc: dev@… added

comment:18 by Ryan J Ollos, 9 years ago

#9485 closed as a duplicate.

comment:19 by Mitar, 9 years ago

Cc: mmitar@… added

comment:20 by anonymous, 9 years ago

Type: defectenhancement

comment:21 by figaro, 9 years ago

Keywords: patch added
Severity: criticalmajor

in reply to:  14 comment:22 by anonymous, 6 years ago

Replying to lkraav <leho@…>:

Can you pls tell where / how to use this patch, as it is still not working in the latest TracMercurial?

Thanks

in reply to:  13 comment:23 by anonymous, 6 years ago

Replying to 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.

Can you pls tell where / how to use this patch, as it is still not working in the latest TracMercurial?

Also, how to trigger the initial caching once this file is patched?

Thanks

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Christian Boos.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from Christian Boos to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.