hg-git interacts poorly with phases.new-commit = secret
Created originally on Bitbucket by kamalmarhubi (Kamal Marhubi)
If phases.new-commit = secret
, the changesets created by hg-git are secret. But the localrepo object it uses appears to filter out secret changesets. This results in the following sequence of events when cloning:
- hg-git imports the root commit with sha1
ababab
as a root changeset with id121212
whose phase is secret - hg-git goes to import that next commit whose sha1 is
cdcdcd
, and for this it needs the mercurial changeset id of the parent,ababab
- hg-git looks up the
ababab
in the git-sha1-to-hg-commit-id map, and finds121212
- hg-git then looks up this changeset id in the mercurial repo object
- the repo is filtering this revision out since it'ss secret, so it results in
FilteredRepoLookupErrror
- boom
The two phase-related options—hggit.usephases
and git.public
—appear to affect other aspects of the import. Neither of them change either the phase of new commits, or the filter on the repo object.
This is the cause of the error I wrote about in my second mercurial blog post.
I'd be happy to submit a patch, but I'm not sure what the right fix is. I see at least two options:
- set
phases.new-commit
todraft
orpublic
during clone and pull - change the filter on the localrepo to include secret changesets
While at this, it might make sense to redesign the phase-related options a little, but I'm too new at this to have a good feel of how to make them more intuitive.