[PATCH] Make the --authors option to hgext/convert expand ~

Greg Ward greg-hg at gerg.ca
Wed Mar 3 10:33:51 CST 2010


On Wed, Mar 3, 2010 at 10:59 AM, Simon de Vlieger <simon at ikanobori.jp> wrote:
> my zsh (and I believe my bash shell too) does not expand ~ when pressing my
> completion key.

That's irrelevant.  What's important is what winds up in Mercurial's
sys.argv.  Or, more accurately, Python's argv.  And mainstream Unix
shells since the ksh/csh era (mid-80s? before I started using Unix, at
any rate) have expanded "~" when spawning a subprocess.

> The way you put it: it would be my opinion to have mercurial expand every
> command-line argument which accepts a filepath.

No, I'm just saying it would be inconsistent for Mercurial to expand
some paths from the command line and not others.

> Is there a problem with
> os.path.expanduser (which mercurial.util.expandpath is just a wrapper around
> at this moment)
> that I am not aware of?

No.  It's just silly to duplicate what is already done by the shell
when it spawns a child process.

Mercurial *does* tend to expand paths in config files, because those
are not processed by your shell.  Being able to put "~/..." in .hgrc
is darned useful, so it's nice that Mercurial does this.

Note: I am deliberately not talking about Windows here!  This is just Unix.

Greg


More information about the Mercurial-devel mailing list