<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 14, 2017 at 3:24 AM, Denis Laxalde <span dir="ltr"><<a href="mailto:denis@laxalde.org" target="_blank">denis@laxalde.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Martin von Zweigbergk a écrit :<span class="gmail-"><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
On Mon, Nov 13, 2017 at 3:07 PM, Augie Fackler <<a href="mailto:raf@durin42.com" target="_blank">raf@durin42.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
On Sun, Nov 12, 2017 at 06:06:37PM +0100, Denis Laxalde wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
# HG changeset patch<br>
# User Denis Laxalde <<a href="mailto:denis@laxalde.org" target="_blank">denis@laxalde.org</a>><br>
# Date 1510489041 -3600<br>
#      Sun Nov 12 13:17:21 2017 +0100<br>
# Node ID 25d1891bd300bc527cb7e878532c85<wbr>12ff5489de<br>
# Parent  1d16e28225e01d2fac9f31ed058ae1<wbr>f4c00bb9da<br>
# EXP-Topic rebase-obsolete<br>
rebase: exclude obsoletes without a successor in destination (issue5300)<br>
</blockquote>
<br>
</blockquote>
<br>
If I read it right, this line should be something like "rebase: exclude<br>
*descendants of* obsoletes without..."<br>
</blockquote>
<br></span>
That's correct here and in the release note below.<div><div class="gmail-h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
I took patches 1-3. I think this is right. I'm 90% sure this is<br>
right. But I'm a little tired, and so I want Martin's more careful eye<br>
on it if he has time.<br>
<br>
</blockquote>
<br>
Thanks for asking. I think this makes sense. Thanks for working on this,<br>
Denis!<br>
<br>
I think a general thing to note is that if a commit in the rebase set has<br>
become obsolete, then there's a conflict between the rebase invocation and<br>
the obsmarkers. The rebase command tells us to move the descendants onto<br>
the rebase destination, while the obsmarkers tell us to move them onto the<br>
obsolete commit's successor. Since we don't keep track of some default<br>
rebase destination (like git's upstream concept), any "hg rebase"<br>
invocation is a one-off as far as hg is concerned, so I think it makes<br>
sense to resolve the conflict in favor of the obsmarkers. That probably<br>
didn't make much sense, so let me give an example:<br>
<br>
o B'<br>
|<br>
o O<br>
|<br>
| o U<br>
| |<br>
| | o C<br>
| | |<br>
| | x B<br>
| |/<br>
| .<br>
|/<br>
o A<br>
<br>
Let's say C's upstream was somehow configured to be U here, and that B had<br>
been rebased onto O instead. If the user then runs "hg evolve -r C", you<br>
could argue that there would be a similar conflict between rebase/upstream<br>
that want to move C onto U and obsmarkers that want to move C onto B'.<br>
However, since we don't have that feature, B' is the only natural<br>
destination.<br>
</blockquote>
<br></div></div>
I think I get this right, but I'm not sure if you actually expect me to<br>
change something (apart for other explicit comments, which I'll address)?<br></blockquote><div><br></div><div>Not asking for any changes. I just thought I'd mention an aspect I had not thought about before.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Also, the change proposed here handles cases where we cannot rebase C<br>
onto B' because both B and B' are part of the rebase set (and B' is not<br>
in destination).<div><div class="gmail-h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
In the following example, when trying to rebase 3:: onto 2, the rebase<br>
will abort with "this rebase will cause divergence from: 4":<br>
<br>
     o  7 f<br>
     |<br>
     | o  6 e<br>
     | |<br>
     | o  5 d'<br>
     | |<br>
     x |  4 d (rewritten as 5)<br>
     |/<br>
     o  3 c<br>
     |<br>
     | o  2 x<br>
     | |<br>
     o |  1 b<br>
     |/<br>
     o  0 a<br>
<br>
By excluding obsolete changesets without a successor in destination (4<br>
in the example above) and their descendants, we make rebase work in this<br>
case, thus giving:<br>
<br>
     o  11 e<br>
     |<br>
     o  10 d'<br>
     |<br>
     o  9 c<br>
     |<br>
     o  8 b<br>
     |<br>
     | o  7 f<br>
     | |<br>
     | | x  6 e (rewritten using rebase as 11)<br>
     | | |<br>
     | | x  5 d' (rewritten using rebase as 10)<br>
     | | |<br>
     | x |  4 d<br>
     | |/<br>
     | x  3 c (rewritten using rebase as 9)<br>
     | |<br>
     o |  2 x<br>
     | |<br>
     | x  1 b (rewritten using rebase as 8)<br>
     |/<br>
     o  0 a<br>
<br>
where branch 4:: is left behind while branch 5:: is rebased as expected.<br>
<br>
The rationale is that users may not be interested in rebasing orphan<br>
changesets when specifying a rebase set that include them but would<br>
still want "stable" ones to be rebased. Currently, the user is suggested<br>
to allow divergence (but probably does not want it) or they must specify<br>
a rebase set excluding problematic changesets (which might be a bit<br>
cumbersome). The approach proposed here corresponds to "Option 2" in<br>
<a href="https://www.mercurial-scm.org/wiki/CEDRebase" rel="noreferrer" target="_blank">https://www.mercurial-scm.org/<wbr>wiki/CEDRebase</a>.<br>
</blockquote>
<br>
</blockquote>
<br>
I think I'd still want "Option 3", but I don't think this patch prevents<br>
that from happening later.<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
.. feature::<br>
<br>
    Let 'hg rebase' avoid content-divergence when obsolete changesets are<br>
    present in the rebase set by skipping possible sources of divergence.<br>
</blockquote>
<br>
</blockquote>
<br>
Similar to what I said above, I think it would help to mention descendants<br>
here. While "possible sources of divergence" is vague enough to be correct,<br>
it would be helpful if we could clarify it.<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
</blockquote>
<br>
</blockquote>
<br>
Just to make sure, the stuff below is not part of the release notes, is it?<br>
I'm not familiar with the syntax, so I can't tell (and I'm too lazy to test<br>
it).<br>
</blockquote>
<br></div></div>
The directive block only includes indented lines, so by de-denting the<br>
text below, it will not be in the release note.<div><div class="gmail-h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
We extend _computeobsoletenotrebased() so that it also return a set of<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
obsolete changesets in rebaseset without a successor in destination.<br>
This 'obsoletewithoutsuccessorindes<wbr>tination' is then stored as an<br>
attribute of rebaseruntime and used in _performrebasesubset() to:<br>
<br>
* filter out descendants of these changesets from the revisions to<br>
   rebase;<br>
* issue a message about these revisions being skipped.<br>
<br>
This only occurs if 'evolution.allowdivergence' option is off and<br>
'rebaseskipobsolete' is on.<br>
<br>
diff --git a/hgext/rebase.py b/hgext/rebase.py<br>
--- a/hgext/rebase.py<br>
+++ b/hgext/rebase.py<br>
@@ -179,6 +179,7 @@ class rebaseruntime(object):<br>
          # other extensions<br>
          self.keepopen = opts.get('keepopen', False)<br>
          self.obsoletenotrebased = {}<br>
+        self.obsoletewithoutsuccessori<wbr>ndestination = set()<br>
<br>
      @property<br>
      def repo(self):<br>
@@ -311,9 +312,10 @@ class rebaseruntime(object):<br>
          if not self.ui.configbool('experiment<wbr>al',<br>
</blockquote>
'rebaseskipobsolete'):<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
              return<br>
          obsoleteset = set(obsoleterevs)<br>
-        self.obsoletenotrebased = _computeobsoletenotrebased(sel<wbr>f.repo,<br>
-                                    obsoleteset, destmap)<br>
+        self.obsoletenotrebased, self.obsoletewithoutsuccessori<wbr>ndestination<br>
</blockquote>
= \<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+            _computeobsoletenotrebased(sel<wbr>f.repo, obsoleteset, destmap)<br>
          skippedset = set(self.obsoletenotrebased)<br>
+        skippedset.update(self.obsolet<wbr>ewithoutsuccessorindestination<wbr>)<br>
          _checkobsrebase(self.repo, self.ui, obsoleteset, skippedset)<br>
<br>
      def _prepareabortorcontinue(self, isabort):<br>
@@ -419,12 +421,26 @@ class rebaseruntime(object):<br>
      def _performrebasesubset(self, tr, subset, pos, total):<br>
          repo, ui, opts = self.repo, self.ui, self.opts<br>
          sortedrevs = repo.revs('sort(%ld, -topo)', subset)<br>
+        allowdivergence = self.ui.configbool(<br>
+            'experimental', 'evolution.allowdivergence')<br>
+        if not allowdivergence:<br>
+            sortedrevs -= repo.revs(<br>
+                'descendants(%ld) and not %ld',<br>
+                self.obsoletewithoutsuccessori<wbr>ndestination,<br>
+                self.obsoletewithoutsuccessori<wbr>ndestination,<br>
+            )<br>
          for rev in sortedrevs:<br>
              dest = self.destmap[rev]<br>
              ctx = repo[rev]<br>
              desc = _ctxdesc(ctx)<br>
              if self.state[rev] == rev:<br>
                  ui.status(_('already rebased %s\n') % desc)<br>
+            elif (not allowdivergence<br>
+                  and rev in self.obsoletewithoutsuccessori<br>
</blockquote>
ndestination):<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+                msg = _('note: not rebasing %s and its descendants as '<br>
+                        'this would cause divergences\n') % desc<br>
+                repo.ui.status(msg)<br>
+                self.skipped.add(rev)<br>
              elif rev in self.obsoletenotrebased:<br>
                  succ = self.obsoletenotrebased[rev]<br>
                  if succ is None:<br>
@@ -1616,11 +1632,16 @@ def _filterobsoleterevs(repo, revs):<br>
      return set(r for r in revs if repo[r].obsolete())<br>
<br>
  def _computeobsoletenotrebased(rep<wbr>o, rebaseobsrevs, destmap):<br>
-    """return a mapping obsolete => successor for all obsolete nodes to<br>
</blockquote>
be<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
-    rebased that have a successors in the destination<br>
+    """Return (obsoletenotrebased, obsoletewithoutsuccessorindest<br>
</blockquote>
ination).<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+<br>
+    `obsoletenotrebased` is a mapping mapping obsolete => successor for<br>
</blockquote>
all<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+    obsolete nodes to be rebased given in `rebaseobsrevs`.<br>
<br>
-    obsolete => None entries in the mapping indicate nodes with no<br>
</blockquote>
successor"""<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+    `obsoletewithoutsuccessorindes<wbr>tination` is a set with obsolete<br>
</blockquote>
revisions<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+    without a successor in destination.<br>
+    """<br>
      obsoletenotrebased = {}<br>
+    obsoletewithoutsuccessorindest<wbr>ination = set([])<br>
<br>
      assert repo.filtername is None<br>
      cl = repo.changelog<br>
@@ -1641,8 +1662,17 @@ def _computeobsoletenotrebased(rep<wbr>o, reb<br>
                  if cl.isancestor(succnode, destnode):<br>
                      obsoletenotrebased[srcrev] = nodemap[succnode]<br>
                      break<br>
+            else:<br>
+                # Unless 'srcrev' only has one successor and it's not in<br>
+                # rebaseset, we might skip it and its descendants as it<br>
</blockquote>
has no<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+                # successor in destination. Otherwise, we'll issue the<br>
+                # divergence warning and abort.<br></blockquote></blockquote></blockquote></div></div></blockquote><div><br></div><div>Hmm, that actually doesn't sound like "successor in destination", it sounds like "no successor in rebase set". It sounds like it'll miss this case:</div><div><br></div><div><div>$ hg hg rebase -b C -d E</div><div><br></div><div>o E</div><div>|</div><div>o B''</div><div>|</div><div>| o D</div><div>| |</div><div>| x B'</div><div>| |</div><div>| | o C</div><div>| | |</div><div>| | x B</div><div>| |/</div><div>| o A</div><div>|/</div><div>o X</div><div><br></div></div><div>I think it would be nice to *not* skip C or D in this case (IIUC, C would be skipped by this patch). Maybe it's enough to check only the immediate visible successors? I.e. using the "closest=True" thing that I think Boris added recently.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="gmail-h5"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+                if (len(successors) > 1<br>
</blockquote>
<br>
</blockquote>
<br>
This line doesn't seem necessary, but feel free to keep if you think it<br>
helps readability (I find it slightly distracting).<br>
</blockquote>
<br></div></div>
You're right, it's not needed.<div><div class="gmail-h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
+                        and any(nodemap[s] in destmap<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+                                for s in successors if s != srcnode)):<br>
+                    obsoletewithoutsuccessorindest<wbr>ination.add(srcrev)<br></blockquote></blockquote></blockquote></div></div></blockquote><div><br></div><div>This does not seem to check the "only has one successor" that you described. I'm not sure what the reason for that condition is, so I don't know if the code or the description should be fixed (or if I just misunderstood). I saw some comment suggesting that we don't care much about splits yet, so I suppose the "only has one successor" is not about that?</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="gmail-h5"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
-    return obsoletenotrebased<br>
+    return obsoletenotrebased, obsoletewithoutsuccessorindest<wbr>ination<br>
<br>
  def summaryhook(ui, repo):<br>
      if not repo.vfs.exists('rebasestate')<wbr>:<br>
diff --git a/tests/test-rebase-obsolete.t b/tests/test-rebase-obsolete.t<br>
--- a/tests/test-rebase-obsolete.t<br>
+++ b/tests/test-rebase-obsolete.t<br>
@@ -987,6 +987,208 @@ Create the changes that we will rebase<br>
    rebasing 21:7bdc8a87673d "dummy change" (tip)<br>
    $ cd ..<br>
<br>
+Divergence cases due to obsolete changesets<br>
+-----------------------------<wbr>--------------<br>
+<br>
+We should ignore branches with unstable changesets when they are based<br>
</blockquote>
on an<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+obsolete changeset which successor is in rebase set.<br>
+<br>
+  $ hg init divergence<br>
+  $ cd divergence<br>
+  $ cat >> .hg/hgrc << EOF<br>
+  > [extensions]<br>
+  > strip =<br>
+  > [alias]<br>
+  > strip = strip --no-backup --quiet<br>
+  > [templates]<br>
+  > instabilities = '{rev}:{node|short} {desc|firstline}{if(instabilit<wbr>ies,"<br>
</blockquote>
({instabilities})")}\n'<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+  > EOF<br>
+<br>
+  $ hg debugdrawdag <<EOF<br>
+  >   e   f<br>
+  >   |   |<br>
+  >   d'  d # replace: d -> d'<br>
+  >    \ /<br>
+  >     c<br>
+  >     |<br>
+  >   x b<br>
+  >    \|<br>
+  >     a<br>
+  > EOF<br>
+  $ hg log -G -r 'a'::<br>
+  o  7:1143e9adc121 f<br>
+  |<br>
+  | o  6:d60ebfa0f1cb e<br>
+  | |<br>
+  | o  5:027ad6c5830d d'<br>
+  | |<br>
+  x |  4:76be324c128b d (rewritten using replace as 5:027ad6c5830d)<br>
+  |/<br>
+  o  3:a82ac2b38757 c<br>
+  |<br>
+  | o  2:630d7c95eff7 x<br>
+  | |<br>
+  o |  1:488e1b7e7341 b<br>
+  |/<br>
+  o  0:b173517d0057 a<br>
+<br>
+<br>
+Changeset d and its descendants are excluded to avoid divergence of d,<br>
</blockquote>
which<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+would occur because the successor of d (d') is also in rebaseset. As a<br>
+consequence f (descendant of d) is left behind.<br>
+<br>
+  $ hg rebase -b 'e' -d 'x'<br>
+  rebasing 1:488e1b7e7341 "b" (b)<br>
+  rebasing 3:a82ac2b38757 "c" (c)<br>
+  rebasing 5:027ad6c5830d "d'" (d')<br>
+  rebasing 6:d60ebfa0f1cb "e" (e)<br>
+  note: not rebasing 4:76be324c128b "d" (d) and its descendants as this<br>
</blockquote>
would cause divergences<br>
<br>
</blockquote>
<br>
The plural "divergences" sounds wrong to me, but I'm not sure. Augie (or<br>
others), since you're a native English speaker, do you think it should be<br>
singular or plural?<br>
</blockquote>
<br></div></div>
It feels strange to me as well. I took it from the existing message<br>
"this rebase will cause divergences from: <obsolete>" (which, maybe, was<br>
also written by a non-native).<div class="gmail-HOEnZb"><div class="gmail-h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+  $ hg log -G -r 'a'::<br>
+  o  11:eb6d63fc4ed5 e<br>
+  |<br>
+  o  10:44d8c724a70c d'<br>
+  |<br>
+  o  9:d008e6b4d3fd c<br>
+  |<br>
+  o  8:67e8f4a16c49 b<br>
+  |<br>
+  | o  7:1143e9adc121 f<br>
+  | |<br>
+  | | x  6:d60ebfa0f1cb e (rewritten using rebase as 11:eb6d63fc4ed5)<br>
+  | | |<br>
+  | | x  5:027ad6c5830d d' (rewritten using rebase as 10:44d8c724a70c)<br>
+  | | |<br>
+  | x |  4:76be324c128b d (rewritten using replace as 5:027ad6c5830d)<br>
+  | |/<br>
+  | x  3:a82ac2b38757 c (rewritten using rebase as 9:d008e6b4d3fd)<br>
+  | |<br>
+  o |  2:630d7c95eff7 x<br>
+  | |<br>
+  | x  1:488e1b7e7341 b (rewritten using rebase as 8:67e8f4a16c49)<br>
+  |/<br>
+  o  0:b173517d0057 a<br>
+<br>
+  $ hg strip -r 8:<br>
+<br>
+If the rebase set has an obsolete (d) with a unique successor (d')<br>
</blockquote>
outside the<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+rebase set and not in destination, we still get the divergence warning.<br>
</blockquote>
By<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+allowing divergence, we can perform the rebase.<br>
+<br>
+  $ hg rebase -r 'c'::'f' -d 'x'<br>
+  abort: this rebase will cause divergences from: 76be324c128b<br>
+  (to force the rebase please set experimental.evolution.allowdi<br>
</blockquote>
vergence=True)<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+  [255]<br>
+  $ hg rebase --config experimental.evolution.allowdi<wbr>vergence=true -r<br>
</blockquote>
'c'::'f' -d 'x'<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+  rebasing 3:a82ac2b38757 "c" (c)<br>
+  rebasing 4:76be324c128b "d" (d)<br>
+  rebasing 7:1143e9adc121 "f" (f tip)<br>
+  $ hg log -G -r 'a':: -T instabilities<br>
+  o  10:e1744ea07510 f<br>
+  |<br>
+  o  9:e2b36ea9a0a0 d (content-divergent)<br>
+  |<br>
+  o  8:6a0376de376e c<br>
+  |<br>
+  | x  7:1143e9adc121 f<br>
+  | |<br>
+  | | o  6:d60ebfa0f1cb e (orphan)<br>
+  | | |<br>
+  | | o  5:027ad6c5830d d' (orphan content-divergent)<br>
+  | | |<br>
+  | x |  4:76be324c128b d<br>
+  | |/<br>
+  | x  3:a82ac2b38757 c<br>
+  | |<br>
+  o |  2:630d7c95eff7 x<br>
+  | |<br>
+  | o  1:488e1b7e7341 b<br>
+  |/<br>
+  o  0:b173517d0057 a<br>
+<br>
+  $ hg strip -r 8:<br>
+<br>
+(Not skipping obsoletes means that divergence is allowed.)<br>
+<br>
+  $ hg rebase --config experimental.rebaseskipobsolet<wbr>e=false -r<br>
</blockquote>
'c'::'f' -d 'x'<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+  rebasing 3:a82ac2b38757 "c" (c)<br>
+  rebasing 4:76be324c128b "d" (d)<br>
+  rebasing 7:1143e9adc121 "f" (f tip)<br>
+<br>
+  $ hg strip -r 0:<br>
+<br>
+Similar test on a more complex graph<br>
+<br>
+  $ hg debugdrawdag <<EOF<br>
+  >       g<br>
+  >       |<br>
+  >   f   e<br>
+  >   |   |<br>
+  >   e'  d # replace: e -> e'<br>
+  >    \ /<br>
+  >     c<br>
+  >     |<br>
+  >   x b<br>
+  >    \|<br>
+  >     a<br>
+  > EOF<br>
+  $ hg log -G -r 'a':<br>
+  o  8:2876ce66c6eb g<br>
+  |<br>
+  | o  7:3ffec603ab53 f<br>
+  | |<br>
+  x |  6:e36fae928aec e (rewritten using replace as 5:63324dc512ea)<br>
+  | |<br>
+  | o  5:63324dc512ea e'<br>
+  | |<br>
+  o |  4:76be324c128b d<br>
+  |/<br>
+  o  3:a82ac2b38757 c<br>
+  |<br>
+  | o  2:630d7c95eff7 x<br>
+  | |<br>
+  o |  1:488e1b7e7341 b<br>
+  |/<br>
+  o  0:b173517d0057 a<br>
+<br>
+  $ hg rebase -b 'f' -d 'x'<br>
+  rebasing 1:488e1b7e7341 "b" (b)<br>
+  rebasing 3:a82ac2b38757 "c" (c)<br>
+  rebasing 5:63324dc512ea "e'" (e')<br>
+  rebasing 7:3ffec603ab53 "f" (f)<br>
+  rebasing 4:76be324c128b "d" (d)<br>
+  note: not rebasing 6:e36fae928aec "e" (e) and its descendants as this<br>
</blockquote>
would cause divergences<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+  $ hg log -G -r 'a':<br>
+  o  13:a1707a5b7c2c d<br>
+  |<br>
+  | o  12:ef6251596616 f<br>
+  | |<br>
+  | o  11:b6f172e64af9 e'<br>
+  |/<br>
+  o  10:d008e6b4d3fd c<br>
+  |<br>
+  o  9:67e8f4a16c49 b<br>
+  |<br>
+  | o  8:2876ce66c6eb g<br>
+  | |<br>
+  | | x  7:3ffec603ab53 f (rewritten using rebase as 12:ef6251596616)<br>
+  | | |<br>
+  | x |  6:e36fae928aec e (rewritten using replace as 5:63324dc512ea)<br>
+  | | |<br>
+  | | x  5:63324dc512ea e' (rewritten using rebase as 11:b6f172e64af9)<br>
+  | | |<br>
+  | x |  4:76be324c128b d (rewritten using rebase as 13:a1707a5b7c2c)<br>
+  | |/<br>
+  | x  3:a82ac2b38757 c (rewritten using rebase as 10:d008e6b4d3fd)<br>
+  | |<br>
+  o |  2:630d7c95eff7 x<br>
+  | |<br>
+  | x  1:488e1b7e7341 b (rewritten using rebase as 9:67e8f4a16c49)<br>
+  |/<br>
+  o  0:b173517d0057 a<br>
+<br>
+<br>
+  $ cd ..<br>
+<br>
  Rebase merge where successor of one parent is equal to destination<br>
</blockquote>
(issue5198)<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
    $ hg init p1-succ-is-dest<br>
______________________________<wbr>_________________<br>
Mercurial-devel mailing list<br>
<a href="mailto:Mercurial-devel@mercurial-scm.org" target="_blank">Mercurial-devel@mercurial-scm.<wbr>org</a><br>
<a href="https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel" rel="noreferrer" target="_blank">https://www.mercurial-scm.org/<wbr>mailman/listinfo/mercurial-dev<wbr>el</a><br>
</blockquote>
<br>
</blockquote>
<br>
</blockquote>
<br>
</div></div></blockquote></div><br></div></div>