cmdutil: use sorted(dict) instead of x = dict.keys(); x.sort()
authorAugie Fackler <raf@durin42.com>
Sun, 28 May 2017 14:02:14 -0400
changeset 32528 9f56d462634c
parent 32527 47ce079b1afa
child 32529 0ec17613582c
cmdutil: use sorted(dict) instead of x = dict.keys(); x.sort() The former both does less work and has the virtue of working on Python 3.
mercurial/cmdutil.py
--- a/mercurial/cmdutil.py	Sun May 28 16:17:43 2017 -0400
+++ b/mercurial/cmdutil.py	Sun May 28 14:02:14 2017 -0400
@@ -449,8 +449,7 @@
         return choice[cmd]
 
     if len(choice) > 1:
-        clist = choice.keys()
-        clist.sort()
+        clist = sorted(choice)
         raise error.AmbiguousCommand(cmd, clist)
 
     if choice: