On Apr 4, 3:23 am, William Stein <wst...@gmail.com> wrote:
> Could we change the default to "git = true" as a patch to the version
> of hg we distribute with Sage?   Or, alternatively, have a patch that
> prints a warning
> whenever Sage's hg is used but git = false?   The second option would
> be safer, since a user might accidentally switch between using the
> Sage hg and
> a system-wide one...

`sage -hg` is only different from `hg` in that the particular `hg`
executable run is determined by the new $PATH set by `. sage-env`.
Unfortunately mercurial reads its config files mostly from fixed
locations (whether relative to the repository or absolute) and not
from environment variables except $HOME which it uses to find ~/.hgrc,
and `. sage-env` doesn't modify $HOME.

Personally I think the best solution is to create $SAGE_ROOT/local/etc/
mercurial/hgrc and put "[diff]\ngit=true" in it. This file will be
read by `sage -hg` but not the system `hg` due to the location of our
"hg" executable file, and though it will be overruled by "[diff]
\ngit=false" in either your ~/.hgrc or your /etc/mercurial/hgrc,
nobody will be putting that in those files since false is the default
value anyway. In any case, this is only a problem for developers who
can be reminded to remove or change the git diff setting in their
~/.hgrc or /etc/mercurial/hgrc if necessary, though I doubt this will
happen. So I don't think we need to go so far as to actually patch the
mercurial source code.

I just tested the above and it works. It can be implemented by just
putting the following in the spkg-install for mercurial:

mkdir -p $SAGE_LOCAL/etc/mercurial/
echo """[diff]
git=true""" > $SAGE_LOCAL/etc/mercurial/hgrc

-Keshav

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to