1. Augie Fackler
  2. hg-git
  3. Issues
Issue #123 open

ref not found on remote server when pulling single bookmark for manual merge

Jason R. Coombs
created an issue

In two different scenarios, I've encountered this error:

> hg pull gh://dstufft/setuptools -B use-packaging
pulling from gh://dstufft/setuptools
abort: ref 9382fa0c05e533400613e1c7c0a777cabb463390 not found on remote server

I have a local clone of a github repo and I want to pull some commits from another, related github fork. That fork was used to create a pull request, but the pull request now has merge conflicts, so I need to do a manual merge. Unfortunately, with hg-git, I seem to be unable to pull the changes from the fork.

I suspect the error occurs because the fork is not up to date with the changes I have locally, and you wouldn't expect them to be because the fork happened earlier.

This happens with Mercurial 3.1.1 and the latest hg-git (81e5e8e0185c).

I suspect you can replicate this finding as so:

> hg clone git+ssh://git@github.com:jaraco/setuptools
> cd setuptools
> hg pull git+ssh://git@github.com:dstufft/setuptools -B use-packaging

Obviously, when I get that branch merged, that example will no longer be valid, so let me know if it would be helpful to create a replication of the issue elsewhere.

I'm reporting this now to capture the issue, but I need to investigate further.

Comments (9)

  1. Jason R. Coombs reporter

    Interestingly, I wasn't able to replicate the issue with the steps above, so the issue seems to be more complicated, probably related to something in the mercurial metadata. I'm going to have to punt on this for now.

  2. Jason R. Coombs reporter

    I currently encounter the issue with these steps:

    hg clone git+ssh://git@github.com:jaraco/path.py
    cd path.py
    hg pull git+ssh://git@github.com:funkyfuture/path.py -B mergepath

    The error message is abort: ref 6e7056831cda859b66da1755f83bf16810d4ea95 not found on remote server.

    That ref isn't present in the local checkout:

    $ grep 6e7056 .hg/git-mapfile
    <no output>

    It is, however, the head ref for the branch/bookmark which I am trying to pull.

    Clearly the error message is incorrect. The ref is present on the remote server, unless of course it's looking at the wrong repo.

    Any idea what's going wrong here?

  3. Jason R. Coombs reporter

    In order to avoid changes to those public repos affecting this issue, I've create two repos to represent the issue - two fresh forks of the path.py repo. Use these steps to recreate the issue:

    $ hg clone git+ssh://git@github.com:jaraco/hggit-123-upstream repo
    $ cd repo
    $ hg pull git+ssh://git@github.com:jaraco/hggit-123-fork -B mergepath
    pulling from git+ssh://git@github.com:jaraco/hggit-123-fork
    abort: ref 6e7056831cda859b66da1755f83bf16810d4ea95 not found on remote server
  4. Jason R. Coombs reporter

    Thanks ehuelsmann for the reference. I can confirm that without supplying -B mergepath, the pull will succeed, consistent with your findings.

    What is inconsistent, however, is that the ref reported in the error, in my experience, is the git hash.

  5. Log in to comment