Patchwork dispatch: use --section.setting=value instead of --config=section.setting=value

login
register
mail settings
Submitter Mads Kiilerich
Date May 2, 2014, 11:16 p.m.
Message ID <5364275C.9090502@kiilerich.com>
Download mbox | patch
Permalink /patch/4582/
State Rejected
Headers show

Comments

Mads Kiilerich - May 2, 2014, 11:16 p.m.
I forgot a trivial refactoring before this patch - I'll resend if the 
feedback is positive (or not sufficiently negative to stop me):

dispatch: refactoring in _earlygetopt, don't repeat values.append

              values.append(args.pop(pos)[2:])


/Mads

Patch

diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -567,14 +567,15 @@  def _earlygetopt(aliases, args):
          if arg in aliases:
              del args[pos]
              if equals > -1:
-                values.append(fullarg[equals + 1:])
+                v = fullarg[equals + 1:]
                  argcount -= 1
              else:
                  if pos + 1 >= argcount:
                      # ignore and let getopt report an error if there 
is no value
                      break
-                values.append(args.pop(pos))
+                v = args.pop(pos)
                  argcount -= 2
+            values.append(v)
          elif arg[:2] in shortopts:
              # short option can have no following space, e.g. hg log -Rfoo