Patchwork [7,of,7] diffutil: move the module out of utils package

login
register
mail settings
Submitter Yuya Nishihara
Date July 6, 2018, 1:03 p.m.
Message ID <0f88a9a4a691f90636c5.1530882232@mimosa>
Download mbox | patch
Permalink /patch/32669/
State New
Headers show

Comments

Yuya Nishihara - July 6, 2018, 1:03 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1530881365 -32400
#      Fri Jul 06 21:49:25 2018 +0900
# Node ID 0f88a9a4a691f90636c55b04fd7e0b842cce8d86
# Parent  c83051a12b0c5d269f00813b89ae9fa1cfd7cce8
diffutil: move the module out of utils package

mercurial.utils modules inherit the property of the mercurial.util, which is
no dependency on ui, repo, ctx, etc. As the diffutil module seems to reside
in the scmutil layer, it's probably better to not put it under the utils
package.
via Mercurial-devel - July 6, 2018, 4:44 p.m.
On Fri, Jul 6, 2018 at 6:04 AM Yuya Nishihara <yuya@tcha.org> wrote:

> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1530881365 -32400
> #      Fri Jul 06 21:49:25 2018 +0900
> # Node ID 0f88a9a4a691f90636c55b04fd7e0b842cce8d86
> # Parent  c83051a12b0c5d269f00813b89ae9fa1cfd7cce8
> diffutil: move the module out of utils package
>

Queuing the series, thanks.

Patch

diff --git a/contrib/synthrepo.py b/contrib/synthrepo.py
--- a/contrib/synthrepo.py
+++ b/contrib/synthrepo.py
@@ -54,6 +54,7 @@  from mercurial.node import (
 )
 from mercurial import (
     context,
+    diffutil,
     error,
     hg,
     patch,
@@ -62,7 +63,6 @@  from mercurial import (
 )
 from mercurial.utils import (
     dateutil,
-    diffutil,
 )
 
 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
diff --git a/mercurial/utils/diffutil.py b/mercurial/diffutil.py
rename from mercurial/utils/diffutil.py
rename to mercurial/diffutil.py
--- a/mercurial/utils/diffutil.py
+++ b/mercurial/diffutil.py
@@ -9,9 +9,9 @@ 
 
 from __future__ import absolute_import
 
-from ..i18n import _
+from .i18n import _
 
-from .. import (
+from . import (
     mdiff,
     pycompat,
 )
diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py
--- a/mercurial/hgweb/webutil.py
+++ b/mercurial/hgweb/webutil.py
@@ -25,6 +25,7 @@  from .common import (
 
 from .. import (
     context,
+    diffutil,
     error,
     match,
     mdiff,
@@ -41,7 +42,6 @@  from .. import (
 )
 
 from ..utils import (
-    diffutil,
     stringutil,
 )
 
diff --git a/mercurial/obsutil.py b/mercurial/obsutil.py
--- a/mercurial/obsutil.py
+++ b/mercurial/obsutil.py
@@ -11,13 +11,13 @@  import re
 
 from .i18n import _
 from . import (
+    diffutil,
     node as nodemod,
     phases,
     util,
 )
 from .utils import (
     dateutil,
-    diffutil,
 )
 
 ### obsolescence marker flag
diff --git a/mercurial/patch.py b/mercurial/patch.py
--- a/mercurial/patch.py
+++ b/mercurial/patch.py
@@ -28,6 +28,7 @@  from .node import (
 from . import (
     copies,
     diffhelper,
+    diffutil,
     encoding,
     error,
     mail,
@@ -41,7 +42,6 @@  from . import (
 )
 from .utils import (
     dateutil,
-    diffutil,
     procutil,
     stringutil,
 )
diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -13,6 +13,7 @@  from .i18n import _
 from . import (
     dagop,
     destutil,
+    diffutil,
     encoding,
     error,
     hbisect,
@@ -33,7 +34,6 @@  from . import (
 )
 from .utils import (
     dateutil,
-    diffutil,
     stringutil,
 )
 
diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py
--- a/mercurial/templatekw.py
+++ b/mercurial/templatekw.py
@@ -14,6 +14,7 @@  from .node import (
 )
 
 from . import (
+    diffutil,
     encoding,
     error,
     hbisect,
@@ -27,7 +28,6 @@  from . import (
     util,
 )
 from .utils import (
-    diffutil,
     stringutil,
 )
 
diff --git a/tests/test-context.py b/tests/test-context.py
--- a/tests/test-context.py
+++ b/tests/test-context.py
@@ -5,12 +5,12 @@  import sys
 from mercurial.node import hex
 from mercurial import (
     context,
+    diffutil,
     encoding,
     hg,
     scmutil,
     ui as uimod,
 )
-from mercurial.utils import diffutil
 
 print_ = print
 def print(*args, **kwargs):