[PATCH topic-ext] topics: add listnames hook so completion works

Augie Fackler raf at durin42.com
Tue Jun 16 11:07:39 CDT 2015


On Mon, Jun 15, 2015 at 04:58:24PM -0500, Matt Mackall wrote:
> # HG changeset patch
> # User Matt Mackall <mpm at selenic.com>
> # Date 1434405404 18000
> #      Mon Jun 15 16:56:44 2015 -0500
> # Node ID ca2b4e5329fe018fc1279694cc89f74a7d6f4ccd
> # Parent  375b9ccb7f25fde4dcf2b61a29ff282396544abe
> topics: add listnames hook so completion works

Queued for topics, thanks.

>
> diff -r 375b9ccb7f25 -r ca2b4e5329fe src/topic/__init__.py
> --- a/src/topic/__init__.py	Fri Jun 12 16:49:46 2015 -0500
> +++ b/src/topic/__init__.py	Mon Jun 15 16:56:44 2015 -0500
> @@ -62,10 +62,11 @@
>          def currenttopic(self):
>              return self.vfs.tryread('topic')
>
> +    repo.__class__ = topicrepo
>      if util.safehasattr(repo, 'names'):
>          repo.names.addnamespace(namespaces.namespace(
> -            'topics', 'topic', namemap=_namemap, nodemap=_nodemap))
> -    repo.__class__ = topicrepo
> +            'topics', 'topic', namemap=_namemap, nodemap=_nodemap,
> +            listnames=lambda repo: repo.topics))
>
>  @command('topics [TOPIC]', [
>      ('', 'clear', False, 'clear active topic if any'),
> diff -r 375b9ccb7f25 -r ca2b4e5329fe tests/test-topic.t
> --- a/tests/test-topic.t	Fri Jun 12 16:49:46 2015 -0500
> +++ b/tests/test-topic.t	Mon Jun 15 16:56:44 2015 -0500
> @@ -263,6 +263,12 @@
>       fran
>     * narf
>       query
> +  $ hg debugnamecomplete
> +  default
> +  fran
> +  narf
> +  query
> +  tip
>    $ hg phase --public narf
>
>  POSSIBLE BUG: narf topic stays alive even though we just made all
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list