next: solve the issue of `next` get confused by split
This patch solve a problem of next command which get confused by split.
Let me describe how it was getting confused:
Initial state of repo:
A---B---C
After splitting B to (B1,B2):
@
A---B1---B2
\
---B---C
X *
(note: C is orphan; checkedout to B1)
Lets make an amend on B1:
@
B1'
/
A---B1---B2
\ X *
\
---B---C
X *
Now, if run `hg next` (--evolve is True by default now):
$ it would give you choice to choose from B2 and C thinking that C could also
be a possbile children for B1, instead of stablizing B2 on B1.
I fixed this problem by filtering those aspiring children which can be
stablized on one of the aspiring children itself.
Changes made in test-prev-next.t shows the changed expected behaviour.
====================================Testingheadcheckingcode:CaseD-2====================================Mercurialchecksfortheintroductionofnewheadsonpush.Evolutioncomesintoplaytodetectifexistingbranchesontheserverarebeingreplacedbysomeofthenewonewepush.Thiscaseispartofaseriesoftestscheckingthisbehavior.CategoryD:remoteheadis"obs-affected"locally,butresultisnotpartofthepushTestCase1:remotebranchhas2changes,headispruned,otherisrewrittenbutresultisnotpushed..old-state:....*1changesetbranch....new-state:....*oldheadispruned..*1newbranchsucceedingtotheotherchangesetintheoldbranch..*1newunrelatedbranch....expected-result:....*pushallowed..*pushingonlytheunrelatedbranch:denied....graph-summary:....B⊗..|..Aø⇠○A'.. |/.. | ◔ C.. |/.. ● $ . $TESTDIR/testlib/push-checkheads-util.shTest setup---------- $ mkdir D2 $ cd D2 $ setuprepos creating basic server and client repo updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd server $ mkcommit B0 $ cd ../client $ hg pull pulling from $TESTTMP/D2/server (glob) searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets d73caddc5533 (1 drafts) (run 'hgupdate' to get a working copy) $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit A1 created new head $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"` obsoleted 1 changesets 1 new orphan changesets $ hg debugobsolete --record-parents `getid "desc(B0)"` obsoleted 1 changesets $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit C0 created new head $ hg log -G --hidden @ 0f88766e02d6 (draft): C0 | | o f6082bc4ffef (draft): A1 |/ | x d73caddc5533 (draft): B0 | | | x 8aaa48160adc (draft): A0 |/ o 1e4be0697311 (public): rootActual testing-------------- $ hg push --rev 'desc(C0)' pushing to $TESTTMP/D2/server (glob) searching for changes abort: push creates new remote head 0f88766e02d6! (merge or see 'hghelppush' for details about pushing new heads) [255] $ cd ../..