Bugs item #1894728, was opened at 2008-02-15 17:54 Message generated for change (Comment added) made by sborho You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=968354&aid=1894728&group_id=199155
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: overlay icons Group: None >Status: Pending Resolution: None Priority: 5 Private: No Submitted By: Adrian Buehlmann (adrianbuehlm) Assigned to: Nobody/Anonymous (nobody) Summary: Intermittent missing overlay icons Initial Comment: Hi all I found a problem with the overlay icons in TortoiseHg on my Windows XP SP2 box. The problem happens with plain release 0.3 and with latest and greatest http://tortoisehg.sourceforge.net/hg/tortoisehg-crew/rev/e2244d8d10d0 Steps to produce the problem: In an empty directory "testrepo1-hg", create a script named "create-repo.cmd" which contains the following Windows cmd script code (also attached to this email): ''' @echo off if exist ".hg" goto has_repo hg init for /L %%G in (0,1,1) do ( for /L %%H in (0,1,9) do ( for /L %%I in (0,1,9) do ( echo This is file-%%G%%H%%I.txt >file-%%G%%H%%I.txt ) ) ) hg -q add *.txt hg ci -m "1" echo created repo goto end :has_repo echo Error: repo already exists! :end ''' then cd into testrepo1-hg and execute create-repo. This will create a repository with 200 files "file-000.txt"..."file-199.txt". The green checkmark appears -- as expected -- on all *.txt files. Now, do hit the key "F5" (refresh) multiple times in a row. After a few "F5" key hits, suddenly some of the *.txt files have no overlay icon at all! If I continue hitting F5, the set of files without overlay icon changes, sometimes all files do have the correct overlay icon, sometimes not. See also the attached screenshot "1.png" I usually register the extension with: > python tortoisehg.py bin path = C:\Documents and Settings\adi\My Documents\hg-repos\tortoisehg-crew Registered: Mercurial.ShellExtension.ContextMenu Mercurial Shell Extension registration complete. Registered: Mercurial.ShellExtension.ChangedOverlay Merucurial icon overlay shell extension for changed files registration complete. Registered: Mercurial.ShellExtension.AddedOverlay Merucurial icon overlay shell extension for added files registration complete. Registered: Mercurial.ShellExtension.UnchangedOverlay Merucurial icon overlay shell extension for unchanged files registration complete. TortoiseHg registered and unregister it with: > python tortoisehg.py --unregister bin path = C:\Documents and Settings\adi\My Documents\hg-repos\tortoisehg-crew Unregistered: Mercurial.ShellExtension.ContextMenu Mercurial Shell Extension unregistration complete. Unregistered: Mercurial.ShellExtension.ChangedOverlay Merucurial icon overlay shell extension for changed files unregistration complete. Unregistered: Mercurial.ShellExtension.AddedOverlay Merucurial icon overlay shell extension for added files unregistration complete. Unregistered: Mercurial.ShellExtension.UnchangedOverlay Merucurial icon overlay shell extension for unchanged files unregistration complete. TortoiseHg unregistered And kill/restart explorer.exe (using Windows Task Manager) after unregister/register. I also verified that my additionally installed binary packaged TortoiseHg 0.3 was unregistered before I cloned http://tortoisehg.sourceforge.net/hg/tortoisehg-crew and registered the latter. Installed "hg" is: > hg version Mercurial Distributed SCM (version 9f1e6ab76069+tortoisehg) Can anyone reproduce this? Thanks for reading this far :-) ---------------------------------------------------------------------- >Comment By: Steve Borho (sborho) Date: 2009-02-16 00:19 Message: I just pushed a fix to crew that fixed this problem for me. It will be in 0.7 ---------------------------------------------------------------------- Comment By: Ben Houston (bhouston) Date: 2008-08-25 18:13 Message: Logged In: YES user_id=77981 Originator: NO I am constantly missing overlay icons. Happens on both WinXP and Vista. ---------------------------------------------------------------------- Comment By: TK Soh (tksoh) Date: 2008-02-16 20:46 Message: Logged In: YES user_id=411637 Originator: NO Keep hitting F5 is good ;-) Thanks for helping to do the test. I guess it'd be fairly safe now to point the problem to sys.stdout. I will see if I can find a good workaround that will address this, but still let --debug send debugging messages to win32trace. ---------------------------------------------------------------------- Comment By: Adrian Buehlmann (adrianbuehlm) Date: 2008-02-16 11:15 Message: Logged In: YES user_id=1456720 Originator: YES In response to TK Soh (thanks for your responses, BTW!): I did a "hg update" to the revision http://tortoisehg.sourceforge.net/hg/tortoisehg-crew/rev/e2244d8d10d0 in my local TortoiseHG repo and registered TortoiseHG like this: > python tortoisehg.py --debug bin path = C:\Documents and Settings\adi\My Documents\hg-repos\tortoisehg-crew Registered: Mercurial.ShellExtension.ContextMenu (for debugging) Mercurial Shell Extension registration complete. Registered: Mercurial.ShellExtension.ChangedOverlay (for debugging) Mercurial icon overlay shell extension for changed files registration complete. Registered: Mercurial.ShellExtension.AddedOverlay (for debugging) Mercurial icon overlay shell extension for added files registration complete. Registered: Mercurial.ShellExtension.UnchangedOverlay (for debugging) Mercurial icon overlay shell extension for unchanged files registration complete. TortoiseHg registered I can confirm that the testrepository created using my "create-repo.cmd" batch file (as attached) always, consistently and correctly shows *all* green checkmark overlay icons on *all* files, no matter how often I hit the "F5" key. ---------------------------------------------------------------------- Comment By: TK Soh (tksoh) Date: 2008-02-16 11:07 Message: Logged In: YES user_id=411637 Originator: NO If you can, please try installing on both computers from source with and without --debug option. Things get complicated when coming to debugging shell extension. So the more data can always help. Let's bring the brainstorming session into a separate discussion. The tortoisehg-develop ML will be the right place for this. ---------------------------------------------------------------------- Comment By: Adrian Buehlmann (adrianbuehlm) Date: 2008-02-16 04:34 Message: Logged In: YES user_id=1456720 Originator: YES This morning (GMT+1), I tested this on a different WindowsXP SP2 computer (my brother Frank's one) which has a clean TortoiseHg 0.3 binary install and I failed to reproduce this bug :(. BTW: create-repo.cmd just worked fine on that computer as well. I downloaded the script from https://sourceforge.net/tracker/download.php?group_id=199155&atid=968354&file_id=266515&aid=1894728, saved it in an empty directory and double-clicked it. I got the repo as expected. I haven't yet tried --debug. Will do so later. Some wild brainstorming (paranoia?) from my side: TortoiseHg installs three overlay icons handlers (tech reference: http://msdn2.microsoft.com/en-us/library/bb776858.aspx) as three COM interfaces. All three COM objects are using the same cache variable (tortoise/iconoverlay.py, global var "overlay_cache"), personally, I really wouldn't expect this to be a problem, but what if explorer.exe fires up multiple threads hammering on all three COM interfaces in parallel? I have no idea if explorer.exe actually does this. But might be worth to check/think about. ---------------------------------------------------------------------- Comment By: TK Soh (tksoh) Date: 2008-02-15 21:36 Message: Logged In: YES user_id=411637 Originator: NO Okay. I'm fairly sure something is wrong with sys.stdout when running within the overlay icon extensions. Apparently when registered with --debug, the problem was suppressed as win32trace takes over sys.stdout. The possible workarounds I have tried are: 1. remove all print statements in iconoverlay.py 2. redirect sys.stdout to null But we still need the prints for debugging purpose. So we'll have to come up with something more intelligent. ---------------------------------------------------------------------- Comment By: TK Soh (tksoh) Date: 2008-02-15 19:48 Message: Logged In: YES user_id=411637 Originator: NO I've notice this recently too. The strange thing is that it seemed to happen only when tortoisehg is registered without --debug option. Perhaps you can help me double confirm this by registering with --debug option? BTW, for some reason, I wasn't able to create the test repo with your create-repo.cmd script. I generated the test files with a python script and commit them manually instead. ---------------------------------------------------------------------- Comment By: Adrian Buehlmann (adrianbuehlm) Date: 2008-02-15 17:56 Message: Logged In: YES user_id=1456720 Originator: YES File Added: create-repo.cmd ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=968354&aid=1894728&group_id=199155 ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Tortoisehg-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop
