Patchwork [hglib] tests: handle the removal of `obsolete._enabled` in Mercurial

login
register
mail settings
Submitter Matt Harbison
Date May 8, 2019, 2:21 a.m.
Message ID <1febca34c800a64cc2c8.1557282088@Envy>
Download mbox | patch
Permalink /patch/39983/
State Superseded
Headers show

Comments

Matt Harbison - May 8, 2019, 2:21 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1557281819 14400
#      Tue May 07 22:16:59 2019 -0400
# Node ID 1febca34c800a64cc2c886d24920b936674cbd1c
# Parent  33b512aa8dba0cbe523188fbb62d30ae2125a236
tests: handle the removal of `obsolete._enabled` in Mercurial

I'm not sure why we can't just set `experimental.evolution=all`, but it didn't
work.
Yuya Nishihara - May 8, 2019, 11:09 p.m.
On Tue, 07 May 2019 22:21:28 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1557281819 14400
> #      Tue May 07 22:16:59 2019 -0400
> # Node ID 1febca34c800a64cc2c886d24920b936674cbd1c
> # Parent  33b512aa8dba0cbe523188fbb62d30ae2125a236
> tests: handle the removal of `obsolete._enabled` in Mercurial

LGTM.

> I'm not sure why we can't just set `experimental.evolution=all`, but it didn't
> work.

No idea, but I don't think the config knob can be used anyway since the hglib
tests have to support old Mercurial versions.
Augie Fackler - May 20, 2019, 3:42 p.m.
On Tue, May 07, 2019 at 10:21:28PM -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1557281819 14400
> #      Tue May 07 22:16:59 2019 -0400
> # Node ID 1febca34c800a64cc2c886d24920b936674cbd1c
> # Parent  33b512aa8dba0cbe523188fbb62d30ae2125a236
> tests: handle the removal of `obsolete._enabled` in Mercurial
>
> I'm not sure why we can't just set `experimental.evolution=all`, but it didn't
> work.
>
> diff --git a/tests/test-hidden.py b/tests/test-hidden.py
> --- a/tests/test-hidden.py
> +++ b/tests/test-hidden.py
> @@ -22,7 +22,7 @@
>          super(test_obsolete_baselib, self).setUp()
>          self.append('.hg/obs.py',
>                      "import mercurial.obsolete\n"
> -                    "mercurial.obsolete._enabled = True")
> +                    "mercurial.obsolete.isenabled = lambda r, opt: True")
>          self.append('.hg/hgrc','\n[extensions]\nobs=.hg/obs.py')

We generally try to have hglib work across many hg versions - should we do both instead of just one or the other?

>
>  class test_obsolete_client(test_obsolete_baselib):
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Matt Harbison - May 22, 2019, 1:53 a.m.
On Mon, 20 May 2019 11:42:49 -0400, Augie Fackler <raf@durin42.com> wrote:

> On Tue, May 07, 2019 at 10:21:28PM -0400, Matt Harbison wrote:
>> # HG changeset patch
>> # User Matt Harbison <matt_harbison@yahoo.com>
>> # Date 1557281819 14400
>> #      Tue May 07 22:16:59 2019 -0400
>> # Node ID 1febca34c800a64cc2c886d24920b936674cbd1c
>> # Parent  33b512aa8dba0cbe523188fbb62d30ae2125a236
>> tests: handle the removal of `obsolete._enabled` in Mercurial
>>
>> I'm not sure why we can't just set `experimental.evolution=all`, but it  
>> didn't
>> work.
>>
>> diff --git a/tests/test-hidden.py b/tests/test-hidden.py
>> --- a/tests/test-hidden.py
>> +++ b/tests/test-hidden.py
>> @@ -22,7 +22,7 @@
>>          super(test_obsolete_baselib, self).setUp()
>>          self.append('.hg/obs.py',
>>                      "import mercurial.obsolete\n"
>> -                    "mercurial.obsolete._enabled = True")
>> +                    "mercurial.obsolete.isenabled = lambda r, opt:  
>> True")
>>          self.append('.hg/hgrc','\n[extensions]\nobs=.hg/obs.py')
>
> We generally try to have hglib work across many hg versions - should we  
> do both instead of just one or the other?

I sent a V2 that does both.  V1 would support all the way back to 3.2 (Nov  
2014).  I'm not sure how far back we try to go.

Patch

diff --git a/tests/test-hidden.py b/tests/test-hidden.py
--- a/tests/test-hidden.py
+++ b/tests/test-hidden.py
@@ -22,7 +22,7 @@ 
         super(test_obsolete_baselib, self).setUp()
         self.append('.hg/obs.py',
                     "import mercurial.obsolete\n"
-                    "mercurial.obsolete._enabled = True")
+                    "mercurial.obsolete.isenabled = lambda r, opt: True")
         self.append('.hg/hgrc','\n[extensions]\nobs=.hg/obs.py')
 
 class test_obsolete_client(test_obsolete_baselib):