Observed with Mercurial 1.9.1 If the user has specified an alias that is the prefix of a command, then the prefix alias is used, even when the entire command is specified. (e.g. if the user specifies an alias for 'id', then whatever the alias for id is will be used even when the full command 'identify' is used). [maustin@yakko ~]$ python --version Python 2.7.1 [maustin@yakko ~]$ rpm -q python python-2.7.1-7.fc15.x86_64 [maustin@yakko ~]$ hg --version Mercurial Distributed SCM (version 1.9.1) (see http://mercurial.selenic.com for more information) Copyright (C) 2005-2011 Matt Mackall and others This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [maustin@yakko ~]$ rpm -q mercurial mercurial-1.9.1-1.fc15.x86_64 [maustin@yakko ~]$ hg init tmp [maustin@yakko ~]$ cd tmp [maustin@yakko tmp]$ hg id 000000000000 tip [maustin@yakko tmp]$ cat > .hg/hgrc <<EOF > [alias] > id=identify -nibt > EOF [maustin@yakko tmp]$ hg id 000000000000 -1 default tip [maustin@yakko tmp]$ hg identify 000000000000 -1 default tip [maustin@yakko tmp]$ hg --config alias.id=identify identify 000000000000 tip [maustin@yakko tmp]$ hg --config alias.id='identify -nibt' identify 000000000000 -1 default tip [maustin@yakko ~]$ hg --config alias.id=log identify -n 2> /dev/null hg identify [OPTION]... [FILE] alias for: hg log options: -f --follow follow changeset history, or file history across copies and renames --follow-first only follow the first parent of merge changesets -d --date DATE show revisions matching date spec -C --copies show copied files -k --keyword TEXT [+] do case-insensitive search for a given text -r --rev REV [+] show the specified revision or range --removed include revisions where files were removed -m --only-merges show only merges -u --user USER [+] revisions committed by user -b --branch BRANCH [+] show changesets within the given named branch -P --prune REV [+] do not display revision or any of its ancestors -h --hidden show hidden changesets -p --patch show patch -g --git use git extended diff format -l --limit NUM limit number of changes displayed -M --no-merges do not show merges --stat output diffstat-style summary of changes --style STYLE display using template map file --template TEMPLATE display with template -I --include PATTERN [+] include names matching the given patterns -X --exclude PATTERN [+] exclude names matching the given patterns [+] marked option can be specified multiple times use "hg help identify" to show the full help text [maustin@yakko ~]$ hg --config alias.id=log identify -n hg identify: option -n not recognized hg identify [OPTION]... [FILE] alias for: hg log options: -f --follow follow changeset history, or file history across copies and renames --follow-first only follow the first parent of merge changesets -d --date DATE show revisions matching date spec -C --copies show copied files -k --keyword TEXT [+] do case-insensitive search for a given text -r --rev REV [+] show the specified revision or range --removed include revisions where files were removed -m --only-merges show only merges -u --user USER [+] revisions committed by user -b --branch BRANCH [+] show changesets within the given named branch -P --prune REV [+] do not display revision or any of its ancestors -h --hidden show hidden changesets -p --patch show patch -g --git use git extended diff format -l --limit NUM limit number of changes displayed -M --no-merges do not show merges --stat output diffstat-style summary of changes --style STYLE display using template map file --template TEMPLATE display with template -I --include PATTERN [+] include names matching the given patterns -X --exclude PATTERN [+] exclude names matching the given patterns [+] marked option can be specified multiple times use "hg help identify" to show the full help text
Confirmed.
I've mailed a possible fix to the list, but I'm not sure of its correctness yet. Things in alias are a little twisty.
Fixed by http://selenic.com/repo/hg/rev/81c97964d123 Augie Fackler <durin42@gmail.com> alias: don't shadow commands that we only partially matched (issue2993) (BC) (please test the fix)
--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:23 EDT --- This bug was previously known as _bug_ 2993 at http://mercurial.selenic.com/bts/issue2993