Patchwork [1,of,2] share: use dict literal instead of dict(key=value)

login
register
mail settings
Submitter Yuya Nishihara
Date June 24, 2017, 5:56 a.m.
Message ID <24c0a9a7fa865cc6ff6f.1498283809@mimosa>
Download mbox | patch
Permalink /patch/21663/
State Accepted
Headers show

Comments

Yuya Nishihara - June 24, 2017, 5:56 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1498278030 -32400
#      Sat Jun 24 13:20:30 2017 +0900
# Node ID 24c0a9a7fa865cc6ff6f1a5b183bffe8a220dda6
# Parent  fac9941bd542e3621082b157fb2f3aff09cfb1b7
share: use dict literal instead of dict(key=value)

check-code.py has the rule, but it isn't smart enough to catch this.

Patch

diff --git a/hgext/share.py b/hgext/share.py
--- a/hgext/share.py
+++ b/hgext/share.py
@@ -132,10 +132,10 @@  def clone(orig, ui, source, *args, **opt
     if pool:
         pool = util.expandpath(pool)
 
-    opts[r'shareopts'] = dict(
-        pool=pool,
-        mode=ui.config('share', 'poolnaming', 'identity'),
-    )
+    opts[r'shareopts'] = {
+        'pool': pool,
+        'mode': ui.config('share', 'poolnaming', 'identity'),
+    }
 
     return orig(ui, source, *args, **opts)