[PATCH 0 of 2 RFC] Shell alias support

Mads Kiilerich mads at kiilerich.com
Fri Jul 9 07:10:09 CDT 2010


  Steve Losh wrote, On 07/09/2010 04:23 AM:
> This is a second version of a patch I sent a day or two ago to add shell
> aliases to Mercurial, like so:
>
>      [alias]
>      qempty = !hg qrefresh -X "`hg root`"
>
> This would help get rid of hacky "alias hgsomething='hg something'" aliases in
> people's .whateverrc files.

But why? Why are shell aliases so bad?

Shells and scripting is very useful for composing custom commands from 
existing commands, but why should such general functionality be built 
into Mercurial? I think it is a bit out of scope.

If you really want arbitrary shell commands to appear as Mercurial 
commands then I would prefer to do that with something like this 
extension combined with aliases:

import os
def system(ui, repo, command):
     os.system(command)
cmdtable = {'system': (system, [], 'hg system COMMAND')}

/Mads


More information about the Mercurial-devel mailing list