/wp
subdirectory.git checkout 3.4.1
(where 3.4.1
is tag)..hgsubstate
).And here trouble starts. I do hg push
and when it gets to WP:
no branch checked out in subrepo wp
cannot push revision e9bc63e25dc40c07ac3a6778dc2b48e1aa486e36
And then it just quits. Push for root repo is not even attempted.
I understand why Mercurial tries to push subrepo (intended behavior), but I can't make sense why it manages to fail completely on subrepo that:
How to make it understand that I want this specific revision and I don't want it messing with Git subrepo?
You are going to run into a couple problems with this setup.
First, it seems that mercurial cannot handle git subrepos with a detached HEAD.
When you execute git checkout 3.4.1
, your repo enters a detached HEAD state (you should have seen a warning to that effect when you executed the command). At that point, if you run git branch
, you see that (no branch)
is listed as the active branch. When mercurial attempts to push, it chokes on this state. You could ask the mercurial developer list why this happens, but it probably a limitation of the existing subrepo implementation.
Second, mercurial uses a push command to synchronize git subrepos.
If you were to run git checkout -b <integration_branch> 3.4.1
, it moves git out of the detached HEAD state. However, when you try to hg push
, it will attempt to actually push to the remote git repo. For a mercurial subrepo, it can check for outgoing changes even if you don't have push access to the remote. However, GitHub requires you to authenticate before it will tell you if the two repos are synchronized. So, if you don't have push access to the git remote then this will fail. This is part of the design of mercurial's subrepo strategy.
If you need to continue with this setup, you should probably do the following:
git checkout -b <branch_name> 3.4.1
There is some additional info in this related question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With