[PATCH 1 of 3] patchbomb: use absolute_import

timeless timeless at mozdev.org
Tue Mar 8 23:26:00 EST 2016


# HG changeset patch
# User timeless <timeless at mozdev.org>
# Date 1456954962 0
#      Wed Mar 02 21:42:42 2016 +0000
# Node ID 13fb6f97cc034e5344d14292597add2170861d03
# Parent  1c658391b22fb4d98ccfb60c0e57315b55634117
patchbomb: use absolute_import

diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py
--- a/hgext/patchbomb.py
+++ b/hgext/patchbomb.py
@@ -63,14 +63,27 @@
 You can set patchbomb to always ask for confirmation by setting
 ``patchbomb.confirm`` to true.
 '''
+from __future__ import absolute_import
 
-import os, errno, socket, tempfile, cStringIO
+import cStringIO
 import email as emailmod
+import errno
+import os
+import socket
+import tempfile
 
-from mercurial import cmdutil, commands, hg, mail, patch, util, error
-from mercurial import scmutil
+from mercurial import (
+    cmdutil,
+    commands,
+    error,
+    hg,
+    mail,
+    node as nodemod,
+    patch,
+    scmutil,
+    util,
+)
 from mercurial.i18n import _
-from mercurial.node import bin
 
 cmdtable = {}
 command = cmdutil.command(cmdtable)
@@ -167,7 +180,7 @@
             msg.attach(mail.mimeencode(ui, body, _charsets, opts.get('test')))
         p = mail.mimetextpatch('\n'.join(patchlines), 'x-patch',
                                opts.get('test'))
-        binnode = bin(node)
+        binnode = nodemod.bin(node)
         # if node is mq patch, it will have the patch file's name as a tag
         if not patchname:
             patchtags = [t for t in repo.nodetags(binnode)
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
@@ -55,7 +55,6 @@
   hgext/largefiles/wirestore.py not using absolute_import
   hgext/mq.py not using absolute_import
   hgext/notify.py not using absolute_import
-  hgext/patchbomb.py not using absolute_import
   hgext/rebase.py not using absolute_import
   hgext/share.py not using absolute_import
   hgext/transplant.py not using absolute_import


More information about the Mercurial-devel mailing list