Patch for optparse.OptionConflictError (fix-version-info-conflict.diff)

two different "--version" options solutions that got merged together and were in conflict

download
# HG changeset patch
# Parent f093e1820f5d98cd4cf60dd57833818a6041c608
# User "Emile Anclin" <emile.anclin@laposte.net>
[application] fix conflict in version number

diff -r f093e1820f5d -r db0971db5fd9 hgviewlib/application.py
--- a/hgviewlib/application.py	Wed Jul 30 14:07:09 2014 -0700
+++ b/hgviewlib/application.py	Mon Aug 11 20:33:40 2014 +0200
@@ -123,11 +123,6 @@
            'raw': _curses_application,
            'curses': _curses_application}
 
-def hgview_version():
-    """print Hgview and Python version"""
-    from hgviewlib.__pkginfo__ import version
-    sys.stdout.write('Hgview %s\nPython %s\n' % (version, sys.version))
-    return 0
 
 def start(repo, opts, args, fnerror):
     """
@@ -182,6 +177,8 @@
 
     return app.exec_()
 
+VERSION_INFO = '%prog ' + '%s\nPython %s' % (__pkginfo__.version, sys.version)
+
 def main():
     """
     Main application entry point.
@@ -200,7 +197,7 @@
       revision.
     '''
 
-    parser = OptionParser(usage, version=__pkginfo__.version)
+    parser = OptionParser(usage, version=VERSION_INFO)
     parser.add_option('-I', '--interface', dest='interface',
                       help=('which GUI interface to use (among "qt", "raw"'
                              ' and "curses")'),
@@ -212,13 +209,8 @@
     parser.add_option('-n', '--navigate', dest='navigate', default=False,
                       action="store_true",
                       help='(with filename) start in navigation mode')
-    parser.add_option('--version', default=False, action="store_true",
-                      help='Print the version of Hgview and exit.')
-
 
     opts, args = parser.parse_args()
-    if opts.version:
-        sys.exit(hgview_version())
     if opts.repo:
         dir_ = opts.repo
     else: