sapling/hgext
Denis Laxalde be2630530f rebase: exclude descendants of obsoletes w/o a successor in dest (issue5300)
.. feature::

   Let 'hg rebase' avoid content-divergence by skipping obsolete
   changesets (and their descendants) when they are present in the rebase
   set along with one of their successors but none of their successors is
   in destination.

In the following example, when trying to rebase 3:: onto 2, the rebase
will abort with "this rebase will cause divergence from: 4":

    o  7 f
    |
    | o  6 e
    | |
    | o  5 d'
    | |
    x |  4 d (rewritten as 5)
    |/
    o  3 c
    |
    | o  2 x
    | |
    o |  1 b
    |/
    o  0 a

By excluding obsolete changesets without a successor in destination (4
in the example above) and their descendants, we make rebase work in this
case, thus giving:

    o  11 e
    |
    o  10 d'
    |
    o  9 c
    |
    o  8 b
    |
    | o  7 f
    | |
    | | x  6 e (rewritten using rebase as 11)
    | | |
    | | x  5 d' (rewritten using rebase as 10)
    | | |
    | x |  4 d
    | |/
    | x  3 c (rewritten using rebase as 9)
    | |
    o |  2 x
    | |
    | x  1 b (rewritten using rebase as 8)
    |/
    o  0 a

where branch 4:: is left behind while branch 5:: is rebased as expected.

The rationale is that users may not be interested in rebasing orphan
changesets when specifying a rebase set that include them but would
still want "stable" ones to be rebased. Currently, the user is suggested
to allow divergence (but probably does not want it) or they must specify
a rebase set excluding problematic changesets (which might be a bit
cumbersome). The approach proposed here corresponds to "Option 2" in
https://www.mercurial-scm.org/wiki/CEDRebase.


We extend _computeobsoletenotrebased() so that it also return a set of
obsolete changesets in rebase set without a successor in destination but
with at least one successor in rebase set. This
'obsoletewithoutsuccessorindestination' is then stored as an attribute
of rebaseruntime and used in _performrebasesubset() to:

* filter out descendants of these changesets from the revisions to
  rebase;
* issue a message about these revisions being skipped.

This only occurs if 'evolution.allowdivergence' option is off and
'rebaseskipobsolete' is on.
2017-11-14 22:46:10 +01:00
..
convert convert: register missed subversion config items 2017-10-18 18:11:50 -04:00
fsmonitor fsmonitor: use nonnormalset from dirstatemap 2017-10-18 15:42:44 -07:00
highlight highlight: put pygments import inside demandimport.deactivated 2017-06-18 23:05:54 -04:00
largefiles registrar: host "dynamicdefault" constant by configitem object 2017-10-21 13:13:20 +09:00
zeroconf zeroconf: do not crash if socket being read is closed by another thread 2017-10-02 20:23:25 -07:00
__init__.py hgext: officially turn 'hgext' into a namespace package 2016-02-27 12:56:26 +01:00
acl.py acl: make sure the extensions is enabled when the acl-hooks run 2017-10-14 01:16:03 +02:00
amend.py py3: handle keyword arguments in hgext/amend.py 2017-10-22 23:51:57 +05:30
automv.py py3: handle keyword arguments in hgext/automv.py 2017-10-22 23:52:22 +05:30
blackbox.py py3: handle keyword arguments in hgext/blackbox.py 2017-10-22 23:52:47 +05:30
bugzilla.py registrar: host "dynamicdefault" constant by configitem object 2017-10-21 13:13:20 +09:00
censor.py revlog: rename constants (API) 2017-05-17 19:52:18 -07:00
children.py children: fix the log expansion of hg children in doc 2017-10-31 06:39:38 +05:30
churn.py py3: handle keyword arguments in hgext/churn.py 2017-10-23 00:01:16 +05:30
clonebundles.py clonebundles: fix missing newline character 2017-05-24 22:59:59 -04:00
commitextras.py py3: handle keyword arguments in hgext/commitextras.py 2017-10-23 00:01:45 +05:30
eol.py eol: ensure the eol extensions is loaded when hooks run 2017-10-14 01:09:46 +02:00
extdiff.py py3: handle keyword arguments in hgext/extdiff.py 2017-10-23 00:02:07 +05:30
factotum.py configitems: register the 'factotum.service' config 2017-06-30 03:42:15 +02:00
fetch.py py3: handle keyword arguments in hgext/fetch.py 2017-10-23 00:02:28 +05:30
gpg.py py3: handle keyword arguments in hgext/gpg.py 2017-10-23 00:02:46 +05:30
graphlog.py py3: handle keyword arguments in hgext/graphlog.py 2017-10-23 00:03:08 +05:30
hgk.py py3: handle keyword arguments in hgext/hgk.py 2017-10-23 00:03:27 +05:30
histedit.py py3: handle keyword arguments in hgext/histedit.py 2017-10-23 00:03:54 +05:30
journal.py py3: handle keyword arguments in hgext/journal.py 2017-10-23 00:04:12 +05:30
keyword.py py3: handle keyword arguments in hgext/keyword.py 2017-10-23 00:04:30 +05:30
logtoprocess.py codemod: use pycompat.iswindows 2017-10-12 23:30:46 -07:00
mq.py mq: copy pager attributes back to qrepo.ui 2017-10-21 13:42:43 +09:00
notify.py configitem: register the 'notify.changegroup' config 2017-10-13 21:50:43 +02:00
pager.py configitems: register the 'pager.attend-.*' options 2017-10-11 02:26:09 +02:00
patchbomb.py configitems: register 'email.to' and 'patchbomb.to' 2017-10-20 22:25:09 +09:00
purge.py commands: move templates of common command options to cmdutil (API) 2017-05-14 16:19:47 +09:00
rebase.py rebase: exclude descendants of obsoletes w/o a successor in dest (issue5300) 2017-11-14 22:46:10 +01:00
record.py commands: move templates of common command options to cmdutil (API) 2017-05-14 16:19:47 +09:00
releasenotes.py py3: handle keyword arguments in hgext/releasenotes.py 2017-10-23 00:05:04 +05:30
relink.py extensions: change magic "shipped with hg" string 2016-08-23 11:26:08 -04:00
schemes.py codemod: use pycompat.iswindows 2017-10-12 23:30:46 -07:00
share.py share: move config item declarations into core 2017-11-06 10:33:40 -08:00
shelve.py py3: handle keyword arguments in hgext/shelve.py 2017-10-23 00:06:49 +05:30
show.py show: move configitems to core 2017-10-18 15:05:03 -07:00
sparse.py sparse: treat paths as cwd-relative 2017-08-04 05:38:22 -07:00
strip.py strip: take branch into account when selecting update target (issue5540) 2017-10-05 16:13:05 +02:00
transplant.py configitems: register the 'transplant.log' config 2017-06-30 03:44:30 +02:00
uncommit.py py3: handle keyword arguments in hgext/uncommit.py 2017-10-23 00:06:23 +05:30
win32mbcs.py codemod: use pycompat.iswindows 2017-10-12 23:30:46 -07:00
win32text.py configitems: register the 'win32text.warn' config 2017-06-30 03:45:56 +02:00