Patchwork [v2] rebase: turn rebaseskipobsolete on by default

login
register
mail settings
Submitter Kostia Balytskyi
Date March 9, 2016, 11:28 a.m.
Message ID <c7732369ce04104bd108.1457522887@dev1902.lla1.facebook.com>
Download mbox | patch
Permalink /patch/13717/
State Superseded
Headers show

Comments

Kostia Balytskyi - March 9, 2016, 11:28 a.m.
# HG changeset patch
# User Kostia Balytskyi <ikostia@fb.com>
# Date 1457522696 28800
#      Wed Mar 09 03:24:56 2016 -0800
# Node ID c7732369ce04104bd1089c02b1694cd0d3fe9230
# Parent  f126bb86a4e282fc1113a9c67777e9ca3764e57b
rebase: turn rebaseskipobsolete on by default

As per plan desribed in
https://www.mercurial-scm.org/wiki/ChangesetEvolutionDevel#Using_Obsolescence_Marker_during_Rebase
we want to turn rebaseskipobsolete on by default. Please note
that issue4210 is not a blocker since we have a warning that
will tell user about the potential divergence now.
Pierre-Yves David - March 9, 2016, 2:47 p.m.
On 03/09/2016 11:28 AM, Kostia Balytskyi wrote:
> # HG changeset patch
> # User Kostia Balytskyi <ikostia@fb.com>
> # Date 1457522696 28800
> #      Wed Mar 09 03:24:56 2016 -0800
> # Node ID c7732369ce04104bd1089c02b1694cd0d3fe9230
> # Parent  f126bb86a4e282fc1113a9c67777e9ca3764e57b
> rebase: turn rebaseskipobsolete on by default
>
> As per plan desribed in

Consider enabling a spell checker for you commit message ;-)

> https://www.mercurial-scm.org/wiki/ChangesetEvolutionDevel#Using_Obsolescence_Marker_during_Rebase

We probably don't want to use a link to the wiki here, the wiki et 
changing over time and will get cleaned up. This section will probably 
be deleted once everything is done. It would be better to describe the 
motivation for this change (and why it is the right change) directly in 
the commit message. Ping me IRL if you need help to write that down.

> we want to turn rebaseskipobsolete on by default. Please note
> that issue4210 is not a blocker since we have a warning that
> will tell user about the potential divergence now.
>
> diff --git a/hgext/rebase.py b/hgext/rebase.py
> --- a/hgext/rebase.py
> +++ b/hgext/rebase.py
> @@ -297,7 +297,8 @@ def rebase(ui, repo, **opts):
>                       hint=_('use --keep to keep original changesets'))
>
>               obsoletenotrebased = {}
> -            if ui.configbool('experimental', 'rebaseskipobsolete'):
> +            if ui.configbool('experimental',
> +                             'rebaseskipobsolete', default=True):

Try to keep the first line the longest:

   if ui.configbool('experimental', 'rebaseskipobsolete',
                    default=True):

>                   rebasesetrevs = set(rebaseset)
>                   rebaseobsrevs = _filterobsoleterevs(repo, rebasesetrevs)
>                   obsoletenotrebased = _computeobsoletenotrebased(repo,
> diff --git a/tests/test-rebase-obsolete.t b/tests/test-rebase-obsolete.t
> --- a/tests/test-rebase-obsolete.t
> +++ b/tests/test-rebase-obsolete.t
> @@ -527,7 +527,7 @@ Test hidden changesets in the rebase set
>     $ hg commit -m J
>     $ hg debugobsolete `hg log --rev . -T '{node}'`
>
> -  $ hg rebase --rev .~1::. --dest 'max(desc(D))' --traceback
> +  $ hg rebase --rev .~1::. --dest 'max(desc(D))' --traceback --config experimental.rebaseskipobsolete=off
>     rebasing 9:4bde274eefcf "I"
>     rebasing 13:06edfc82198f "J" (tip)
>     $ hg log -G

Cheers

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -297,7 +297,8 @@  def rebase(ui, repo, **opts):
                     hint=_('use --keep to keep original changesets'))
 
             obsoletenotrebased = {}
-            if ui.configbool('experimental', 'rebaseskipobsolete'):
+            if ui.configbool('experimental',
+                             'rebaseskipobsolete', default=True):
                 rebasesetrevs = set(rebaseset)
                 rebaseobsrevs = _filterobsoleterevs(repo, rebasesetrevs)
                 obsoletenotrebased = _computeobsoletenotrebased(repo,
diff --git a/tests/test-rebase-obsolete.t b/tests/test-rebase-obsolete.t
--- a/tests/test-rebase-obsolete.t
+++ b/tests/test-rebase-obsolete.t
@@ -527,7 +527,7 @@  Test hidden changesets in the rebase set
   $ hg commit -m J
   $ hg debugobsolete `hg log --rev . -T '{node}'`
 
-  $ hg rebase --rev .~1::. --dest 'max(desc(D))' --traceback
+  $ hg rebase --rev .~1::. --dest 'max(desc(D))' --traceback --config experimental.rebaseskipobsolete=off
   rebasing 9:4bde274eefcf "I"
   rebasing 13:06edfc82198f "J" (tip)
   $ hg log -G