##// END OF EJS Templates
Add ui.strict config item....
Bryan O'Sullivan -
r2988:63c3a192 default
parent child Browse files
Show More
@@ -0,0 +1,19 b''
1 #!/bin/sh
2
3 hg init
4
5 echo a > a
6 hg ci -d '0 0' -Ama
7
8 hg an a
9
10 HGRCPATH=$HGTMP/.hgrc; export HGRCPATH
11 echo "[ui]" >> $HGTMP/.hgrc
12 echo "strict=True" >> $HGTMP/.hgrc
13
14 hg an a
15 hg annotate a
16
17 echo % should succeed - up is an alias, not an abbreviation
18
19 hg up
@@ -0,0 +1,26 b''
1 adding a
2 0: a
3 hg: unknown command 'an'
4 Mercurial Distributed SCM
5
6 basic commands (use "hg help" for the full list or option "-v" for details):
7
8 add add the specified files on the next commit
9 annotate show changeset information per file line
10 clone make a copy of an existing repository
11 commit commit the specified files or all outstanding changes
12 diff diff repository (or selected files)
13 export dump the header and diffs for one or more changesets
14 init create a new repository in the given directory
15 log show revision history of entire repository or files
16 parents show the parents of the working dir or revision
17 pull pull changes from the specified source
18 push push changes to the specified destination
19 remove remove the specified files on the next commit
20 revert revert files or dirs to their states as of some revision
21 serve export the repository via HTTP
22 status show changed files in the working directory
23 update update or merge working directory
24 0: a
25 % should succeed - up is an alias, not an abbreviation
26 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -377,6 +377,9 b' ui::'
377 remote command to use for clone/push/pull operations. Default is 'hg'.
377 remote command to use for clone/push/pull operations. Default is 'hg'.
378 ssh;;
378 ssh;;
379 command to use for SSH connections. Default is 'ssh'.
379 command to use for SSH connections. Default is 'ssh'.
380 strict;;
381 Require exact command names, instead of allowing unambiguous
382 abbreviations. True or False. Default is False.
380 timeout;;
383 timeout;;
381 The timeout used when a lock is held (in seconds), a negative value
384 The timeout used when a lock is held (in seconds), a negative value
382 means no timeout. Default is 600.
385 means no timeout. Default is 600.
@@ -507,7 +507,7 b' def help_(ui, name=None, with_version=Fa'
507 if with_version:
507 if with_version:
508 show_version(ui)
508 show_version(ui)
509 ui.write('\n')
509 ui.write('\n')
510 aliases, i = findcmd(name)
510 aliases, i = findcmd(ui, name)
511 # synopsis
511 # synopsis
512 ui.write("%s\n\n" % i[2])
512 ui.write("%s\n\n" % i[2])
513
513
@@ -1154,7 +1154,7 b" def debugcomplete(ui, cmd='', **opts):"
1154 options = []
1154 options = []
1155 otables = [globalopts]
1155 otables = [globalopts]
1156 if cmd:
1156 if cmd:
1157 aliases, entry = findcmd(cmd)
1157 aliases, entry = findcmd(ui, cmd)
1158 otables.append(entry[1])
1158 otables.append(entry[1])
1159 for t in otables:
1159 for t in otables:
1160 for o in t:
1160 for o in t:
@@ -1164,7 +1164,7 b" def debugcomplete(ui, cmd='', **opts):"
1164 ui.write("%s\n" % "\n".join(options))
1164 ui.write("%s\n" % "\n".join(options))
1165 return
1165 return
1166
1166
1167 clist = findpossible(cmd).keys()
1167 clist = findpossible(ui, cmd).keys()
1168 clist.sort()
1168 clist.sort()
1169 ui.write("%s\n" % "\n".join(clist))
1169 ui.write("%s\n" % "\n".join(clist))
1170
1170
@@ -3149,7 +3149,7 b' norepo = ("clone init version help debug'
3149 " debugindex debugindexdot")
3149 " debugindex debugindexdot")
3150 optionalrepo = ("paths serve debugconfig")
3150 optionalrepo = ("paths serve debugconfig")
3151
3151
3152 def findpossible(cmd):
3152 def findpossible(ui, cmd):
3153 """
3153 """
3154 Return cmd -> (aliases, command table entry)
3154 Return cmd -> (aliases, command table entry)
3155 for each matching command.
3155 for each matching command.
@@ -3162,7 +3162,7 b' def findpossible(cmd):'
3162 found = None
3162 found = None
3163 if cmd in aliases:
3163 if cmd in aliases:
3164 found = cmd
3164 found = cmd
3165 else:
3165 elif not ui.config("ui", "strict"):
3166 for a in aliases:
3166 for a in aliases:
3167 if a.startswith(cmd):
3167 if a.startswith(cmd):
3168 found = a
3168 found = a
@@ -3178,9 +3178,9 b' def findpossible(cmd):'
3178
3178
3179 return choice
3179 return choice
3180
3180
3181 def findcmd(cmd):
3181 def findcmd(ui, cmd):
3182 """Return (aliases, command table entry) for command string."""
3182 """Return (aliases, command table entry) for command string."""
3183 choice = findpossible(cmd)
3183 choice = findpossible(ui, cmd)
3184
3184
3185 if choice.has_key(cmd):
3185 if choice.has_key(cmd):
3186 return choice[cmd]
3186 return choice[cmd]
@@ -3215,7 +3215,7 b' def parse(ui, args):'
3215
3215
3216 if args:
3216 if args:
3217 cmd, args = args[0], args[1:]
3217 cmd, args = args[0], args[1:]
3218 aliases, i = findcmd(cmd)
3218 aliases, i = findcmd(ui, cmd)
3219 cmd = aliases[0]
3219 cmd = aliases[0]
3220 defaults = ui.config("defaults", cmd)
3220 defaults = ui.config("defaults", cmd)
3221 if defaults:
3221 if defaults:
General Comments 0
You need to be logged in to leave comments. Login now