Forums

web2py versioning with mercurial

I have a working mercurial repository for my web2py app, created from the command line with "hg"

In the web2py control panel the "versioning" button returns the error message:

Sorry, could not find mercurial installed

The web2py book says to use easy_install mercurial, but it's already installed, so why doesn't it find it?

Could this be a Python version issue? We only have mercurial installed for Python 2.6 at the moment. It needs compilation as well so can't be installed --user. Though I would have thought that Web2py would be running under 2.6 by default. Looks like something I'll need to investigate today.

Hello!

I think that the problem is the mercurial version, which seems 1.6 and should be at least 1.9 (see also https://groups.google.com/d/topic/web2py/a3YZexvBXD4/discussion).

That's because we install it from the Debian repo and it's really old. We'll switch to using a pip install soon. In the meantime, perhaps you could try

pip install -U --user mercurial

You may also need to set the path in your webapp to include directory that hg is in.

Unfortunately, it doesn't work - pip always gives the error:

OSError: [Errno 30] Read-only file system: '/usr/share/pyshared/mercurial-1.6.4.egg-info'

so, it wants to upgrade the main package ignoring the --user option ;-((

Hi there, usually you can use easy_install --upgrade --user, but in this case mercurial does need gcc, so we'll have to do it at our end.

We should be able to get it in pretty soon though - maybe some time next week. Will keep you posted.

Perfect, thank you.

BTW, I've also noted that in order to use the web2py feature "Upload and install packed application" from a Github repository you need the package gitpython. But this time I've succesfully installed it in user space with:

pip install --user gitpython

and it works fine. For example you can now import as an application the current official web2py book from https://github.com/mdipierro/web2py-book.git with few mouse click.

Thanks! That's useful to know.

Just a note to say that we've now upgraded to the latest version of mercurial:

14:24 ~ $ hg --version                                                                                                                                      
Mercurial Distributed SCM (version 2.3.1)

We're looking into gitpython too, that should be in soon.

@nicozanf - gitpython is now installed as standard. thanks for the suggestion!