1. TortoiseHg
  2. TortoiseHg
  3. thg
Issue #135 resolved

abort on bad hgignore pattern

Liam Staskawicz
created an issue

Hi - I edited my hgignore to include an invalid pattern, clicked F5 to refresh in thg, and it was unhappy:

{{{

!python

Please report this bug to http://bitbucket.org/tortoisehg/thg/issues Mercurial version (1.7.5+4-8f5c865b7b4a). TortoiseHg version (1.9.2) Command: --nofork workbench CWD: C:\code\chibisift Extensions loaded: fixfrozenexts Python version: 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)] Windows version: (5, 1, 2600, 2, 'Service Pack 3') Processor architecture: x86 * Qt-4.7.1 PyQt-4.8.2 Traceback (most recent call last): File "tortoisehg\hgqt\status.pyo", line 237, in reloadComplete File "tortoisehg\hgqt\status.pyo", line 251, in updateModel File "tortoisehg\hgqt\status.pyo", line 479, in init File "mercurial\context.pyo", line 700, in modified File "mercurial\util.pyo", line 169, in get File "mercurial\context.pyo", line 654, in _status File "mercurial\localrepo.pyo", line 1134, in status File "mercurial\dirstate.pyo", line 645, in status File "mercurial\dirstate.pyo", line 466, in walk File "mercurial\util.pyo", line 169, in get File "mercurial\dirstate.pyo", line 108, in _ignore File "mercurial\ignore.pyo", line 101, in ignore Abort: C:\Keil\projects\STM32F10x\chibisift.hgignore: invalid pattern (relre): .bak

}}}

Comments (6)

  1. Steve Borho

    Thanks, we do need to catch that better. And indeed you need to fix your .hgignore file, it needs a syntax: glob header.

    Did you edit the .hgignore file by hand, or did you add that glob using one of our tools?

  2. Steve Borho

    Nice, we actually do catch this exception in the refresh thread, but because the initial status() call is aborted, the wctx tries to run status() again later as we're filling the file model.

    This is going to take some thought.

  3. Steve Borho

    status: improve refresh thread, make more robust (closes #135)

    1 - allocate a fresh repo object for the thread, do not use a thgrepo 2 - do not return a wctx if the status() call raised an exception 3 - always return a dictionary for patchecked 4 - use one try/except block for clarity and simplicity

    2de46fd147d0

  4. Log in to comment