[Bug 5515] New: zsh completion: after abbreviation 'bo' for 'bookmarks' the wrong set of completions is offered.

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Mon Mar 27 03:21:50 EDT 2017


            Bug ID: 5515
           Summary: zsh completion: after abbreviation 'bo' for
                    'bookmarks' the wrong set of completions is offered.
           Product: Mercurial
           Version: 4.1.1
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: third-party
          Assignee: bugzilla at mercurial-scm.org
          Reporter: mtietze at gmx.com
                CC: mercurial-devel at mercurial-scm.org


I use zsh completion provided in contrib/.
A minor issue I found is when using the abbreviation 'bo' for 'bookmarks'
the set of completions offered are the 'global' ones instead of the 
'bookmarks'-specific ones.

when typing
$ hg bo --re<TAB>
it completes to
$ hg bo --repository=

Instead it should offer the same completions as when using 'bookmark'
$ hg bookmark --re<TAB>
 -- option --
--rename      -- rename a given bookmark
--repository  -- repository root directory
--rev         -- revision

it goes wrong in lines 96/97:
In l.96 it searches for 'bo*' from the front of the list of all command
finding 'bookmarks'.
In the condition in l.97 it compares the previously found match with the first
match starting from the back of the list of all commands ('bookmark'). The 
condition is therefore not fulfilled and the original command ('bo') is not
replaced with 'bookmarks'. This leads to the completion offering the 'normal'
completions in l.122/123. 

To me it is not obvious why the implementation uses once the first match from 
the start the list of all commands and once from the end. Using the always
the first one works for me in my daily work but I do not know enough about
Mercurial to be sure that this is the way to go.

You are receiving this mail because:
You are on the CC list for the bug.

More information about the Mercurial-devel mailing list