Patchwork [1,of,3] extdiff: reorder an if-else conditional

login
register
mail settings
Submitter Pulkit Goyal
Date Sept. 2, 2020, 4:02 p.m.
Message ID <17c140bd8aad6fcf046d.1599062557@workspace>
Download mbox | patch
Permalink /patch/47085/
State Accepted
Headers show

Comments

Pulkit Goyal - Sept. 2, 2020, 4:02 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1599054451 -19800
#      Wed Sep 02 19:17:31 2020 +0530
# Node ID 17c140bd8aad6fcf046d112683679f9a0c983ee5
# Parent  451e13cc6d859c3a5f7971059265abdfb4e37ca3
# EXP-Topic extdiff-refactor
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.
Yuya Nishihara - Sept. 3, 2020, 11:49 a.m.
On Wed, 02 Sep 2020 21:32:37 +0530, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pulkit@gmail.com>
> # Date 1599054451 -19800
> #      Wed Sep 02 19:17:31 2020 +0530
> # Node ID 17c140bd8aad6fcf046d112683679f9a0c983ee5
> # Parent  451e13cc6d859c3a5f7971059265abdfb4e37ca3
> # EXP-Topic extdiff-refactor
> extdiff: reorder an if-else conditional

Queued the first two patches, thanks.

Patch

diff --git a/hgext/extdiff.py b/hgext/extdiff.py
--- a/hgext/extdiff.py
+++ b/hgext/extdiff.py
@@ -711,6 +711,8 @@  class savedcmd(object):
 
 def uisetup(ui):
     for cmd, path in ui.configitems(b'extdiff'):
+        if cmd.startswith(b'opts.') or cmd.startswith(b'gui.'):
+            continue
         path = util.expandpath(path)
         if cmd.startswith(b'cmd.'):
             cmd = cmd[4:]
@@ -723,8 +725,6 @@  def uisetup(ui):
             if diffopts:
                 cmdline += b' ' + diffopts
             isgui = ui.configbool(b'extdiff', b'gui.' + cmd)
-        elif cmd.startswith(b'opts.') or cmd.startswith(b'gui.'):
-            continue
         else:
             if path:
                 # case "cmd = path opts"