Mercurial > hg
diff tests/test-mq-subrepo.t @ 17151:986df5249b65
mq: add ".hgsubstate" to patch target list only if it is not listed up yet
If ".hgsubstate" is already listed up as one of commit targets, qnew
put diff of ".hgsubstate" twice into the patch file stored under
".hg/patches".
It causes rejections at applying such patches.
Other than the case like in added test script, this can also occur
when qnew is executed just after rolling back the committing updated
".hgsubstate".
This patch checks whether ".hgsubstate" is already listed up as one of
commit targets, and put it into the appropriate list only if it is not
listed up yet.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Wed, 27 Jun 2012 22:03:22 +0900 |
parents | f2719b387380 |
children | f287d4a62031 |
line wrap: on
line diff
--- a/tests/test-mq-subrepo.t Thu Jul 12 14:20:34 2012 -0500 +++ b/tests/test-mq-subrepo.t Wed Jun 27 22:03:22 2012 +0900 @@ -355,3 +355,63 @@ $ hg qnew 0.diff $ cd .. + +check whether MQ operations can import updated .hgsubstate correctly +both into 'revision' and 'patch file under .hg/patches': + + $ hg init importing-hgsubstate + $ cd importing-hgsubstate + + $ echo a > a + $ hg commit -u test -d '0 0' -Am '#0 in parent' + adding a + $ hg init sub + $ echo sa > sub/sa + $ hg -R sub commit -u test -d '0 0' -Am '#0 in sub' + adding sa + $ echo 'sub = sub' > .hgsub + $ touch .hgsubstate + $ hg add .hgsub .hgsubstate + + $ hg qnew -u test -d '0 0' import-at-qnew + $ hg -R sub parents --template '{node} sub\n' + b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub + $ cat .hgsubstate + b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub + $ hg diff -c tip + diff -r f499373e340c -r b20ffac88564 .hgsub + --- /dev/null + +++ b/.hgsub + @@ -0,0 +1,1 @@ + +sub = sub + diff -r f499373e340c -r b20ffac88564 .hgsubstate + --- /dev/null + +++ b/.hgsubstate + @@ -0,0 +1,1 @@ + +b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub + $ cat .hg/patches/import-at-qnew + # HG changeset patch + # Parent f499373e340cdca5d01dee904aeb42dd2a325e71 + # User test + # Date 0 0 + + diff -r f499373e340c -r b20ffac88564 .hgsub + --- /dev/null + +++ b/.hgsub + @@ -0,0 +1,1 @@ + +sub = sub + diff -r f499373e340c -r b20ffac88564 .hgsubstate + --- /dev/null + +++ b/.hgsubstate + @@ -0,0 +1,1 @@ + +b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub + $ hg qpop + popping import-at-qnew + patch queue now empty + $ hg qpush + applying import-at-qnew + now at: import-at-qnew + + $ cd .. + + $ cd ..