[PATCH 4 of 8] py3: make hg use absolute_import

Pulkit Goyal 7895pulkit at gmail.com
Thu May 12 17:28:57 EDT 2016


# HG changeset patch
# User Pulkit Goyal <7895pulkit at gmail.com>
# Date 1463087838 -19800
#      Fri May 13 02:47:18 2016 +0530
# Node ID f9c8fddf340fe71b334628d1436d99873a827f07
# Parent  938161f56072615795c91a5d59775185783373ca
py3: make hg use absolute_import

Here hg refers to the file named hg in the toplevel folder.

diff --git a/hg b/hg
--- a/hg
+++ b/hg
@@ -7,6 +7,8 @@
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
+from __future__ import absolute_import
+
 import os
 import sys
 
@@ -34,8 +36,10 @@
     sys.stderr.write("(check your install and PYTHONPATH)\n")
     sys.exit(-1)
 
-import mercurial.util
-import mercurial.dispatch
+from mercurial import (
+    dispatch,
+    util,
+)
 
 for fp in (sys.stdin, sys.stdout, sys.stderr):
     mercurial.util.setbinary(fp)


More information about the Mercurial-devel mailing list