On Mon, Jul 26, 2010 at 12:58 PM, Kurt Granroth <[email protected]> wrote: > On 07/26/2010 10:40 AM, Kurt Granroth wrote: >> Moving to TortoiseHg list since it's not mercurial specific. >> >> To recap, when using TortoiseHg to clone a repository with .hgeol, the >> hgeol hooks are never called and, as a result, the repository is not >> converted to the proper line endings. This is 100% reproducible under >> both Windows and Linux. >> >> I am pretty sure I know why but lack the proper knowledge of TortoiseHg >> to suggest a permanent fix. >> >> The problem is that the hooks are attached to the "wrong" UI object. >> >> Okay, so hgtk.run() calls 'extension.loadall(ui)'. This is the function >> that calls the extensions' uisetup()... and this is where the necessary >> hook is setup so that hgeol is called during the update. So far, so good. >> >> Unfortunately, the hook is attached to the startup UI object, *not* the >> GtkUi object that is used to actually perform the clone/update later on. >> So by the time dispatch() is called in hgthread, the hook is long gone. >> >> We can get around this by performing the extensions.loadall() *after* >> initializing our GtkUi object in hgthread. That function takes care to >> only call uisetup once, though, so we can't do loadall twice. >> >> I've attached a patch that fixes this issue. With this, uisetup isn't >> called until after our "real" ui object is created and so the hook is >> attached properly. hgeol works perfectly. >> >> I have no idea if this will have later ramifications, though. Maybe the >> loadall(ui) was done up front for a reason? > [snip] > > Sorry, that patch does *not* fix this problem. I didn't have a clean > testing environment. It seems that multiple GtkUi objects are created > and only one of them has the right hooks. > > It's looking like the true fix must involve somehow copying over the > hooks from the original UI object into the various GtkUi copies.
I'd like to get Martin's input on this, but he is on an extended vacation. -- Steve Borho ------------------------------------------------------------------------------ The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://ad.doubleclick.net/clk;226879339;13503038;l? http://clk.atdmt.com/CRS/go/247765532/direct/01/ _______________________________________________ Tortoisehg-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tortoisehg-discuss

