[IPython-dev] Mercurial queues

Stefan van der Walt stefan at sun.ac.za
Mon Nov 27 07:12:45 EST 2006


Hi Ville

On Mon, Nov 27, 2006 at 01:25:28PM +0200, Ville M. Vainio wrote:
> On 11/27/06, Stefan van der Walt <stefan at sun.ac.za> wrote:
> 
> >What in the world happened there?!  The file is fine on my machine,
> >but I also see the line-feeds in the incoming message.
> >
> >Here it is again, gzipped.
> 
> It worked, thanks! I wonder whether we could someday add also options
> for the commands (e.g. svn import --username) - though I suppose it
> would have to be after we get the autoload stuff in (post-0.7.3), to
> avoid too large databases.

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',...]


On the other hand, how do we keep such structures up to date?  It
would be ideal if the program itself could provide a clue to its
completion.

I think these structures already exist in bzr and hg.  In fact,
looking in the directory tree, I think we are looking for

bzrlib/shellcomplete.py

I'll grab the latest copy of bzr and play around.

Cheers
Stéfan



More information about the IPython-dev mailing list