views:

234

answers:

2

I've installed Mercurial per MT's knowledge base file here.

Working with it server side using ssh from my Mac works fine. I can initialize repositories and the like, but pulling from the server or pushing from my Mac produces an error I don't understand.

Here's what I get when call hg push from my local installation (hash marks represent my server number):

remote: Traceback (most recent call last):
remote:   File "/home/#####/users/.home/data/mercurial-1.5/hg", line 27, in ?
remote:     mercurial.dispatch.run()
remote:   File "/nfs/c05/h01/mnt/#####/data/mercurial-1.5/mercurial/dispatch.py", line 16, in run
remote:     sys.exit(dispatch(sys.argv[1:]))
remote:   File "/nfs/c05/h01/mnt/#####/data/mercurial-1.5/mercurial/dispatch.py", line 21, in dispatch
remote:     u = _ui.ui()
remote:   File "/nfs/c05/h01/mnt/#####/data/mercurial-1.5/mercurial/ui.py", line 38, in __init__
remote:     for f in util.rcpath():
remote:   File "/nfs/c05/h01/mnt/#####/data/mercurial-1.5/mercurial/util.py", line 1200, in rcpath
remote:     _rcpath = os_rcpath()
remote:   File "/nfs/c05/h01/mnt/#####/data/mercurial-1.5/mercurial/util.py", line 1174, in os_rcpath
remote:     path = system_rcpath()
remote:   File "/nfs/c05/h01/mnt/#####/data/mercurial-1.5/mercurial/posix.py", line 41, in system_rcpath
remote:     path.extend(rcfiles(os.path.dirname(sys.argv[0]) +
remote:   File "/nfs/c05/h01/mnt/#####/data/mercurial-1.5/mercurial/posix.py", line 30, in rcfiles
remote:     rcs.extend([os.path.join(rcdir, f)
remote:   File "/nfs/c05/h01/mnt/#####/data/mercurial-1.5/mercurial/demandimport.py", line 75, in __getattribute__
remote:     self._load()
remote:   File "/nfs/c05/h01/mnt/#####/data/mercurial-1.5/mercurial/demandimport.py", line 47, in _load
remote:     mod = _origimport(head, globals, locals)
remote: ImportError: No module named osutil
abort: no suitable response from remote hg!

Mercurial on my Mac is configured as follows

[ui]
username = John Smith
editor = te -w
remotecmd = ~/data/mercurial-1.5/hg

My local single repo is configured as follows (hash marks represent my server number):

[paths]
default = ssh://mysite.com@s#####.gridserver.com/domains/mysite.com/html

Mercurial on the server is configured with a just a username:

[ui]
username = John Smith

The server .bash_profile is configured as follows (per the installation guide):

# Added this as suggested by the MediaTemple guide
export PYTHONPATH=${HOME}/lib/python:$PYTHONPATH
export PATH=${HOME}/bin:$PATH

I understand this probably isn't a MediaTemple problem, but more likely an installation problem. I would really appreciate any assitance on this. Thanks in advance!

+1  A: 

Your mercurial installation isn't complete, you didn't compile the osutil module (there should be a osutil.so somewhere).

tonfa
Thanks for the quick response. I'm looking for any documentation that could point me where to fix that problem, but I just can't seem to find it. Any ideas? I'm really not that great at debugging this type of stuff.
bschaeffer
@bschaeffer `hg debuginstall` on the server.
tonfa
A: 

@tonfa,

hgdebuginstall produced no errors, which is why the problem I was having was so weird.

Thanks to your response, I did some digging and found the module in ~/lib/python/mercurial, so I copied the osutil.so file over to my ~data/mercurial-1.5/mercurial directory and that was that... but then more and more modules couldn’t be found so I decided to copy the entire contents of one directory over to the other, like so:

$ rm -R ~/data/mercurial-1.5/mercurial/*
$ cp -r ~/lib/python/mercurial/* ~/data/mercurial-1.5/mercurial

Now, everything works fine. I don't understand why it seems that mercurial was installed in two directories, or why one directory (~/data/mercurial-1.5/mercurial) didn't get the same files as the other (~/lib/python/mercurial).

Anyway, this is the solution I came up with. If you (or anyone) can think of something more elegant, I'd be all ears, but as it is... this one works for me.

Thanks for your time.

bschaeffer