mq + subrepos: dataloss when rewriting history
Created originally on Bitbucket by Anonymous
Usually the following sequence appears to be a noop:
import to mq
unapply patches
apply patches
finish patches
This is not the case when any of the changesets involved contains changes to a subrepo state. In this case, changes to the subrepo state are easily lost. This makes use of mq unreliable when a repository has a subrepo.
tortoisehg: version 2.4+11-2bde1617403f with Mercurial-2.2.1, Python-2.7.2, PyQt-4.8.5, Qt-4.7.3
Test setup:
- hg init x
- cd x
- hg init y
- echo y = y >.hgsub
- hg add .hgsub
- hg commit -m "subrepo y" y .hgsub
- touch y/z
- hg add y/z
- hg commit --subrepos -m "z"
Steps to reproduce:
- open repository x
- in x, import the last changeset to mq
- unapply patch
- apply patch
- finish patch
Result: The state update is lost from the patch. Instead, the final subrepo state appears in the working directory.