[PATCH 2 of 4 v2] contrib: python-hook-examples use absolute_import

Pulkit Goyal 7895pulkit at gmail.com
Tue Mar 15 19:06:01 EDT 2016


# HG changeset patch
# User Pulkit Goyal <7895pulkit at gmail.com>
# Date 1458081808 -19800
#      Wed Mar 16 04:13:28 2016 +0530
# Node ID 34d93ab80468a14a249282d30d2799862b0c83ff
# Parent  2600ae6643f5071b106c61a72d8dd88e964424eb
contrib: python-hook-examples use absolute_import

diff --git a/contrib/python-hook-examples.py b/contrib/python-hook-examples.py
--- a/contrib/python-hook-examples.py
+++ b/contrib/python-hook-examples.py
@@ -1,7 +1,11 @@
 '''
 Examples of useful python hooks for Mercurial.
 '''
-from mercurial import patch, util
+from __future__ import absolute_import
+from mercurial import (
+    patch,
+    util,
+)
 
 def diffstat(ui, repo, **kwargs):
     '''Example usage:
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
@@ -5,7 +5,6 @@
   $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs python contrib/check-py3-compat.py
   contrib/import-checker.py not using absolute_import
   contrib/import-checker.py requires print_function
-  contrib/python-hook-examples.py not using absolute_import
   contrib/revsetbenchmarks.py not using absolute_import
   contrib/revsetbenchmarks.py requires print_function
   contrib/synthrepo.py not using absolute_import


More information about the Mercurial-devel mailing list