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="27 2166 497 345" width="497pt" height="345pt"><metadata xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:date>2012-03-21 08:32Z</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><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledDiamond_Marker" viewBox="-1 -3 6 6" markerWidth="6" markerHeight="6" color="red"><g><path d="M 3.7333333 0 L 1.8666667 -1.4 L 0 0 L 1.8666667 1.4 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker><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></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="#id532_Graphic" filter="url(#Shadow)"/><use xl:href="#id525_Graphic" filter="url(#Shadow)"/><use xl:href="#id526_Graphic" filter="url(#Shadow)"/><use xl:href="#id528_Graphic" filter="url(#Shadow)"/><use xl:href="#id529_Graphic" filter="url(#Shadow)"/><use xl:href="#id534_Graphic" filter="url(#Shadow)"/><use xl:href="#id535_Graphic" filter="url(#Shadow)"/><use xl:href="#id537_Graphic" filter="url(#Shadow)"/><use xl:href="#id540_Graphic" filter="url(#Shadow)"/><use xl:href="#id541_Graphic" filter="url(#Shadow)"/><use xl:href="#id546_Graphic" filter="url(#Shadow)"/><use xl:href="#id549_Graphic" filter="url(#Shadow)"/></g><g id="id532_Graphic"><rect x="285.5" y="2182.9602" width="218" height="303.08691" fill="white" fill-opacity=".5"/><rect x="285.5" y="2182.9602" width="218" height="303.08691" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/></g><line x1="427.7653" y1="2330.3635" x2="376.8968" y2="2275.3335" marker-end="url(#FilledDiamond_Marker)" stroke="red" stroke-linecap="round" stroke-linejoin="round" stroke-width="3" stroke-dasharray="1,4"/><g id="id525_Graphic"><rect x="47" y="2215.56" width="143" height="260.96387" fill="white" fill-opacity=".5"/><rect x="47" y="2215.56" width="143" height="260.96387" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/></g><g id="id526_Graphic"><path d="M 138.5444 2321.9729 C 149.61443 2333.043 149.61443 2350.9907 138.5444 2362.0608 C 127.47443 2373.1309 109.526474 2373.1309 98.456505 2362.0608 C 87.386475 2350.9907 87.386475 2333.043 98.456505 2321.9729 C 109.526474 2310.9028 127.47443 2310.9028 138.5444 2321.9729" fill="red"/><path d="M 138.5444 2321.9729 C 149.61443 2333.043 149.61443 2350.9907 138.5444 2362.0608 C 127.47443 2373.1309 109.526474 2373.1309 98.456505 2362.0608 C 87.386475 2350.9907 87.386475 2333.043 98.456505 2321.9729 C 109.526474 2310.9028 127.47443 2310.9028 138.5444 2321.9729" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(100.82329 2326.5168)" 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="118.50029" y1="2402.1704" x2="118.500374" y2="2370.8633" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"/><g id="id528_Graphic"><path d="M 128.52225 2406.8218 C 134.05727 2412.3567 134.05727 2421.3308 128.52225 2426.8657 C 122.98724 2432.4009 114.01326 2432.4009 108.478264 2426.8657 C 102.94324 2421.3308 102.94324 2412.3567 108.478264 2406.8218 C 114.01326 2401.2866 122.98724 2401.2866 128.52225 2406.8218" fill="black"/><path d="M 128.52225 2406.8218 C 134.05727 2412.3567 134.05727 2421.3308 128.52225 2426.8657 C 122.98724 2432.4009 114.01326 2432.4009 108.478264 2426.8657 C 102.94324 2421.3308 102.94324 2412.3567 108.478264 2406.8218 C 114.01326 2401.2866 122.98724 2401.2866 128.52225 2406.8218" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/></g><g id="id529_Graphic"><path d="M 128.52225 2452.3218 C 134.05727 2457.8567 134.05727 2466.8308 128.52225 2472.3657 C 122.98724 2477.9009 114.01326 2477.9009 108.478264 2472.3657 C 102.94324 2466.8308 102.94324 2457.8567 108.478264 2452.3218 C 114.01326 2446.7866 122.98724 2446.7866 128.52225 2452.3218" fill="black"/><path d="M 128.52225 2452.3218 C 134.05727 2457.8567 134.05727 2466.8308 128.52225 2472.3657 C 122.98724 2477.9009 114.01326 2477.9009 108.478264 2472.3657 C 102.94324 2466.8308 102.94324 2457.8567 108.478264 2452.3218 C 114.01326 2446.7866 122.98724 2446.7866 128.52225 2452.3218" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/></g><line x1="118.50025" y1="2431.5171" x2="118.50025" y2="2447.6704" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="393.10349" y1="2414.4607" x2="364.69394" y2="2374.9673" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"/><g id="id534_Graphic"><path d="M 411.69525 2416.352 C 417.23026 2421.887 417.23026 2430.8611 411.69525 2436.396 C 406.16025 2441.9312 397.18625 2441.9312 391.65125 2436.396 C 386.11624 2430.8611 386.11624 2421.887 391.65125 2416.352 C 397.18625 2410.8169 406.16025 2410.8169 411.69525 2416.352" fill="black"/><path d="M 411.69525 2416.352 C 417.23026 2421.887 417.23026 2430.8611 411.69525 2436.396 C 406.16025 2441.9312 397.18625 2441.9312 391.65125 2436.396 C 386.11624 2430.8611 386.11624 2421.887 391.65125 2416.352 C 397.18625 2410.8169 406.16025 2410.8169 411.69525 2416.352" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/></g><g id="id535_Graphic"><path d="M 411.69525 2461.852 C 417.23026 2467.387 417.23026 2476.3611 411.69525 2481.896 C 406.16025 2487.4312 397.18625 2487.4312 391.65125 2481.896 C 386.11624 2476.3611 386.11624 2467.387 391.65125 2461.852 C 397.18625 2456.3169 406.16025 2456.3169 411.69525 2461.852" fill="black"/><path d="M 411.69525 2461.852 C 417.23026 2467.387 417.23026 2476.3611 411.69525 2481.896 C 406.16025 2487.4312 397.18625 2487.4312 391.65125 2481.896 C 386.11624 2476.3611 386.11624 2467.387 391.65125 2461.852 C 397.18625 2456.3169 406.16025 2456.3169 411.69525 2461.852" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/></g><line x1="401.67325" y1="2441.0474" x2="401.67325" y2="2457.2007" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><g id="id537_Graphic"><path d="M 367.89038 2331.5027 C 378.96042 2342.5728 378.96042 2360.5205 367.89038 2371.5906 C 356.8204 2382.6606 338.87247 2382.6606 327.8025 2371.5906 C 316.73245 2360.5205 316.73245 2342.5728 327.8025 2331.5027 C 338.87247 2320.4326 356.8204 2320.4326 367.89038 2331.5027" fill="red" fill-opacity=".5"/><path d="M 367.89038 2331.5027 C 378.96042 2342.5728 378.96042 2360.5205 367.89038 2371.5906 C 356.8204 2382.6606 338.87247 2382.6606 327.8025 2371.5906 C 316.73245 2360.5205 316.73245 2342.5728 327.8025 2331.5027 C 338.87247 2320.4326 356.8204 2320.4326 367.89038 2331.5027" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1" stroke-dasharray="8,5"/><text transform="translate(330.16928 2336.0466)" 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="118.500275" y1="2313.1704" x2="118.50013" y2="2289.523" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"/><g id="id540_Graphic"><path d="M 138.5439 2240.6326 C 149.61392 2251.7026 149.61392 2269.6504 138.5439 2280.7205 C 127.47393 2291.7905 109.52598 2291.7905 98.45601 2280.7205 C 87.38598 2269.6504 87.38598 2251.7026 98.45601 2240.6326 C 109.52598 2229.5625 127.47393 2229.5625 138.5439 2240.6326" fill="yellow"/><path d="M 138.5439 2240.6326 C 149.61392 2251.7026 149.61392 2269.6504 138.5439 2280.7205 C 127.47393 2291.7905 109.52598 2291.7905 98.45601 2280.7205 C 87.38598 2269.6504 87.38598 2251.7026 98.45601 2240.6326 C 109.52598 2229.5625 127.47393 2229.5625 138.5439 2240.6326" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(100.82279 2245.1765)" fill="black"><tspan font-family="Helvetica" font-size="26" font-weight="500" x="9.006262" y="25" textLength="17.341797">B</tspan></text></g><g id="id541_Graphic"><path d="M 367.89038 2223.8625 C 378.96042 2234.9326 378.96042 2252.8804 367.89038 2263.9504 C 356.8204 2275.0205 338.87247 2275.0205 327.8025 2263.9504 C 316.73245 2252.8804 316.73245 2234.9326 327.8025 2223.8625 C 338.87247 2212.7925 356.8204 2212.7925 367.89038 2223.8625" fill="yellow" fill-opacity=".5"/><path d="M 367.89038 2223.8625 C 378.96042 2234.9326 378.96042 2252.8804 367.89038 2263.9504 C 356.8204 2275.0205 338.87247 2275.0205 327.8025 2263.9504 C 316.73245 2252.8804 316.73245 2234.9326 327.8025 2223.8625 C 338.87247 2212.7925 356.8204 2212.7925 367.89038 2223.8625" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1" stroke-dasharray="8,5"/><text transform="translate(330.16928 2228.4065)" fill="black"><tspan font-family="Helvetica" font-size="26" font-weight="500" x="9.006262" y="25" textLength="17.341797">B</tspan></text></g><line x1="347.84644" y1="2322.7002" x2="347.84644" y2="2272.7529" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"/><g id="id546_Graphic"><path d="M 467.39038 2218.6619 C 478.46042 2229.732 478.46042 2247.6797 467.39038 2258.7498 C 456.3204 2269.8198 438.37247 2269.8198 427.3025 2258.7498 C 416.23245 2247.6797 416.23245 2229.732 427.3025 2218.6619 C 438.37247 2207.5918 456.3204 2207.5918 467.39038 2218.6619" fill="red"/><path d="M 467.39038 2218.6619 C 478.46042 2229.732 478.46042 2247.6797 467.39038 2258.7498 C 456.3204 2269.8198 438.37247 2269.8198 427.3025 2258.7498 C 416.23245 2247.6797 416.23245 2229.732 427.3025 2218.6619 C 438.37247 2207.5918 456.3204 2207.5918 467.39038 2218.6619" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(429.66928 2223.2058)" fill="black"><tspan font-family="Helvetica" font-size="26" font-weight="500" x="6.5243282" y="25" textLength="22.305664">A'</tspan></text></g><line x1="409.35617" y1="2413.8691" x2="432.46094" y2="2376.2634" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"/><line x1="447.3466" y1="2267.5522" x2="447.34692" y2="2322.7002" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"/><g id="id549_Graphic"><path d="M 467.39038 2331.5027 C 478.46042 2342.5728 478.46042 2360.5205 467.39038 2371.5906 C 456.3204 2382.6606 438.37247 2382.6606 427.3025 2371.5906 C 416.23245 2360.5205 416.23245 2342.5728 427.3025 2331.5027 C 438.37247 2320.4326 456.3204 2320.4326 467.39038 2331.5027" fill="yellow"/><path d="M 467.39038 2331.5027 C 478.46042 2342.5728 478.46042 2360.5205 467.39038 2371.5906 C 456.3204 2382.6606 438.37247 2382.6606 427.3025 2371.5906 C 416.23245 2360.5205 416.23245 2342.5728 427.3025 2331.5027 C 438.37247 2320.4326 456.3204 2320.4326 467.39038 2331.5027" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(429.66928 2336.0466)" fill="black"><tspan font-family="Helvetica" font-size="26" font-weight="500" x="6.5243282" y="25" textLength="22.305664">B'</tspan></text></g><line x1="428.2673" y1="2260.343" x2="376.15155" y2="2319.4465" marker-end="url(#FilledDiamond_Marker)" stroke="red" stroke-linecap="round" stroke-linejoin="round" stroke-width="3" stroke-dasharray="1,4"/></g></g></svg>