Propagate errors from mercurial.hg.repository() (closes: #73678)

The specific error message from mercurial is more likely to be useful than a catch-all "you are not in a repo".

authorJulien Cristau <julien.cristau@logilab.fr>
changeset83e1f6d0ffa3
branchdefault
phasepublic
hiddenno
parent revision#e0ad6f151b89 Don't crash/close when exploring an empty repository (closes #20996)
child revision#30f7e8b7efd1 [console] add mainframe that mimics the emacs/vim interface (with vim keystrokes)
files modified by this revision
hgviewlib/qt4/hgrepoviewer.py
# HG changeset patch
# User Julien Cristau <julien.cristau@logilab.fr>
# Date 1313656082 -7200
# Thu Aug 18 10:28:02 2011 +0200
# Node ID 83e1f6d0ffa3be8f15eaed35eac9a83e9e7a09b5
# Parent e0ad6f151b891164f47daf0abe087fb530ed1378
Propagate errors from mercurial.hg.repository() (closes: #73678)

The specific error message from mercurial is more likely to be useful
than a catch-all "you are not in a repo".

diff --git a/hgviewlib/qt4/hgrepoviewer.py b/hgviewlib/qt4/hgrepoviewer.py
@@ -564,10 +564,12 @@
1      dir_ = find_repository(dir_)
2 
3      try:
4          u = ui.ui()
5          repo = hg.repository(u, dir_)
6 +    except RepoError, e:
7 +        parser.error(e)
8      except:
9          parser.error("You are not in a repo, are you?")
10 
11      # make Ctrl+C works
12      import signal