Mercurial > public > mercurial-scm > hg
comparison hgext/extdiff.py @ 45409:a28da102fd36
extdiff: reorder an if-else conditional
This brings continue part on top and will help in next patch where we will like
to introduce utility functions for rest of the code.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Wed, 02 Sep 2020 19:17:31 +0530 |
parents | 451e13cc6d85 |
children | 2d08dcf8fd9e |
comparison
equal
deleted
inserted
replaced
45408:543e446204c6 | 45409:a28da102fd36 |
---|---|
709 ) | 709 ) |
710 | 710 |
711 | 711 |
712 def uisetup(ui): | 712 def uisetup(ui): |
713 for cmd, path in ui.configitems(b'extdiff'): | 713 for cmd, path in ui.configitems(b'extdiff'): |
714 if cmd.startswith(b'opts.') or cmd.startswith(b'gui.'): | |
715 continue | |
714 path = util.expandpath(path) | 716 path = util.expandpath(path) |
715 if cmd.startswith(b'cmd.'): | 717 if cmd.startswith(b'cmd.'): |
716 cmd = cmd[4:] | 718 cmd = cmd[4:] |
717 if not path: | 719 if not path: |
718 path = procutil.findexe(cmd) | 720 path = procutil.findexe(cmd) |
721 diffopts = ui.config(b'extdiff', b'opts.' + cmd) | 723 diffopts = ui.config(b'extdiff', b'opts.' + cmd) |
722 cmdline = procutil.shellquote(path) | 724 cmdline = procutil.shellquote(path) |
723 if diffopts: | 725 if diffopts: |
724 cmdline += b' ' + diffopts | 726 cmdline += b' ' + diffopts |
725 isgui = ui.configbool(b'extdiff', b'gui.' + cmd) | 727 isgui = ui.configbool(b'extdiff', b'gui.' + cmd) |
726 elif cmd.startswith(b'opts.') or cmd.startswith(b'gui.'): | |
727 continue | |
728 else: | 728 else: |
729 if path: | 729 if path: |
730 # case "cmd = path opts" | 730 # case "cmd = path opts" |
731 cmdline = path | 731 cmdline = path |
732 diffopts = len(pycompat.shlexsplit(cmdline)) > 1 | 732 diffopts = len(pycompat.shlexsplit(cmdline)) > 1 |