On Wed, Apr 22, 2009 at 6:05 PM, Adrian Buehlmann <[email protected]> wrote:
> On 22.04.2009 16:23, Steve Borho wrote:
>> On Wed, Apr 22, 2009 at 6:54 AM, Adrian Buehlmann <[email protected]> wrote:
>>> On 12.04.2009 10:44, TK Soh wrote:
>>>> FWIW, I just pushed my prototype code onto bitbucket, updated to
>>>> tortoisehg stable.
>>>>
>>>> http://bitbucket.org/tksoh/thg-shellext/
>>>>
>>>> To install, you need to have mercurial installed (from source),
>>>> mingw32 (with make utility) & inno setup. Then follow these [somewhat
>>>> painful] steps:
>>>>
>>>> 1. uninstall you existing tortoisehg shell extension, if any
>>>>
>>>> 2. chdir into the c++ prototype tortoisehg repo clone
>>>>
>>>> 3. register the tortoisehg python-based shellext (to provide some
>>>> registry settings and the standard context menu to help debugging):
>>>>
>>>> python tortoisehg.py --debug
>>>>
>>>> 4. build the ThgShell.DLL in tortoise/shellext directory:
>>>>
>>>> cd tortoish\shellext
>>>> make
>>>>
>>>> 5. register the DLL using the ThgShell.iss inno setup file. Note: this
>>>> will add experimental set of TortoiseHg submenus to explorer context
>>>> menu.
>>>>
>>>> 6. run the taskbar.py in tortoise directory to start the RPC server.
>>>> This will add a TortoiseHg menu to Window's taskbar. You can terminal
>>>> the RPC server with the taskbar's Exit menu at anytime.
>>>>
>>>> 7. restart Explorer.
>>>>
>>>> I simply share the work in case it would somehow be beneficial to the
>>>> upcoming work by Mark Hammond and others, since I have no doubt Mark
>>>> will be able to write the whole thing from the ground up and be surely
>>>> of far better quality. So, please feel free to ignore if you don't see
>>>> much value in it.
>>>>
>>>> Warp speed, to TortoiseHG.
>>> I've created another prototype fork of this at
>>>
>>> http://bitbucket.org/abuehl/thg-shellext/
>>>
>>> and created and pushed the following 3 changes:
>>>
>>> 1662:9fa35043dbbf | 2009-04-18 19:28 +0200 | adrian: add new
>>> tortoise\shellext\dirstate.cpp
>>> 1663:eb2ded6ea314 | 2009-04-22 00:07 +0200 | adrian: tortoise\shellext: use
>>> new dirstate.cpp for overlays
>>> 1664:1b7225d16fc7 | 2009-04-22 10:51 +0200 | adrian:
>>> tortoise\shellext\dirstate.cpp: replace spaces with tabs
>>>
>>> With these, I can see the overlay icons for files (directories
>>> not implemented) on my WinXP SP3. And it's really fast.
>>>
>>> This fork directly reads the dirstate file of the Mercurial repos from
>>> within the
>>> C++ shell extension. The separate python process is not used in this
>>> variant.
>>>
>>> Side note: I've borrowed (and adapted) code from CuteHg for this.
>>
>> This is intriguing. Care to add some numbers behind 'really fast'?
>> Perhaps using the linux kernel or some other popular, but large, hg
>> repository as a test.
>
> At the moment, I just can recommend to try it yourself. The feeling is
> just refreshing :-)
>
> I have an older netbeans repo [1] on my disk here and the icons just appear
> very fast (at least it feels like that).
>
> And this is quite crappy hardware here: Intel Pentium 4 at 2.4 GHz with
> 1 GB RAM running on WinXP SP3.
>
> I will see if I can provide some numbers.
>
> But as I said: no overlays on directories, currently (maybe, we could
> provide a config option to turn that off anyway?).
>
> What's also interesting to see is, that explorer draws all the normal icons
> immediately first and then the overlays (for the cases where there is a
> noticeable delay at all). IIRC, I've previously seen "empty" directories
> in explorer for quite a moment, until any icons appear at all -- when using
> the current legacy thg shell extension implementation.
>
> [1]:
>> hg update -r null
> 0 files updated, 0 files merged, 4720 files removed, 0 files unresolved
I tried it on my system, and I concurred in Adrian's finding. It's
indeed much faster comparing to the original implementation. Nice
work, Adrian.
As far as the numbers go, the netbean repo folder used to take ~10
seconds (or 1-2 minute on the first run) to display the icons, with
Adrian's work, it now takes only 1-2 seconds to do so. More
importantly, overall, explorer becomes significantly more responsive.
As Adrian pointed out also, there's only overlay icons on files. It's
been interesting to see how much of the speed will be impacted when we
have overlay icon on the folders too.
BTW, I have problem displaying overlay icons in some of the
repositories (Dbgview showed "IsMemberOf: HgFindRoot returns false").
And interestingly, almost all of them are mercurial crew/stable
clones. I have to use the attached patch to overcome the problem.
Perhaps Adrian can help check it out.
# HG changeset patch
# User TK Soh <[email protected]>
# Date 1240445237 -3600
# Node ID ba6fc94498bd342af14e7df43f8079eb88443c5f
# Parent a2f929b610bf7a93b199d2ef00c2f6aecc50ab4e
shellext/overlay: use GetHgRepoRoot() to find repo root
Somehow HgFindRoot() has problem find root in some repos.
diff -r a2f929b610bf -r ba6fc94498bd tortoise/shellext/IconOverlay.cpp
--- a/tortoise/shellext/IconOverlay.cpp Wed Apr 22 16:48:50 2009 +0200
+++ b/tortoise/shellext/IconOverlay.cpp Thu Apr 23 01:07:17 2009 +0100
@@ -66,11 +66,11 @@
char path[MAX_PATH] = "";
strncat(path, mbstr.c_str(), MAX_PATH);
- std::string hgroot;
+ std::string hgroot = GetHgRepoRoot(path);
- if (!HgFindRoot(path, &hgroot))
+ if (hgroot.empty())
{
- TDEBUG_TRACE("IsMemberOf: HgFindRoot returns false");
+ TDEBUG_TRACE("IsMemberOf: Not a Hg repo (hgroot is empty)");
return S_FALSE;
}
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Tortoisehg-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop