mxcl/homebrew — Issue #9618: git-hg formula does not show/get/warn of dependencies
Author: mcamiano
Created: 2012-01-16 17:01:54+00:00
State: open

The git-hg does not completely install, or does not note its dependencies properly.

brew install python
brew install hg

brew install --HEAD git-hg
==> Cloning https://github.com/offbytwo/git-hg.git
Updating /Users/mamiano/Library/Caches/Homebrew/git-hg--git
/usr/local/Cellar/git-hg/HEAD: 16 files, 96K, built in 2 seconds

leaves a system which is unable to pull from a mercurial repo:

$ git-hg clone somehgurl/repo
$ cd repo
$ ls
(nothing here. hrm??? )
$ git-hg fetch
...
Traceback (most recent call last):
File "/usr/local/Cellar/git-hg/HEAD/bin/../fast-export/hg-fast-export.py", line 6, in
from mercurial import repo,hg,cmdutil,util,ui,revlog,node
ImportError: No module named mercurial

The Python modules should at least be commented in the install messages, or checked and/or fetched, since the mercurial module is indeed missing:

$ ls /usr/local/lib/python2.7/site-packages
distribute-0.6.24-py2.7.egg	setuptools-0.6c11-py2.7.egg-info
easy-install.pth	setuptools.pth

$ which easy_install
/usr/bin/easy_install

(According to the Homebrew and Python wiki page, there are some path settings to fix up to make easy_install work.
This would also have been something nice to know when the package was installed, to avoid time waste.
So perhaps the best thing to do would be to check for or at least warn users of the dependency and point to a fix.

$ export PATH=/usr/local/bin:/usr/local/share/python:/usr/bin:/bin

$ easy_install mercurial
..Installed /usr/local/lib/python2.7/site-packages/mercurial-2.0.2-py2.7-macosx-10.4-x86_64.egg
Processing dependencies for mercurial
Finished processing dependencies for mercurial

$ git clone somehgurl/repo (and now everything just works)