thgimport: trying to import non existing file
Created originally on Bitbucket by sintzoff (André Sintzoff)
Typing return when the src_combo contains a non-existing filename generates the following traceback
{{{ #!python ** Mercurial version (1.8.4+12-a67e866f46f9). TortoiseHg version (2.0.5+10-920eff492895) ** Command: import tutu.patc ** CWD: /Users/as/hg-repo/thg ** Extensions loaded: rebase, transplant, hgk, graphlog, patchbomb, mercurial_keyring, zeroconf, extdiff, mq, gpg ** Python version: 2.6.6 (r266:84374, Aug 31 2010, 11:00:51) [GCC 4.0.1 (Apple Inc. build 5493)] ** Qt-4.7.2 PyQt-4.8.3 Traceback (most recent call last): File "/Users/as/hg-repo/thg/tortoisehg/hgqt/thgimport.py", line 268, in thgimport cmdline.extend(self.cslist.curitems) TypeError: 'NoneType' object is not iterable
}}}
To avoid the traceback, the following workaround could do the job but the user is not informed of the problem. {{{ diff --git a/tortoisehg/hgqt/thgimport.py b/tortoisehg/hgqt/thgimport.py --- a/tortoisehg/hgqt/thgimport.py +++ b/tortoisehg/hgqt/thgimport.py @@ -252,6 +252,8 @@
def thgimport(self):
idx = self.targetcombo.currentIndex()
-
if self.cslist.curitems is None:
-
return if idx == 1: # import to shelf existing = self.repo.thgshelves()
}}}