Issue1622

Title pull --rebase fails when a child of an mq patch is pulled
Priority bug Status chatting
Superseder Nosy List astratto, dfrey, pmezard, simohe
Assigned To astratto Topics mq, rebase

Created on 2009-04-22.11:49:06 by simohe, last changed 2010-02-01.20:30:47 by astratto.

Files
File name Uploaded Type Edit Remove
rebase_qfinish.patch astratto, 2010-02-01.20:30:47 text/x-patch
test-pull-mq astratto, 2010-02-01.20:30:36 text/x-patch
test-rebase-mq-skip_extend-patch_fixed.patch dfrey, 2009-04-25.03:05:15 text/x-diff
test-rebase-mq-skip_extend-patch_fixed_again.patch dfrey, 2009-04-25.03:22:31 text/x-diff
test-rebase-mq-skip_extend.patch simohe, 2009-04-22.11:49:04 text/x-patch
Messages
msg11559 (view) Author: astratto Date: 2010-02-01.20:30:36
This is related to the fact that hg pull could lead to quite funny things 
when mq patches are applied. (Something like this was predicted in issue1099)

(The following scenario is the same as the attached test-pull-mq)
Let's suppose we have
 Repo1: a - b(p) - c(p)
where *(p) is an mq patch.
If we tried to commit over b it would fail and this is good. 

But if we had another repo:
 Repo2: a - b - d
with b == b(p)

A pull from repo1 would lead to:
 Repo1: a - b(p) - c(p)
             \
               d

Actually this is exactly what happened to the OP.
A pull --rebase in Repo1 means: hg pull && hg rebase -s c(p) -d d
In this case rebase tries to finalize c(p) but it fails.

From rebase's point of view we could finalize also b(p) and then c(p).
This solves the problem, but b(p) won't be an mq patch anymore.

If this is an acceptable behaviour see the attached patch to rebase.py
(rebase_qfinish.patch)
Please note that this requires to finalize every applied mq patch and then 
try to import it again.

Another approach could be finalizing b(p) after pull, but this has nothing 
to do with rebase.
msg9937 (view) Author: simohe Date: 2009-07-09.04:49:51
Workaround:
qfinish the patch and continue the rebase (hg rebase -c)
msg9191 (view) Author: dfrey Date: 2009-04-25.03:22:31
I'm sorry, my "fix" to the patch wasn incorrect.  I didn't update the line count.

test-rebase-mq-skip_extend-patch_fixed_again.patch is the one you want.
msg9190 (view) Author: dfrey Date: 2009-04-25.03:05:15
There seems to be a problem with the patch attached by simohe.

$ hg import ../test-rebase-mq-skip_extend.patch
applying ../test-rebase-mq-skip_extend.patch
abort: malformed patch a/tests/test-rebase-mq-skip @@ -41,4 +46,33 @@

I am attaching a modified version that imports without complaining.
msg9152 (view) Author: simohe Date: 2009-04-22.11:49:04
When a patch is applied remote in the same place as it is in the mq, then it is
not pulled because it is here, but its children are pulled. It is impossible to
qpop the patch. The only thing you can do is qfinish.
pull --rebase does not handle this situation. (I needed some time to fix the mq...)
History
Date User Action Args
2010-02-01 20:30:47astrattosetfiles: + rebase_qfinish.patch
nosy: pmezard, dfrey, astratto, simohe
2010-02-01 20:30:36astrattosetfiles: + test-pull-mq
assignedto: astratto
messages: + msg11559
nosy: pmezard, dfrey, astratto, simohe
2010-01-05 17:05:24astrattosetnosy: + astratto
2009-07-09 04:49:51simohesetnosy: pmezard, dfrey, simohe
messages: + msg9937
2009-04-25 03:22:33dfreysetfiles: + test-rebase-mq-skip_extend-patch_fixed_again.patch
nosy: pmezard, dfrey, simohe
messages: + msg9191
2009-04-25 03:05:18dfreysetfiles: + test-rebase-mq-skip_extend-patch_fixed.patch
status: unread -> chatting
messages: + msg9190
nosy: + dfrey
2009-04-23 08:58:57pmezardsetnosy: + pmezard
2009-04-22 11:49:06simohecreate