problem checking multiple files - report has fix
Created originally on Bitbucket by Anonymous
What I was trying to do:
in tortoisehg workbench I was attempting to check multiple files by
1 selecting all the files
2 checking them by selecting the checked option in the context menu obtained by a right mouse click.
What I expected: I expected for all the selected files to have their check boxes checked so that the files would be committed at next commit
what I got:
#!python
workbench popped a dialog box with the following details
#!python
** Mercurial version (2.8.2). TortoiseHg version (2.10)
** Command:
** CWD: /home/dom/workspace/dbda/DBDA2Eprograms
** Encoding: UTF-8
** Extensions loaded:
** Python version: 2.7.6 (default, Oct 26 2016, 20:30:19) [GCC 4.8.4]
** System: Linux dom-MXC061 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64
** Qt-4.8.6 PyQt-4.10.4 QScintilla-2.8.1
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/tortoisehg/hgqt/wctxactions.py", line 203, in runAction
notify = func(parent, hu, repo, files)
File "/usr/lib/python2.7/dist-packages/tortoisehg/hgqt/wctxactions.py", line 450, in check
parent.tv.model().check(files, True)
File "/usr/lib/python2.7/dist-packages/tortoisehg/hgqt/status.py", line 777, in check
assert f in checked
NameError: global name 'checked' is not defined
What I found fixed the problem : Based on the report I checked line 777 of tortoisehg/hgqt/status.py and found the line
#!python
assert f in checked
which I guessed problems should read
#!python
assert f in self.checked
since checked was not passed in as a method parameter and there was a instant attribute self.checked in code near by
On changing the code to read below I found that the problem was fixed when I reran workbench.
#!python
def check(self, files, state):
for f in files:
assert f in self.checked
self.checked[f] = state
self.checkToggled.emit(f, state)
Please do not take the following as sarcasm - thank you for your efforts and a great application- I have been using THG on a daily basis for a number of years and I believe this is the first bug that I have had to deal with. And since I have the source and it is in python I have a fighting chance of fixing the problem.