[IPython-dev] Mercurial queues
Ville M. Vainio
vivainio at gmail.com
Mon Nov 27 07:34:50 EST 2006
On 11/27/06, Stefan van der Walt <stefan at sun.ac.za> wrote:
> I thought about this too. I was trying to imaging what kind of
> structure one would need to describe the version control completer.
> One would intuitively build something like
>
> vc_commands = ['info','update', 'bundle', ...]
> vc_subcommands = {'bundle' : ['--output','-r'], ...}
> vc_subcommand_expand = {'--output': file_complete,
> '-r': revision_complete,
> ...}
>
> def revision_complete(self, input):
> rev_re = re.compile('...')
> cur_rev = rev_re.match(commands.getoutput('bzr log -r -1')...)
>
> return ['BASE',cur_rev,'TIP',...]
I think you might be overengineering a little bit. Just looking at the
command and yielding ['--output','-r'] + file_completions would be
just fine for most purposes. That way, if the user types - and presses
tab, she gets the list of options for that command.
--
Ville M. Vainio - vivainio.googlepages.com
blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'
More information about the IPython-dev
mailing list