dusty-phillips / gitifyhg

Tools for using git as a client to mercurial repositories
GNU General Public License v3.0
62 stars 17 forks source link

Git pull failes, ERROR FOUND -> FIXED/WORK AROUND #67

Open ReedWood opened 11 years ago

ReedWood commented 11 years ago

FIX: The repository I cloned lives directly in the home directory of its dedicated user, this is /home/repoUser Therefore, login into the machine using ssh droped me in the correct place for the repo, and hence, the URI I used to clone was

git clone gitifyhg::ssh://repoUserSSH

where repoUserSSH is the ssh shortcut (~./ssh/config) for the remoe machine. This was good enough for cloning, but the pull failed. Changing the clone to

git clone gitifyhg::ssh://repoUserSSH://home/repoUser

fixed the pull command. Is this inconsistency worth a bug report?

ORIGINAL MESSAGE: Using a fresh clone of a hg repo using git gitifyhg::ssh://user@repo which completes w/o errors a following git pull results in

git pull Traceback (most recent call last): File “/home/wmader/local/bin/git-remote-hg”, line 805, in sys.exit(main(sys.argv)) File “/home/wmader/local/bin/git-remote-hg”, line 774, in main repo = get_repo(url, alias) File “/home/wmader/local/bin/git-remote-hg”, line 280, in get_repo peer = hg.peer(myui, {}, url) File “/usr/lib/python2.7/site-packages/mercurial/hg.py”, line 121, in peer return _peerorrepo(rui, path, create).peer() File “/usr/lib/python2.7/site-packages/mercurial/hg.py”, line 101, in _peerorrepo obj = _peerlookup(path).instance(ui, path, create) File “/usr/lib/python2.7/site-packages/mercurial/sshpeer.py”, line 36, in init self.abort(error.RepoError((“couldn’t parse location %s”) % path)) File “/usr/lib/python2.7/site-packages/mercurial/sshpeer.py”, line 115, in _abort raise exception mercurial.error.RepoError: couldn’t parse location ssh://d2d_repository@tesla.fdm.uni-freiburg.de

I am using hg 2.5.2 and the gitify packages from arch linux' aur repo. The standard python is python 3. Might this be the problem?

dusty-phillips commented 11 years ago

The interesting thing about this error is that the exception is being raised inside Mercurial. Are you able to hg clone that url directly using hg clone ssh://user@repo?

The version of gitifyhg in the AUR is also out of date; the latest version is 0.8.1. I think if you change the version number in the PKGBUILD it'll build. However, I don't recall having fixed anything that would address your problem since 0.7.2. There was a commit that might give you a less scary (but less useful) error message, though.

ReedWood commented 11 years ago

Yes, I am able to hg clone the repo.

I will try the up-to-date gitify version and come back.

ReedWood commented 11 years ago

As a quick info, I updated to gitifyhg 0.8.1 and now I get

git pull Traceback (most recent call last): File "/usr/bin/git-remote-gitifyhg", line 8, in load_entry_point('gitifyhg==0.8.1', 'console_scripts', 'git-remote-gitifyhg')() File "/usr/lib/python2.7/site-packages/gitifyhg/gitifyhg.py", line 262, in main HGRemote(*[x.decode('utf-8') for x in sys.argv[1:3]]).process() File "/usr/lib/python2.7/site-packages/gitifyhg/gitifyhg.py", line 135, in init self.build_repo(url) File "/usr/lib/python2.7/site-packages/gitifyhg/gitifyhg.py", line 158, in build_repo self.peer = hg.peer(myui, {}, url.encode('utf-8')) File "/usr/lib/python2.7/site-packages/mercurial/hg.py", line 121, in peer return _peerorrepo(rui, path, create).peer() File "/usr/lib/python2.7/site-packages/mercurial/hg.py", line 101, in _peerorrepo obj = _peerlookup(path).instance(ui, path, create) File "/usr/lib/python2.7/site-packages/mercurial/sshpeer.py", line 36, in init self.abort(error.RepoError(("couldn't parse location %s") % path)) File "/usr/lib/python2.7/site-packages/mercurial/sshpeer.py", line 115, in _abort raise exception mercurial.error.RepoError: couldn't parse location ssh://d2d_repository@tesla.fdm.uni-freiburg.de

The strange thing is that in the last line where mercurial complains about not beeing able to parse the location, the location looks pretty good to me. I have set up an ssh-key to be used for this server, but I can not imagine that this has an influence on the location string.

dusty-phillips commented 11 years ago

That is indeed a bizarre error. Can you try extracting the code that calls mercurial from python to do the clone and see if the error can be isolated?

It's particularly odd that the hg clone succeeds, but the pull fails. You could try adding some debugging statements to see if the location changes between initial clone and pull.

ReedWood commented 11 years ago

@buchuki I hope I will find time this weekend to investigate further.

felipec commented 11 years ago

I think the bug is in mercurial, this should work: git clone gitifyhg::ssh//repoUserSSH/ (with a slash at the end).