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?
diff --git a/tortoisehg/hgtk/hgthread.py b/tortoisehg/hgtk/hgthread.py
--- a/tortoisehg/hgtk/hgthread.py
+++ b/tortoisehg/hgtk/hgthread.py
@@ -10,7 +10,7 @@ import Queue
import time
import urllib2
-from mercurial import ui, util, error
+from mercurial import ui, util, error, extensions
from tortoisehg.util.i18n import _
from tortoisehg.util import hglib, thread2
@@ -120,6 +120,9 @@ class HgThread(thread2.Thread):
self.ret = None
self.postfunc = postfunc
self.parent = parent
+ # load extensions with the new ui -- needed for hooks
+ hglib.wrapextensionsloader()
+ extensions.loadall(self.ui)
thread2.Thread.__init__(self)
def getqueue(self):
diff --git a/tortoisehg/hgtk/hgtk.py b/tortoisehg/hgtk/hgtk.py
--- a/tortoisehg/hgtk/hgtk.py
+++ b/tortoisehg/hgtk/hgtk.py
@@ -256,8 +256,8 @@ def runcommand(ui, args):
else:
lui = ui
- hglib.wrapextensionsloader() # enable blacklist of extensions
- extensions.loadall(ui)
if options['quiet']:
ui.quiet = True
------------------------------------------------------------------------------
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