Pulling fetches more commits than desired

Issue #45 invalid
created an issue

I have a git repository with multiple branches, each tracking a separate branch of the mozilla repositories:


This is terribly useful, as it allows me to reference several discrete branches within one working tree. However, when it comes to pulling those changes back into an hg tree, HgGit attempts to pull unrelated commits. For example:

hg pull ../moz-git -r central

This will attempt to pull in unrelated commits from the 'aurora' branch. Worse, since my mapfile contains those other commits, it fails to do so with a cryptic error.

I've hacked around this behavior with this patch: http://pastebin.mozilla.org/1670555

After the patch, everything seems to work, and doing 'hg pull -r some_branch /some/git/repo' successfully imports just that branch and bookmarks it

I'm not sure what the proper fix would be, as I was having trouble following the what exactly the code is intended to be doing, but fetch_pack seems to return every ref in my (probably single-pack) repository, which is then fed to import_git_objects.

Additionally, the 'export_commits' call here obliterates the ref I'm trying to pull before actually pulling it, which is a problem with the hack in place to only pull that ref.

Comments (4)

  1. Log in to comment