unpushed icon indicating copy to clipboard operation
unpushed copied to clipboard

crashes without mercurial installed

Open matkoniecz opened this issue 8 years ago • 0 comments

On encoutering folder with .hg subfolder this script attempts to call mercurial. If mercurial is not installed (may be typical today as git seems to won version control wars) this script crashes.

I would expect error message or even better - complaint ans skipping over such repository.

To reproduce - uninstall mercurial (if any is available), create folder, create subfolder named .hg, call this script to check location where test folder were created.

Traceback (most recent call last):
  File "/usr/local/bin/unpushed", line 9, in <module>
    load_entry_point('unpushed==1.1.0', 'console_scripts', 'unpushed')()
  File "/usr/local/lib/python2.7/dist-packages/unpushed/command.py", line 52, in main
    for status in scanner.scan_repos(repos, ignore_untracked=options.ignore_untracked):
  File "/usr/local/lib/python2.7/dist-packages/unpushed/scanner.py", line 61, in scan_repos
    for status in get_statuses(path, ignore_set, **options):
  File "/usr/local/lib/python2.7/dist-packages/unpushed/repos.py", line 11, in mercurial
    process = Popen(('hg', 'st'), stdout=PIPE, cwd=path)
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
OSError: [Errno 13] Permission denied

Bug is present also in parent - see https://github.com/eapen/uncommitted/issues/7

matkoniecz avatar Jun 14 '16 08:06 matkoniecz