Patchwork [4,of,5] localrepo: use absolute_import

login
register
mail settings
Submitter Gregory Szorc
Date Dec. 23, 2015, 8:46 p.m.
Message ID <68143ddd76a2ae848aba.1450903606@7.1.168.192.in-addr.arpa>
Download mbox | patch
Permalink /patch/12317/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

Gregory Szorc - Dec. 23, 2015, 8:46 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1450902614 28800
#      Wed Dec 23 12:30:14 2015 -0800
# Node ID 68143ddd76a2ae848aba52b59cc8514c5094342f
# Parent  99f6ec7e804f0b637bae81a7228b4d8a88ae6eac
localrepo: use absolute_import

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -3,23 +3,62 @@ 
 # Copyright 2005-2007 Matt Mackall <mpm@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 node import hex, nullid, wdirrev, short
-from i18n import _
+
+from __future__ import absolute_import
+
+import errno
+import inspect
+import os
+import random
+import time
 import urllib
-import peer, changegroup, subrepo, pushkey, obsolete, repoview
-import changelog, dirstate, filelog, manifest, context, bookmarks, phases
-import lock as lockmod
-import transaction, store, encoding, exchange, bundle2
-import scmutil, util, extensions, hook, error, revset, cmdutil
-import match as matchmod
-import merge as mergemod
-import tags as tagsmod
-from lock import release
-import weakref, errno, os, time, inspect, random
-import branchmap, pathutil
-import namespaces
+import weakref
+
+from .i18n import _
+from .node import (
+    hex,
+    nullid,
+    short,
+    wdirrev,
+)
+from . import (
+    bookmarks,
+    branchmap,
+    bundle2,
+    changegroup,
+    changelog,
+    cmdutil,
+    context,
+    dirstate,
+    encoding,
+    error,
+    exchange,
+    extensions,
+    filelog,
+    hook,
+    lock as lockmod,
+    manifest,
+    match as matchmod,
+    merge as mergemod,
+    namespaces,
+    obsolete,
+    pathutil,
+    peer,
+    phases,
+    pushkey,
+    repoview,
+    revset,
+    scmutil,
+    store,
+    subrepo,
+    tags as tagsmod,
+    transaction,
+    util,
+)
+
+release = lockmod.release
 propertycache = util.propertycache
 filecache = scmutil.filecache
 
 class repofilecache(filecache):
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
@@ -102,9 +102,8 @@ 
   mercurial/commands.py not using absolute_import
   mercurial/dispatch.py requires print_function
   mercurial/exchange.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 requires print_function
   mercurial/mail.py requires print_function
   setup.py not using absolute_import