# HG changeset patch # User Anton Shestakov # Date 1567996127 -25200 # Node ID 6d898fa6e5c3366e6c3a2ce1a935ea7395c441ce # Parent b9b6f421688af053de5df5c83ecc40e847b17945 evolve: check that relocating makes sense in _solvedivergent() (issue5958) diff -r b9b6f421688a -r 6d898fa6e5c3 CHANGELOG --- a/CHANGELOG Wed Oct 24 19:32:04 2018 +0200 +++ b/CHANGELOG Mon Sep 09 09:28:47 2019 +0700 @@ -4,6 +4,7 @@ 9.1.1 - in progress ------------------- + * evolve: check that relocating makes sense in _solvedivergent() (issue5958) * evolve: test that target is not orig in _solveunstable() (issue6097) * fold: check allowdivergence before folding obsolete changesets (issue5817) * obslog: correct spacing of patch output with word-diff=yes (issue6175) diff -r b9b6f421688a -r 6d898fa6e5c3 hgext3rd/evolve/evolvecmd.py --- a/hgext3rd/evolve/evolvecmd.py Wed Oct 24 19:32:04 2018 +0200 +++ b/hgext3rd/evolve/evolvecmd.py Mon Sep 09 09:28:47 2019 +0700 @@ -502,6 +502,10 @@ % divergent)) return (False, ".") + # Sometimes we already have the other cset where we want it + if relocatereq and other == divergent.p1(): + relocatereq = False + evolvestate['resolutionparent'] = resolutionparent # relocate the other divergent if required if relocatereq: diff -r b9b6f421688a -r 6d898fa6e5c3 tests/test-evolve-issue5958.t --- a/tests/test-evolve-issue5958.t Wed Oct 24 19:32:04 2018 +0200 +++ b/tests/test-evolve-issue5958.t Mon Sep 09 09:28:47 2019 +0700 @@ -79,17 +79,10 @@ rewritten(date) as 0065551bd38f using metaedit by test (Thu Jan 01 00:00:00 1970 +0000) rewritten(date) as c17bf400a278 using metaedit by test (Thu Jan 01 00:00:00 1970 +0000) - $ hg evolve --content-divergent 2>&1 | grep '^\S' + $ hg evolve --content-divergent merge:[6] add foo.txt with: [4] add foo.txt base: [1] add foo.txt - rebasing "other" content-divergent changeset c17bf400a278 on c17bf400a278 - ** unknown exception encountered, please report by visiting - ** https://mercurial-scm.org/wiki/BugTracker - ** Python * (glob) - ** Mercurial Distributed SCM (*) (glob) - ** Extensions loaded: rebase, evolve - ** ProgrammingError: tried to relocate a node on top of itself - ** (This shouldn't happen. If you still need to move changesets, please do so manually with nothing to rebase - working directory parent is also destination) - Traceback (most recent call last): - mercurial.error.ProgrammingError: tried to relocate a node on top of itself + 0 files updated, 0 files merged, 0 files removed, 0 files unresolved + 1 new orphan changesets + working directory is now at 2372e6d39855