stabilize: improve unstable selection heuristic
Without argument, stabilize was picking the first in:
"unstable() and ((suspended() or obsancestors(::.))::)"
which usually returned the "oldest" unstable revision in parent
predecessors descendants. This revision is interesting because it
usually gives "soft" merges but rebasing it left the working directory
on a remote branch, which was very confusing.
The new heuristic picks an unstable changeset which can be rebased on
top of the parent revision, or on top of one of its descendants
(selected in revision order). This has the advantage of selecting a
revision which can be rebased on the current subtree, and leave the
working directory in a more convenient location.
<?xml version="1.0"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="125 130 278 413" width="278pt" height="413pt"><metadata xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:date>2012-03-18 23:47Z</dc:date><!-- Produced by OmniGraffle Professional 5.3.6 --></metadata><defs><filter id="Shadow" filterUnits="userSpaceOnUse"><feGaussianBlur in="SourceAlpha" result="blur" stdDeviation="3.488"/><feOffset in="blur" result="offset" dx="0" dy="4"/><feFlood flood-color="black" flood-opacity=".75" result="flood"/><feComposite in="flood" in2="offset" operator="in"/></filter><font-face font-family="Helvetica" font-size="26" units-per-em="1000" underline-position="-75.683594" underline-thickness="49.31641" slope="0" x-height="522.94922" cap-height="717.2852" ascent="770.0196" descent="-229.98048" font-weight="500"><font-face-src><font-face-name name="Helvetica"/></font-face-src></font-face><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledDiamond_Marker" viewBox="-1 -2 4 4" markerWidth="4" markerHeight="4" color="blue"><g><path d="M 1.6 0 L .8 -.60000002 L 0 0 L .8 .60000002 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker><font-face font-family="Helvetica" font-size="17" units-per-em="1000" underline-position="-75.683594" underline-thickness="49.316406" slope="0" x-height="532.22656" cap-height="719.72656" ascent="770.01953" descent="-229.98047" font-weight="bold"><font-face-src><font-face-name name="Helvetica-Bold"/></font-face-src></font-face></defs><g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1"><title>Canvas 1</title><g><title>Layer 1</title><g><use xl:href="#id411_Graphic" filter="url(#Shadow)"/><use xl:href="#id410_Graphic" filter="url(#Shadow)"/><use xl:href="#id408_Graphic" filter="url(#Shadow)"/><use xl:href="#id407_Graphic" filter="url(#Shadow)"/><use xl:href="#id395_Graphic" filter="url(#Shadow)"/><use xl:href="#id394_Graphic" filter="url(#Shadow)"/><use xl:href="#id391_Graphic" filter="url(#Shadow)"/><use xl:href="#id390_Graphic" filter="url(#Shadow)"/><use xl:href="#id724_Graphic" filter="url(#Shadow)"/></g><g id="id411_Graphic"><rect x="145" y="146" width="238" height="373" fill="white" fill-opacity=".5"/><rect x="145" y="146" width="238" height="373" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/></g><g id="id410_Graphic"><circle cx="290.34644" cy="351.50146" r="28.34651" fill="red"/><circle cx="290.34644" cy="351.50146" r="28.34651" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(272.66928 336.0015)" fill="black"><tspan font-family="Helvetica" font-size="26" font-weight="500" x="9.006262" y="25" textLength="17.341797">A</tspan></text></g><line x1="216.72533" y1="434.68497" x2="271.22772" y2="373.10342" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"/><g id="id408_Graphic"><circle cx="207.00024" cy="445.67322" r="14.173263" fill="black"/><circle cx="207.00024" cy="445.67322" r="14.173263" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/></g><g id="id407_Graphic"><circle cx="206.30316" cy="488.67325" r="14.173263" fill="black"/><circle cx="206.30316" cy="488.67325" r="14.173263" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/></g><line x1="206.7624" y1="460.34457" x2="206.541" y2="474.0019" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><g id="id395_Graphic"><circle cx="206.30315" cy="266.11322" r="24.803194" fill="#ff8000" fill-opacity=".5"/><path d="M 223.8416 248.57477 C 233.52788 258.26099 233.52788 273.96545 223.8416 283.65167 C 214.15538 293.33795 198.45091 293.33795 188.76469 283.65167 C 179.07841 273.96545 179.07841 258.26099 188.76469 248.57477 C 198.45091 238.88849 214.15538 238.88849 223.8416 248.57477" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1" stroke-dasharray="8,5"/><text transform="translate(191.46063 250.61322)" fill="black"><tspan font-family="Helvetica" font-size="26" font-weight="500" x="5.4543362" y="25" textLength="18.776367">C</tspan></text></g><g id="id394_Graphic"><circle cx="206.30315" cy="351.50146" r="24.803194" fill="yellow" fill-opacity=".5"/><path d="M 223.8416 333.96301 C 233.52788 343.64923 233.52788 359.3537 223.8416 369.03992 C 214.15538 378.7262 198.45091 378.7262 188.76469 369.03992 C 179.07841 359.3537 179.07841 343.64923 188.76469 333.96301 C 198.45091 324.27673 214.15538 324.27673 223.8416 333.96301" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1" stroke-dasharray="8,5"/><text transform="translate(191.46063 336.00146)" fill="black"><tspan font-family="Helvetica" font-size="26" font-weight="500" x="6.1716213" y="25" textLength="17.341797">B</tspan></text></g><line x1="206.89162" y1="431.00034" x2="206.49045" y2="376.80396" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="206.30315" y1="326.1983" x2="206.30315" y2="291.41638" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><g id="id391_Graphic"><circle cx="290.34644" cy="269.6565" r="28.346504" fill="yellow"/><circle cx="290.34644" cy="269.6565" r="28.346504" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(272.66928 254.15652)" fill="black"><tspan font-family="Helvetica" font-size="26" font-weight="500" x="6.1180782" y="25" textLength="23.118164">B’</tspan></text></g><g id="id390_Graphic"><circle cx="290.34644" cy="187.80643" r="28.3465" fill="#ff8000"/><circle cx="290.34644" cy="187.80643" r="28.3465" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(272.66928 172.30643)" fill="black"><tspan font-family="Helvetica" font-size="26" font-weight="500" x="5.400793" y="25" textLength="24.552734">C’</tspan></text></g><line x1="290.34644" y1="322.655" x2="290.34644" y2="298.50296" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"/><line x1="290.3464" y1="240.81003" x2="290.3464" y2="216.65289" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"/><line x1="269.24112" y1="207.47118" x2="232.0592" y2="242.11519" marker-end="url(#FilledDiamond_Marker)" stroke="blue" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" stroke-dasharray="1,3"/><line x1="269.68039" y1="289.78198" x2="231.52318" y2="326.9411" marker-end="url(#FilledDiamond_Marker)" stroke="blue" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" stroke-dasharray="1,3"/><text transform="translate(154.02574 177.80643)" fill="blue"><tspan font-family="Helvetica" font-size="17" font-weight="bold" fill="blue" x=".13012695" y="16" textLength="72.739746">Obsolete</tspan></text><g id="id724_Graphic"><path d="M 167.93994 250.66768 C 182.56549 215.87003 217.30066 204.27097 239.23875 230.14594 C 261.17621 256.02005 253.8645 373.79715 241.98106 377.36597 C 230.09801 380.93442 197.19122 394.31873 179.82327 382.71951 C 162.45541 371.1203 153.31494 285.46457 167.93994 250.66768 Z" fill="blue" fill-opacity=".15000001"/><path d="M 167.93994 250.66768 C 182.56549 215.87003 217.30066 204.27097 239.23875 230.14594 C 261.17621 256.02005 253.8645 373.79715 241.98106 377.36597 C 230.09801 380.93442 197.19122 394.31873 179.82327 382.71951 C 162.45541 371.1203 153.31494 285.46457 167.93994 250.66768 Z" stroke="blue" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" stroke-dasharray="4,9,1,5"/></g></g></g></svg>