[PATCH 6 of 8] mdiff: use absolute_import

Gregory Szorc gregory.szorc at gmail.com
Tue Dec 22 00:00:41 CST 2015


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1450761974 28800
#      Mon Dec 21 21:26:14 2015 -0800
# Node ID d48fd95558ba134a260efaa190cae48f09dc5825
# Parent  bffeaac6cbadeac32bba50347f9f8ab07de96e38
mdiff: use absolute_import

diff --git a/mercurial/mdiff.py b/mercurial/mdiff.py
--- a/mercurial/mdiff.py
+++ b/mercurial/mdiff.py
@@ -1,18 +1,29 @@
 # mdiff.py - diff and patch routines for mercurial
 #
 # Copyright 2005, 2006 Matt Mackall <mpm at selenic.com>
 #
 # 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 _
-import bdiff, mpatch, util, base85, error
-import re, struct, zlib
+from __future__ import absolute_import
+
+import re
+import struct
+import zlib
+
+from .i18n import _
+from . import (
+    base85,
+    bdiff,
+    error,
+    mpatch,
+    util,
+)
 
 def splitnewlines(text):
     '''like str.splitlines, but only split on newlines.'''
     lines = [l + '\n' for l in text.split('\n')]
     if lines:
         if lines[-1] == '\n':
             lines.pop()
         else:
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
@@ -112,17 +112,16 @@
   mercurial/keepalive.py not using absolute_import
   mercurial/keepalive.py requires print_function
   mercurial/localrepo.py not using absolute_import
   mercurial/lsprof.py requires print_function
   mercurial/lsprofcalltree.py not using absolute_import
   mercurial/lsprofcalltree.py requires print_function
   mercurial/mail.py requires print_function
   mercurial/manifest.py not using absolute_import
-  mercurial/mdiff.py not using absolute_import
   mercurial/patch.py not using absolute_import
   mercurial/pvec.py not using absolute_import
   mercurial/py3kcompat.py not using absolute_import
   setup.py not using absolute_import
   tests/filterpyflakes.py requires print_function
   tests/generate-working-copy-states.py requires print_function
   tests/get-with-headers.py requires print_function
   tests/heredoctest.py requires print_function


More information about the Mercurial-devel mailing list