Patchwork [1,of,2] commandserver: use absolute_import

login
register
mail settings
Submitter Yuya Nishihara
Date Dec. 13, 2015, 2:49 p.m.
Message ID <d5bbc726e29209932689.1450018142@mimosa>
Download mbox | patch
Permalink /patch/12011/
State Accepted
Headers show

Comments

Yuya Nishihara - Dec. 13, 2015, 2:49 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1448373520 -32400
#      Tue Nov 24 22:58:40 2015 +0900
# Node ID d5bbc726e292099326891eedd2e5d1c309d84b8f
# Parent  1c78ada22f9dc6ede81f2c231cec65d5d77dc45d
commandserver: use absolute_import
Gregory Szorc - Dec. 13, 2015, 3:19 p.m.
> On Dec 13, 2015, at 06:49, Yuya Nishihara <yuya@tcha.org> wrote:
> 
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1448373520 -32400
> #      Tue Nov 24 22:58:40 2015 +0900
> # Node ID d5bbc726e292099326891eedd2e5d1c309d84b8f
> # Parent  1c78ada22f9dc6ede81f2c231cec65d5d77dc45d
> commandserver: use absolute_import
> 

Series LGTM and I'd queue it if I could.

> diff --git a/mercurial/commandserver.py b/mercurial/commandserver.py
> --- a/mercurial/commandserver.py
> +++ b/mercurial/commandserver.py
> @@ -5,10 +5,22 @@
> # This software may be used and distributed according to the terms of the
> # GNU General Public License version 2 or any later version.
> 
> -from i18n import _
> +from __future__ import absolute_import
> +
> +import SocketServer
> +import errno
> +import os
> import struct
> -import sys, os, errno, traceback, SocketServer
> -import dispatch, encoding, util, error
> +import sys
> +import traceback
> +
> +from .i18n import _
> +from . import (
> +    dispatch,
> +    encoding,
> +    error,
> +    util,
> +)
> 
> logfile = None
> 
> diff --git a/tests/test-check-py3-compat.t b/tests/test-check-py3-compat.t
> --- a/tests/test-check-py3-compat.t
> +++ b/tests/test-check-py3-compat.t
> @@ -101,7 +101,6 @@
>   mercurial/byterange.py not using absolute_import
>   mercurial/cmdutil.py not using absolute_import
>   mercurial/commands.py not using absolute_import
> -  mercurial/commandserver.py not using absolute_import
>   mercurial/context.py not using absolute_import
>   mercurial/dirstate.py not using absolute_import
>   mercurial/dispatch.py requires print_function
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/commandserver.py b/mercurial/commandserver.py
--- a/mercurial/commandserver.py
+++ b/mercurial/commandserver.py
@@ -5,10 +5,22 @@ 
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
-from i18n import _
+from __future__ import absolute_import
+
+import SocketServer
+import errno
+import os
 import struct
-import sys, os, errno, traceback, SocketServer
-import dispatch, encoding, util, error
+import sys
+import traceback
+
+from .i18n import _
+from . import (
+    dispatch,
+    encoding,
+    error,
+    util,
+)
 
 logfile = None
 
diff --git a/tests/test-check-py3-compat.t b/tests/test-check-py3-compat.t
--- a/tests/test-check-py3-compat.t
+++ b/tests/test-check-py3-compat.t
@@ -101,7 +101,6 @@ 
   mercurial/byterange.py not using absolute_import
   mercurial/cmdutil.py not using absolute_import
   mercurial/commands.py not using absolute_import
-  mercurial/commandserver.py not using absolute_import
   mercurial/context.py not using absolute_import
   mercurial/dirstate.py not using absolute_import
   mercurial/dispatch.py requires print_function