cosmin / git-hg

A git-hg utility for checking out and tracking a mercurial repo.
http://offbytwo.github.com/git-hg
MIT License
307 stars 51 forks source link

improved resolving symlink and expanding path #8

Closed nobeans closed 13 years ago

nobeans commented 13 years ago

git-hg is very useful tool, especially for me, who is not good at Mercurial :-)

I tried to use git-hg command which is installed from Hombrew on MacOSX, but the below error occurred:

$ git hg
/usr/local/bin/git-hg: line 15: cd: ../Cellar/git-hg/HEAD/bin/..: No such file or directory
To clone a mercurial repo run:
  clone  [local_checkout_path]

To work with a cloned mercurial repo use: 
  fetch                   fetch latest branches from mercurial
  pull                    fetch and merge the into the current branch
  checkout branch_name    checkout a mercurial branch

because the Homebrew's Formula of git-hg is written to use the symlink of RELATIVE path. and the current resolve_symlink and absolutize_path doesn't support such a path.

I've improved resolve_symlink and absolutize_path (renamed to expand_path). the functions are being used in my product, GroovyServ. (http://kobo.github.com/groovyserv/)

merge it if you like.

cosmin commented 13 years ago

Thank you for the pull request. I just merged in another pull request that fixed a few things, including some of the issues with resolving GITHG_HOME. Can you try the latest version fo the code and see if it works for you?

fnichol commented 13 years ago

I've was using nobeans' patch for the last 3 days and just saw your new commits. I re-brew installed and from this repo and it's working great. Thanks!

nobeans commented 13 years ago

great! it's working well. I close this issue.