Fix actions when the menu is invoked outside a repository.
Updated 7 months, 1 week ago
| Germán Póo-Caamaño | Reviewers | ||
| tortoise-hg | |||
| None | tortoisehg-dev | ||
nautilus: fix menu for non-repo dirs
Before applying this patch, the .xsession-errors has the following output:
Traceback (most recent call last):
File "/home/gpoo/.nautilus/python-extensions/nautilus-thg.py", line 96, in _clone_cb
self._run_dialog('clone', [vfs_file])
File "/home/gpoo/.nautilus/python-extensions/nautilus-thg.py", line 172, in _run_dialog
cmdopts += ['--root', repo.root]
AttributeError: 'NoneType' object has no attribute 'root'
Traceback (most recent call last):
File "/home/gpoo/.nautilus/python-extensions/nautilus-thg.py", line 126, in _init_cb
self._run_dialog('init', [vfs_file])
File "/home/gpoo/.nautilus/python-extensions/nautilus-thg.py", line 172, in _run_dialog
cmdopts += ['--root', repo.root]
AttributeError: 'NoneType' object has no attribute 'root'
This happens because in fact there is no repo at all. Easy to test. Just call the menu
inside and outside a repo.