Automatically upgrade '_' to '-' when finding the right command.

This doesn't change the automatic command finder, so it really only helps
increase match hit rate in case of low confidence level delta between the 2 top
hits. For example, given commands 'set-commit' and 'dcommit', a user typing
'set_commit' would hit:
- 'set-commit': 90%
- 'dcommit': 70.5%

Since subcommand.py uses a 30% minimum confidence level between the two top hit
to automatically select a command, it will err on the side of safety and will
abort instead of selecting 'set-commit'.

This change fixes this specific case but won't trigger on partial matches, e.g.
'set_commi' for 'set-commit'.

R=stip@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1066923003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@294700 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/subcommand.py b/subcommand.py
index 0201c90..a9ebae0 100644
--- a/subcommand.py
+++ b/subcommand.py
@@ -128,8 +128,9 @@
     and/or incomplete names.
     """
     commands = self.enumerate_commands()
-    if name_asked in commands:
-      return commands[name_asked]
+    name_to_dash = name_asked.replace('_', '-')
+    if name_to_dash in commands:
+      return commands[name_to_dash]
 
     # An exact match was not found. Try to be smart and look if there's
     # something similar.