[PATCH] fixing an issue with zsh completion that occurs with long branch or tag names
Nikolaj Sjujskij
sterkrig at myopera.com
Fri Mar 22 05:56:07 CDT 2013
Den 2013-02-04 12:06:38 skrev Nikolaj Sjujskij <sterkrig at myopera.com>:
> Den 2013-01-17 05:02:07 skrev Johannes Schlatow <johannes at schlatow.name>:
>
>> # HG changeset patch
>> # User Johannes Schlatow <johannes at schlatow.name>
>> # Date 1358384150 -3600
>> # Node ID 75f74f803081bc10e4d21102c9882038fd9ed434
>> # Parent ec4fc4474af7dcedd182c4f9153884f4e852e089
>> zsh_completion: fix issue with overlong branch/tag names
>>
>> diff -r ec4fc4474af7 -r 75f74f803081 contrib/zsh_completion
>> --- a/contrib/zsh_completion Thu Jan 17 01:06:00 2013 +0100
>> +++ b/contrib/zsh_completion Thu Jan 17 01:55:50 2013 +0100
>> @@ -174,7 +174,7 @@
>>
>> _hg_cmd tags | while read tag
>> do
>> - tags+=(${tag/ # [0-9]#:*})
>> + tags+=(${tag/ #[0-9]#:*})
>> done
>> (( $#tags )) && _describe -t tags 'tags' tags
>> }
>> @@ -198,7 +198,7 @@
>>
>> _hg_cmd branches | while read branch
>> do
>> - branches+=(${branch/ # [0-9]#:*})
>> + branches+=(${branch/ #[0-9]#:*})
>> done
>> (( $#branches )) && _describe -t branches 'branches' branches
>> }
>
> This seems to spoil branch completion here:
>
> [☿:stable] mercurial % hg update d<Tab>
> (eval):1: bad substitution
> [☿:stable] mercurial % hg update default
>
> And break tag completion:
>
> [☿:stable] mercurial % hg up 2.5-r<Tab>
> (eval):1: bad substitution
> [☿:stable] mercurial % hg up 2.5-r
>
>
> zsh 5.0.2, Gentoo Linux ~amd64
>
> I'm not any kind of expert in zsh competion, but I'll try to investigate.
#zsh guys nailed it for me. Look here:
http://selenic.com/repo/hg/rev/45bb5df43b81
Seemingly unchanged
(( $#tags )) && _describe -t tags 'tags' tags
line actually had introduced ^M (\r) symbol, which had broken labels
completion. So, somebody please crew-*stable* fix for it (since Matt seems
to be mostly absent), because I'm not sure that diff in ML would be
meaningful and/or easy "appliable".
More information about the Mercurial-devel
mailing list