help: use full name of extensions to look up them for keyword search
Before this patch, "hg help -k KEYWORD" fails, if there is the
extension of which name includes ".", because "extensions.load()"
invoked from "help.topicmatch()" fails to look such extension up, even
though it is already loaded in.
"help.topicmatch()" invokes "extensions.load()" with the name gotten
from "extensions.enabled()". The former expects full name of extension
(= key in '[extensions]' section), but the latter returns names
shortened by "split('.')[-1]". This difference causes failure of
looking extension up.
This patch adds "shortname" argument to "extensions.enabled()" to make
it return shortened names only if it is True. "help.topicmatch()"
turns it off to get full name of extensions.
Then, this patch shortens full name of extensions by "split('.')[-1]"
for showing them in the list of extensions.
Shortening is also applied on names gotten from
"extensions.disabled()" but harmless, because it returns only
extensions directly under "hgext" and their names should not include
".".
$ cat >> $HGRCPATH <<EOF
> [extensions]
> graphlog=
> rebase=
>
> [phases]
> publish=False
>
> [alias]
> tglog = log -G --template "{rev}:{phase} '{desc}' {branches} {bookmarks}\n"
> EOF
$ hg init a
$ cd a
$ echo c1 >common
$ hg add common
$ hg ci -m C1
$ echo c2 >>common
$ hg ci -m C2
$ echo c3 >>common
$ hg ci -m C3
$ hg up -q -C 1
$ echo l1 >>extra
$ hg add extra
$ hg ci -m L1
created new head
$ sed -e 's/c2/l2/' common > common.new
$ mv common.new common
$ hg ci -m L2
$ echo l3 >> extra2
$ hg add extra2
$ hg ci -m L3
$ hg bookmark mybook
$ hg phase --force --secret 4
$ hg tglog
@ 5:secret 'L3' mybook
|
o 4:secret 'L2'
|
o 3:draft 'L1'
|
| o 2:draft 'C3'
|/
o 1:draft 'C2'
|
o 0:draft 'C1'
Try to call --continue:
$ hg rebase --continue
abort: no rebase in progress
[255]
Conflicting rebase:
$ hg rebase -s 3 -d 2
merging common
warning: conflicts during merge.
merging common incomplete! (edit conflicts, then use 'hg resolve --mark')
unresolved conflicts (see hg resolve, then hg rebase --continue)
[1]
Try to continue without solving the conflict:
$ hg rebase --continue
abort: unresolved merge conflicts (see hg help resolve)
[255]
Conclude rebase:
$ echo 'resolved merge' >common
$ hg resolve -m common
$ hg rebase --continue
saved backup bundle to $TESTTMP/a/.hg/strip-backup/*-backup.hg (glob)
$ hg tglog
@ 5:secret 'L3' mybook
|
o 4:secret 'L2'
|
o 3:draft 'L1'
|
o 2:draft 'C3'
|
o 1:draft 'C2'
|
o 0:draft 'C1'
Check correctness:
$ hg cat -r 0 common
c1
$ hg cat -r 1 common
c1
c2
$ hg cat -r 2 common
c1
c2
c3
$ hg cat -r 3 common
c1
c2
c3
$ hg cat -r 4 common
resolved merge
$ hg cat -r 5 common
resolved merge
Bookmark stays active after --continue
$ hg bookmarks
* mybook 5:d67b21408fc0
$ cd ..