On Mon, Jan 12, 2009 at 12:15 AM, TK Soh <[email protected]> wrote:
> On Mon, Jan 12, 2009 at 3:30 AM, Steve Borho <[email protected]> wrote:
> > On Sun, Jan 11, 2009 at 9:24 PM, Peter Ruibal <[email protected]> wrote:
> >>
> >>
> >> On Sun, Jan 11, 2009 at 3:39 PM, TK Soh <[email protected]> wrote:
> >>>
> >>> On Sun, Jan 11, 2009 at 7:39 PM, Peter Ruibal <[email protected]>
> wrote:
> >>> >
> >>> >
> >>> > On Sat, Jan 10, 2009 at 4:47 PM, TK Soh <[email protected]> wrote:
> >>> >>
> >>> >> You need to try it in a repo where a merge cset has a parent located
> >>> >> outside the displayed pages (the changelog viewer loads changesets
> by
> >>> >> pages of [default] 500).
> >>> >
> >>> > I tried making a sample repository at
> >>> > http://bitbucket.org/fmoo/_dummy-500-cset-parent/ , but I don't
> think
> >>> > my
> >>> > hgtk log is producing the same result as yours... check out cset 501
> >>> > (tagged with 'parent500old')
> >>>
> >>> What did you see? I saw the same bug with your repo, where clicking on
> >>> the parent link of cset 501 didn't bring it to cset 0.
> >>
> >> I see it now... yeah, that's weird. I must have been out of it earlier
> >> today...
> >>
> >> So the following dangerous hack (!!) to hggtk.vis.treeview worked for me
> >> if it's worth anything:
>
> First of all, a very interesting hack indeed ;-)
>
> >> def set_revision_id(self, revid):
> >> """Change the currently selected revision.
> >>
> >> :param revid: Revision id of revision to display.
> >> """
> >> + if revid not in self.index:
>
> Why another 'if' and instead of 'else'?
>
> >> + gobject.idle_add(self.next_revision_batch)
> >> + gobject.idle_add(self.set_revision_id, revid, priority =
> >> gobject.PRIORITY_LOW)
> >> + return
> >> +
>
> The documentation on idle_add isn't very clear. Does it guarantee
> set_revision_id() will be called after next_revision_batch is done?
> Another thing it's not very clear is that whether gobject.PRIORITY_LOW
> is intended for idle_add, as I can see two constants carrying the
> string "IDLE": gobject.PRIORITY_HIGH_IDLE and
> gobject.PRIORITY_DEFAULT_IDLE.
>
> Also, what is the next_revision_batch call still doesn't load the revid
> needed?
>
> >> if revid in self.index:
> >> row = self.index[revid]
> >> self.treeview.set_cursor(row)
> >> self.treeview.grab_focus()
> >
> > This isn't too bad of a work-around if there were checks to make sure
> that:
> >
> > 1) Only one instance of 'next_revision_batch' were allowed to be running
> at
> > a time
> > 2) Stops when all history has been loaded
>
> Are we at risk of running into re-entrance issue?
Not strictly re-entrancy, but we can end up with many batch-loading threads
running at the same time. Each time the 'low priority' event fires, it
tries to set the revision ID again.
If the revision isn't loaded, it will trigger another batch load. If GTK
can issue the low
priority event before the normal priority events are done, then it will
cause us real problems.
I think it's the right idea, though, to have a background thread that tries
to set the
rev-id until it succeeds or all history is loaded.
--
Steve
------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Tortoisehg-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop