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 | 377 | remote command to use for clone/push/pull operations. Default is 'hg'. |
|
378 | 378 | ssh;; |
|
379 | 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 | 383 | timeout;; |
|
381 | 384 | The timeout used when a lock is held (in seconds), a negative value |
|
382 | 385 | means no timeout. Default is 600. |
@@ -507,7 +507,7 b' def help_(ui, name=None, with_version=Fa' | |||
|
507 | 507 | if with_version: |
|
508 | 508 | show_version(ui) |
|
509 | 509 | ui.write('\n') |
|
510 | aliases, i = findcmd(name) | |
|
510 | aliases, i = findcmd(ui, name) | |
|
511 | 511 | # synopsis |
|
512 | 512 | ui.write("%s\n\n" % i[2]) |
|
513 | 513 | |
@@ -1154,7 +1154,7 b" def debugcomplete(ui, cmd='', **opts):" | |||
|
1154 | 1154 | options = [] |
|
1155 | 1155 | otables = [globalopts] |
|
1156 | 1156 | if cmd: |
|
1157 | aliases, entry = findcmd(cmd) | |
|
1157 | aliases, entry = findcmd(ui, cmd) | |
|
1158 | 1158 | otables.append(entry[1]) |
|
1159 | 1159 | for t in otables: |
|
1160 | 1160 | for o in t: |
@@ -1164,7 +1164,7 b" def debugcomplete(ui, cmd='', **opts):" | |||
|
1164 | 1164 | ui.write("%s\n" % "\n".join(options)) |
|
1165 | 1165 | return |
|
1166 | 1166 | |
|
1167 | clist = findpossible(cmd).keys() | |
|
1167 | clist = findpossible(ui, cmd).keys() | |
|
1168 | 1168 | clist.sort() |
|
1169 | 1169 | ui.write("%s\n" % "\n".join(clist)) |
|
1170 | 1170 | |
@@ -3149,7 +3149,7 b' norepo = ("clone init version help debug' | |||
|
3149 | 3149 | " debugindex debugindexdot") |
|
3150 | 3150 | optionalrepo = ("paths serve debugconfig") |
|
3151 | 3151 | |
|
3152 | def findpossible(cmd): | |
|
3152 | def findpossible(ui, cmd): | |
|
3153 | 3153 | """ |
|
3154 | 3154 | Return cmd -> (aliases, command table entry) |
|
3155 | 3155 | for each matching command. |
@@ -3162,7 +3162,7 b' def findpossible(cmd):' | |||
|
3162 | 3162 | found = None |
|
3163 | 3163 | if cmd in aliases: |
|
3164 | 3164 | found = cmd |
|
3165 | else: | |
|
3165 | elif not ui.config("ui", "strict"): | |
|
3166 | 3166 | for a in aliases: |
|
3167 | 3167 | if a.startswith(cmd): |
|
3168 | 3168 | found = a |
@@ -3178,9 +3178,9 b' def findpossible(cmd):' | |||
|
3178 | 3178 | |
|
3179 | 3179 | return choice |
|
3180 | 3180 | |
|
3181 | def findcmd(cmd): | |
|
3181 | def findcmd(ui, cmd): | |
|
3182 | 3182 | """Return (aliases, command table entry) for command string.""" |
|
3183 | choice = findpossible(cmd) | |
|
3183 | choice = findpossible(ui, cmd) | |
|
3184 | 3184 | |
|
3185 | 3185 | if choice.has_key(cmd): |
|
3186 | 3186 | return choice[cmd] |
@@ -3215,7 +3215,7 b' def parse(ui, args):' | |||
|
3215 | 3215 | |
|
3216 | 3216 | if args: |
|
3217 | 3217 | cmd, args = args[0], args[1:] |
|
3218 | aliases, i = findcmd(cmd) | |
|
3218 | aliases, i = findcmd(ui, cmd) | |
|
3219 | 3219 | cmd = aliases[0] |
|
3220 | 3220 | defaults = ui.config("defaults", cmd) |
|
3221 | 3221 | if defaults: |
General Comments 0
You need to be logged in to leave comments.
Login now