Patchwork [7,of,7] py3: use absolute_import in hgk.py

login
register
mail settings
Submitter roby roby
Date April 17, 2016, 5:17 p.m.
Message ID <ab63599d55a290f5bdfd.1460913426@roby>
Download mbox | patch
Permalink /patch/14712/
State Deferred
Headers show

Comments

roby roby - April 17, 2016, 5:17 p.m.
# HG changeset patch
# User Robert Stanca <robert.stanca7@gmail.com>
# Date 1460912371 -10800
#      Sun Apr 17 19:59:31 2016 +0300
# Node ID ab63599d55a290f5bdfdbc28d1b4c1b5b9c33ad0
# Parent  c6c5a02fe55672055d74551a0a00730ada9f871a
py3: use absolute_import in hgk.py
Sean Farley - April 17, 2016, 5:30 p.m.
Robert Stanca <robert.stanca7@gmail.com> writes:

> # HG changeset patch
> # User Robert Stanca <robert.stanca7@gmail.com>
> # Date 1460912371 -10800
> #      Sun Apr 17 19:59:31 2016 +0300
> # Node ID ab63599d55a290f5bdfdbc28d1b4c1b5b9c33ad0
> # Parent  c6c5a02fe55672055d74551a0a00730ada9f871a
> py3: use absolute_import in hgk.py

FYI, the code freeze for 3.8 has already started:

https://www.mercurial-scm.org/wiki/TimeBasedReleasePlan#Code_Freeze

There's a Google calendar link with the dates as well on that wiki page.

>
> diff -r c6c5a02fe556 -r ab63599d55a2 hgext/hgk.py
> --- a/hgext/hgk.py	Sun Apr 17 19:58:42 2016 +0300
> +++ b/hgext/hgk.py	Sun Apr 17 19:59:31 2016 +0300
> @@ -34,10 +34,22 @@
>  vdiff on hovered and selected revisions.
>  '''
>  
> +from __future__ import absolute_import
>  import os
> -from mercurial import cmdutil, commands, patch, scmutil, obsolete
> -from mercurial.node import nullid, nullrev, short
> -from mercurial.i18n import _
> +from mercurial.i18n import (
> +    _,
> +)
> +from mercurial import (
> +    cmdutil,
> +    commands,
> +    node,
> +    obsolete,
> +    patch,
> +    scmutil,
> +)
> +nullid = node.nullid
> +nullrev = node.nullrev
> +short = node.short
>  
>  cmdtable = {}
>  command = cmdutil.command(cmdtable)
> diff -r c6c5a02fe556 -r ab63599d55a2 tests/test-check-py3-compat.t
> --- a/tests/test-check-py3-compat.t	Sun Apr 17 19:58:42 2016 +0300
> +++ b/tests/test-check-py3-compat.t	Sun Apr 17 19:59:31 2016 +0300
> @@ -16,7 +16,6 @@
>    hgext/fsmonitor/pywatchman/capabilities.py not using absolute_import
>    hgext/fsmonitor/pywatchman/pybser.py not using absolute_import
>    hgext/hgcia.py not using absolute_import
> -  hgext/hgk.py not using absolute_import
>    hgext/highlight/__init__.py not using absolute_import
>    hgext/highlight/highlight.py not using absolute_import
>    hgext/largefiles/__init__.py not using absolute_import
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Sean Farley - April 17, 2016, 6:15 p.m.
Pulkit Goyal <7895pulkit@gmail.com> writes:

> Still you can send bug fixes, template fixes etc. You can read more
> about the time based released plan at
> https://www.mercurial-scm.org/wiki/TimeBasedReleasePlan

Yes ... that's the same link I sent. Maybe I was too subtle but I was
questioning whether python 3 patches are worth putting on stable. I'll
let mpm and others decide though.
Pierre-Yves David - April 17, 2016, 7:42 p.m.
As Sean and Pulkit pointed, Python 3 patches as not suitable for the 
stable branch, please delay them until after the freeze (when the 
release is made on may first).

We never had Python 3 compatibility so these patches do not fixes 
anything that used to work in 3.7. Moreover they does a lot of churn in 
the code and would make it harder to follow more critical fixes on the 
stable branches.

We are looking forward to see this patch again in may.

Cheers

On 04/17/2016 11:37 AM, Pulkit Goyal wrote:
> All work related to new features were not allowed, so I thought py3
> compatibility is a new feature. If you change of plan do let us know.
> :-)
>
> On Sun, Apr 17, 2016 at 11:45 PM, Sean Farley <sean@farley.io> wrote:
>> Pulkit Goyal <7895pulkit@gmail.com> writes:
>>
>>> Still you can send bug fixes, template fixes etc. You can read more
>>> about the time based released plan at
>>> https://www.mercurial-scm.org/wiki/TimeBasedReleasePlan
>> Yes ... that's the same link I sent. Maybe I was too subtle but I was
>> questioning whether python 3 patches are worth putting on stable. I'll
>> let mpm and others decide though.
Sean Farley - April 17, 2016, 7:55 p.m.
Pulkit Goyal <7895pulkit@gmail.com> writes:

> All work related to new features were not allowed, so I thought py3
> compatibility is a new feature. If you change of plan do let us know.
> :-)

Sorry, I misunderstood your first message. You and I are on the same
page :-)

Patch

diff -r c6c5a02fe556 -r ab63599d55a2 hgext/hgk.py
--- a/hgext/hgk.py	Sun Apr 17 19:58:42 2016 +0300
+++ b/hgext/hgk.py	Sun Apr 17 19:59:31 2016 +0300
@@ -34,10 +34,22 @@ 
 vdiff on hovered and selected revisions.
 '''
 
+from __future__ import absolute_import
 import os
-from mercurial import cmdutil, commands, patch, scmutil, obsolete
-from mercurial.node import nullid, nullrev, short
-from mercurial.i18n import _
+from mercurial.i18n import (
+    _,
+)
+from mercurial import (
+    cmdutil,
+    commands,
+    node,
+    obsolete,
+    patch,
+    scmutil,
+)
+nullid = node.nullid
+nullrev = node.nullrev
+short = node.short
 
 cmdtable = {}
 command = cmdutil.command(cmdtable)
diff -r c6c5a02fe556 -r ab63599d55a2 tests/test-check-py3-compat.t
--- a/tests/test-check-py3-compat.t	Sun Apr 17 19:58:42 2016 +0300
+++ b/tests/test-check-py3-compat.t	Sun Apr 17 19:59:31 2016 +0300
@@ -16,7 +16,6 @@ 
   hgext/fsmonitor/pywatchman/capabilities.py not using absolute_import
   hgext/fsmonitor/pywatchman/pybser.py not using absolute_import
   hgext/hgcia.py not using absolute_import
-  hgext/hgk.py not using absolute_import
   hgext/highlight/__init__.py not using absolute_import
   hgext/highlight/highlight.py not using absolute_import
   hgext/largefiles/__init__.py not using absolute_import