gitifyhg icon indicating copy to clipboard operation
gitifyhg copied to clipboard

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

Open ReedWood opened this issue 12 years ago • 6 comments

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://[email protected]

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?

ReedWood avatar Apr 01 '13 12:04 ReedWood

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.

dusty-phillips avatar Apr 01 '13 14:04 dusty-phillips

Yes, I am able to hg clone the repo.

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

ReedWood avatar Apr 01 '13 19:04 ReedWood

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://[email protected]

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.

ReedWood avatar Apr 02 '13 09:04 ReedWood

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.

dusty-phillips avatar Apr 04 '13 22:04 dusty-phillips

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

ReedWood avatar Apr 05 '13 04:04 ReedWood

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

felipec avatar Apr 05 '13 06:04 felipec