Issue #548 open

shellext: Wrong overlay icons for directories containing non-ascii file names

Esben Skovenborg
created an issue

The red overlay icon is shown for any directory containing a committed, clean file with non-ascii characters in its name (such as the Danish letter 'æ'). The icon on the file itself is green, as it should be, however the icon for parent directory is red. The command "hg stat" returns nothing, i.e. clean state. The Workbench also shows no changes in the Working Directory. In other words, only the directory icon is wrong. This is TortoiseHG 2.0.3, and XP/SP3.

Please note that this bug is not related to any issues there may be with THG and the fixutf8 extensions - fixutf8 was not enabled here.

Comments (16)

  1. Esben Skovenborg reporter

    I just cloned the repository on another PC, which is also running THG 2.0.3 and XP/SP3. On this other PC there is no problem with the overlay icons. What could be causing this difference?

  2. Esben Skovenborg reporter

    When I use "Update Icons" the icons of all the directories change to the blue question-mark for a second or so - after that the ascii-only directories return to the green icon and the non-ascii directories return to the red icon. It seems quite consistent. A directory containing only ascii-named files but with a non-ascii letter in its own name also gets the red icon, by the way.

  3. Steve Borho

    That localizes the problem to the routine that updates the .hg/thgstatus file. If you would like to go digging through the source for this it's in tortoisehg/util/shlib.py at line 61

  4. Esben Skovenborg reporter

    Well, I just tried deleting the .hg/thgstatus for my test repo, and now the directory icons are correct! Even when adding and committing new non-ascii files the overlay icons change as expected. The thgstatus file was 0 bytes, by the way - is that normal?

    Is this 'fix' safe in general - even for repositories where the thgstatus file actually contains something?

  5. Steve Borho

    it's always safe to delete the file, it will be re-generated on demand. It's not usual for the file to be empty. I'm not sure what could cause that. Perhaps you didn't have rights to overwrite the previous file. It's something to keep an eye on.

  6. Adrian Buehlmann

    Yes. Deleting .hg/thgstatus at any time is always safe and fine. It will be recreated automatically by the TortoiseHgOverlayServer.exe, which must be running.

    thgstatus has size 0 if all files are clean. So this is a normal state, yes.

  7. Esben Skovenborg reporter

    Deleting a few .hg/thgstatus files seems to have completely solved the problem :)

    The permissions of an 'old' thgstatus file and a newly recreated one are identical, so it seems unlikely that the problem was caused by insufficient rights. Perhaps something related to the encoding of non-ascii paths in the thgstatus files? Anyhow, the problem is gone - thanks for your help.

  8. Esben Skovenborg reporter

    Alas, now the problem has returned. The wierd thing is that the problem reappeared in all my repositories (with any directories with non-ascii named files) at the same time. Deleting just one of the their .hg/thgstatus files did not fix the corresponding repo, in this case.

    However, killing the THG Overlay Icon Server, and manually restarting it, was an effective cure. The icons of all the affected repositories then soon returned to their correct state - even without deleting their thgstatus file.

    While the problem was present I opened the thgstatus file of an affected 'clean' repo. The thgstatus contained a line "rXXX" for each of the directories "XXX" where the red icon was wrongly shown. After restarting the Overlay Icon Server these lines were deleted from the thgstatus file.

  9. Adrian Buehlmann

    FWIW, I for myself stick to using ASCII filenames only for files I track with Mercurial (even though my correctly spelled family name is Bühlmann, which isn't exactly ASCII either :-).

    I'm already happy enough if Mercurial on Windows works correctly with ASCII filenames.

  10. Esben Skovenborg reporter

    The error still occurs - often after hours of work involving THG with correct icons. Killing and restarting the Overlay Icon Server has so far always been an effective workaround. The bad icons are corrected as soon as the corresponding thgstatus is updated.

    There are no crash dumps in %APPDATA%\TortoiseHg\OverlayServerLog.txt, except for when I 'Exit' the Icon Server - but that might be normal:

    [04/14/11 18:27:56] MainWindow.exit_application
    [04/14/11 18:27:57] MainWindow.stop_pipe_server
    [04/14/11 18:27:57] PipeServer.SvcStop
    [04/14/11 18:27:57] Updater thread terminating
    [04/14/11 18:27:57] Traceback (most recent call last):
      File "TortoiseHgOverlayServer.py", line 199, in stop_pipe_server
      File "tortoisehg\util\thread2.pyo", line 52, in terminate
      File "tortoisehg\util\thread2.pyo", line 47, in raise_exc
      File "tortoisehg\util\thread2.pyo", line 19, in _async_raise
    ValueError: invalid thread id
    [04/14/11 18:27:57] MainWindow.OnDestroy
    [04/14/11 18:27:57] Goodbye
    
  11. Log in to comment