[PATCH] remove unused imports and variables
Alexander Solovyov
alexander at solovyov.net
Sat Apr 30 07:42:39 CDT 2011
# HG changeset patch
# User Alexander Solovyov <alexander at solovyov.net>
# Date 1304164754 -7200
# Node ID a15342384361951bc3a067ab64488bee50eb483d
# Parent 4d4e0f3c7e024610c4755d73e1404bb61901cbb1
remove unused imports and variables
diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -6,7 +6,7 @@
# GNU General Public License version 2 or any later version.
from mercurial.i18n import _
-from mercurial.node import nullid, nullrev, bin, hex, short
+from mercurial.node import hex
from mercurial import encoding, error, util
import errno, os
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -8,7 +8,7 @@
from node import hex, nullid, nullrev, short
from i18n import _
import os, sys, errno, re, glob, tempfile
-import util, scmutil, templater, patch, error, encoding, templatekw
+import util, scmutil, templater, patch, error, templatekw
import match as matchmod
import similar, revset, subrepo
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -10,7 +10,7 @@ from lock import release
from i18n import _, gettext
import os, re, sys, difflib, time, tempfile
import hg, scmutil, util, revlog, extensions, copies, error, bookmarks
-import patch, help, mdiff, url, encoding, templatekw, discovery
+import patch, help, url, encoding, templatekw, discovery
import archival, changegroup, cmdutil, sshserver, hbisect, hgweb, hgweb.server
import merge as mergemod
import minirst, revset, templatefilters
diff --git a/mercurial/graphmod.py b/mercurial/graphmod.py
--- a/mercurial/graphmod.py
+++ b/mercurial/graphmod.py
@@ -18,7 +18,6 @@ Data depends on type.
"""
from mercurial.node import nullrev
-from mercurial.cmdutil import revrange
CHANGESET = 'C'
diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -8,9 +8,9 @@
from i18n import _
from lock import release
-from node import hex, nullid, nullrev, short
+from node import hex, nullid
import localrepo, bundlerepo, httprepo, sshrepo, statichttprepo, bookmarks
-import lock, util, extensions, error, encoding, node
+import lock, util, extensions, error, node
import cmdutil, discovery, url
import merge as mergemod
import verify as verifymod
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -190,7 +190,7 @@ class localrepository(repo.repository):
warned = [0]
def validate(node):
try:
- r = self.changelog.rev(node)
+ self.changelog.rev(node)
return node
except error.LookupError:
if not warned[0]:
diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -271,7 +271,6 @@ def applyupdates(repo, action, wctx, mct
ms.reset(wctx.p1().node())
moves = []
action.sort(key=actionkey)
- substate = wctx.substate # prime
# prescan for merges
u = repo.ui
diff --git a/mercurial/pure/parsers.py b/mercurial/pure/parsers.py
--- a/mercurial/pure/parsers.py
+++ b/mercurial/pure/parsers.py
@@ -5,7 +5,7 @@
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
-from mercurial.node import bin, nullid, nullrev
+from mercurial.node import bin, nullid
from mercurial import util
import struct, zlib
diff --git a/mercurial/repair.py b/mercurial/repair.py
--- a/mercurial/repair.py
+++ b/mercurial/repair.py
@@ -6,9 +6,9 @@
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
-import changegroup, bookmarks
-from node import nullrev, short
-from i18n import _
+from mercurial import changegroup, bookmarks
+from mercurial.node import short
+from mercurial.i18n import _
import os
def _bundle(repo, bases, heads, node, suffix, compress=True):
diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -14,7 +14,7 @@ and O(changes) merge between branches.
# import stuff from node for others to import from revlog
from node import bin, hex, nullid, nullrev, short #@UnusedImport
from i18n import _
-import changegroup, ancestor, mdiff, parsers, error, util
+import ancestor, mdiff, parsers, error, util
import struct, zlib, errno
_pack = struct.pack
@@ -288,7 +288,7 @@ class revlog(object):
@util.propertycache
def nodemap(self):
- n = self.rev(self.node(0))
+ self.rev(self.node(0))
return self._nodecache
def rev(self, node):
diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -223,7 +223,7 @@ def bisected(repo, subset, x):
"""
state = getstring(x, _("bisect requires a string")).lower()
if state not in ('good', 'bad', 'skip', 'unknown'):
- raise ParseError(_('invalid bisect state'))
+ raise error.ParseError(_('invalid bisect state'))
marked = set(repo.changelog.rev(n) for n in hbisect.load_state(repo)[state])
return [r for r in subset if r in marked]
diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py
--- a/mercurial/templatekw.py
+++ b/mercurial/templatekw.py
@@ -6,7 +6,7 @@
# GNU General Public License version 2 or any later version.
from node import hex
-import encoding, patch, util, error, help
+import patch, util, error, help
def showlist(name, values, plural=None, **args):
'''expand set of values.
diff --git a/mercurial/url.py b/mercurial/url.py
--- a/mercurial/url.py
+++ b/mercurial/url.py
@@ -781,7 +781,7 @@ if has_https:
host = self.host
if self.realhostport: # use CONNECT proxy
- something = _generic_proxytunnel(self)
+ _generic_proxytunnel(self)
host = self.realhostport.rsplit(':', 1)[0]
cacerts = self.ui.config('web', 'cacerts')
diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -933,7 +933,6 @@ def parsedate(date, formats=None, bias={
# fill out defaults
now = makedate()
defaults = {}
- nowmap = {}
for part in ("d", "mb", "yY", "HI", "M", "S"):
# this piece is for rounding the specific end of unknowns
b = bias.get(part)
diff --git a/mercurial/windows.py b/mercurial/windows.py
--- a/mercurial/windows.py
+++ b/mercurial/windows.py
@@ -6,8 +6,8 @@
# GNU General Public License version 2 or any later version.
from i18n import _
-import osutil, error
-import errno, msvcrt, os, re, sys, subprocess
+import osutil
+import errno, msvcrt, os, re, sys
nulldev = 'NUL:'
umask = 002
diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -296,7 +296,7 @@ def pushkey(repo, proto, namespace, key,
if len(new) == 20 and new.encode('string-escape') != new:
# looks like it could be a binary node
try:
- u = new.decode('utf-8')
+ new.decode('utf-8')
new = encoding.tolocal(new) # but cleanly decodes as UTF-8
except UnicodeDecodeError:
pass # binary, leave unmodified
More information about the Mercurial-devel
mailing list