Mercurial > hg
comparison tests/test-rebase-obsolete.t @ 37787:92213f6745ed
rebase: introduce support for automatically rebasing orphan changes
_destautorebase(SRC) is based on the _destrestack(SRC) revset from
fbamend. The supporting _possibledestination function is extracted
from evolve, with minor cleanups.
We've considered some alternatives here:
* This change, but with --auto as the flag name. We're hedging our bets
on this a little in this change so that if this ends up being the wrong
direction we haven't burned the valauble --auto name on rebase.
* --destination auto: I've got reservations about the discoverability of this,
and we don't currently have a good story for a revset alias of sorts that
changes behavior depending on the context in which it's used.
* A "rebase presets" feature, where we could use the currently-an-error
positional argument space for the rebase command to define presets, so that
users could define a 'linearize' preset that specifies
--revision='orphan()-obsolete()' and --dest=_destautoorphanrebase(SRC).
Personally, I find the third option somewhat appealing, but am
hesitant to "spend" the functionality space of positional arguments to
the rebase command. We should revisit the way we expose this
functionality sometime in the 4.7 cycle once we've had a chance to vet
the implementation of the functionality.
Differential Revision: https://phab.mercurial-scm.org/D2668
author | Augie Fackler <augie@google.com> |
---|---|
date | Sun, 04 Mar 2018 15:29:41 -0500 |
parents | b7e2cf114e85 |
children | ea63a2004d09 69d1cafe75f2 |
comparison
equal
deleted
inserted
replaced
37786:cc932c15b9ee | 37787:92213f6745ed |
---|---|
480 | | | 480 | | |
481 | o 4:9520eea781bc E | 481 | o 4:9520eea781bc E |
482 |/ | 482 |/ |
483 o 0:cd010b8cd998 A | 483 o 0:cd010b8cd998 A |
484 | 484 |
485 | 485 $ cd .. |
486 $ cp -R hidden stabilize | |
487 $ cd stabilize | |
488 $ hg rebase --auto-orphans '0::' -d 10 | |
489 abort: --auto-orphans is incompatible with --dest | |
490 [255] | |
491 $ hg rebase --auto-orphans '0::' | |
492 rebasing 9:cf44d2f5a9f4 "D" | |
493 $ hg log -G | |
494 o 12:7e3935feaa68 D | |
495 | | |
496 o 11:0d8f238b634c C | |
497 | | |
498 o 10:7c6027df6a99 B | |
499 | | |
500 @ 7:02de42196ebe H | |
501 | | |
502 | o 6:eea13746799a G | |
503 |/| | |
504 o | 5:24b6387c8c8c F | |
505 | | | |
506 | o 4:9520eea781bc E | |
507 |/ | |
508 o 0:cd010b8cd998 A | |
509 | |
510 | |
511 $ cd ../hidden | |
512 $ rm -r ../stabilize | |
486 | 513 |
487 Test multiple root handling | 514 Test multiple root handling |
488 ------------------------------------ | 515 ------------------------------------ |
489 | 516 |
490 $ hg rebase --dest 4 --rev '7+11+9' | 517 $ hg rebase --dest 4 --rev '7+11+9' |