[extensions] do not run "hgview" through os.system on failure (closes #110040)

This does not make much sense and confuse error message a lot.

authorPierre-Yves David <pierre-yves.david@logilab.fr>
changeset1e2f50f0c11a
branchdefault
phasepublic
hiddenno
parent revision#ea0de45f0583 [util] handle mercurial 2.4
child revision#25e2eb7bc04f [start] refactor interface type "parsing" and initialisation (close #110038)
files modified by this revision
hgext/hgview.py
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@logilab.fr>
# Date 1351263208 -7200
# Fri Oct 26 16:53:28 2012 +0200
# Node ID 1e2f50f0c11af966f3a206c6d7dddf8251475696
# Parent ea0de45f05838b829f265886e0fd219462b58ec8
[extensions] do not run "hgview" through os.system on failure (closes #110040)

This does not make much sense and confuse error message a lot.

diff --git a/hgext/hgview.py b/hgext/hgview.py
@@ -53,41 +53,16 @@
1      except ImportError:
2          pass
3 
4      import sys
5      sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
6 -    try:
7 -        from hgviewlib.application import start
8 -        def fnerror(text):
9 -            """process errors"""
10 -            raise(error.Abort(text))
11 -        options = Values(opts)
12 -        start(repo, options, pats, fnerror)
13 -    except Exception, e:
14 -        if ui.config('ui', 'traceback'):
15 -            raise
16 -        # If we're unable to start hgviewlib from here, try to
17 -        # run the application directly.
18 -        # You can specificy it's location in ~/.hgrc via
19 -        #   [hgview]
20 -        #   path=
21 -        cmd = [ui.config("hgview", "path", "hgview")]
22 -        cmd += ['--%s %s' % (name, value)
23 -                for name, value in opts.iteritems() if value]
24 -        cmd += ['-R %s' % repo.root]
25 -        if pats:
26 -            cmd += list(pats)
27 -        if ui.configlist('ui', 'debug'):
28 -            sys.stdout.write('Enable to run Hg extension: ')
29 -            sys.stdout.write(str(e))
30 -            sys.stdout.write('\n')
31 -            sys.stdout.write('-> starting alternative command:')
32 -            sys.stdout.write('\n')
33 -            sys.stdout.write(' '.join(cmd))
34 -            sys.stdout.write('\n')
35 -            sys.stdout.flush()
36 -        os.system(' '.join(cmd))
37 +    from hgviewlib.application import start
38 +    def fnerror(text):
39 +        """process errors"""
40 +        raise(error.Abort(text))
41 +    options = Values(opts)
42 +    start(repo, options, pats, fnerror)
43 
44  import sys
45  sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
46  import hgviewlib.hgviewhelp as hghelp
47