I’ve read the RebaseProject page and tried a non-trivial example
(not rebasing a complete branch). It’s similar to the case rebase D on
I of the scenario B.
Here’s the situation before the rebase:
default : 0 ----- 2
\
feature : 1 ----- 3
Now I’d like to rebase 3 on 2, giving:
default : 0 ----- 2 ----- 3
\
feature : 1
Unfortunately the exact commands aren’t given in the RebaseProject
page, but from my understanding of the usage synopsis it should be:
hg rebase --source 3 --dest 2
But somehow my understanding must be flawed, because I get a rebase combined with a merge:
default : 0 ----- 2 ----- 3
\ /
feature : 1 -------
Why is that?
Commands to reproduce the scenario:
hg init
touch a
hg add a
hg commit -m "added a"
hg branch feature
touch b
hg add b
hg commit -m "added b on feature"
hg up -C default
touch c
hg add c
hg commit -m "added c on default"
hg up -C feature
echo "feature" >> a
hg commit -m "changed a on feature"
hg rebase --source 3 --dest 2
Your scenario looks very similar to part
rebase G onto Iofscenario Bof the Rebase Project Scenarios:In your scenario,
D==1,I==2andG==3. After rebasing,3maintains its relationship to1just likeG'maintained its relationship toD. This is becauseDis not an ancestor ofIand:You really want to remove that relationship, then, according to the docs, you need a development version to get the
--detachoption: