Mercurial > hg-stable
changeset 7875:553aa0cbeab6
cleanup: drop unused assignments
author | Peter Arrenbrecht <peter.arrenbrecht@gmail.com> |
---|---|
date | Mon, 23 Mar 2009 13:13:06 +0100 |
parents | d812029cda85 |
children | 53c72ba36c2b |
files | hgext/convert/filemap.py hgext/convert/git.py hgext/convert/gnuarch.py hgext/convert/hg.py hgext/convert/subversion.py hgext/graphlog.py hgext/inotify/linux/__init__.py hgext/rebase.py mercurial/commands.py mercurial/hgweb/webcommands.py mercurial/keepalive.py mercurial/localrepo.py mercurial/lsprof.py mercurial/sshserver.py mercurial/util.py |
diffstat | 15 files changed, 14 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/convert/filemap.py Mon Mar 23 13:13:02 2009 +0100 +++ b/hgext/convert/filemap.py Mon Mar 23 13:13:06 2009 +0100 @@ -69,7 +69,7 @@ for pre, suf in rpairs(name): try: return mapping[pre], pre, suf - except KeyError, err: + except KeyError: pass return '', name, ''
--- a/hgext/convert/git.py Mon Mar 23 13:13:02 2009 +0100 +++ b/hgext/convert/git.py Mon Mar 23 13:13:06 2009 +0100 @@ -84,7 +84,6 @@ message = c[end+2:] message = self.recode(message) l = c[:end].splitlines() - manifest = l[0].split()[1] parents = [] for e in l[1:]: n, v = e.split(" ", 1)
--- a/hgext/convert/gnuarch.py Mon Mar 23 13:13:02 2009 +0100 +++ b/hgext/convert/gnuarch.py Mon Mar 23 13:13:06 2009 +0100 @@ -279,7 +279,7 @@ # Commit revision origin when dealing with a branch or tag if catlog.has_key('Continuation-of'): self.changes[rev].continuationof = self.recode(catlog['Continuation-of']) - except Exception, err: + except Exception: raise util.Abort(_('could not parse cat-log of %s') % rev) def _parsechangeset(self, data, rev):
--- a/hgext/convert/hg.py Mon Mar 23 13:13:02 2009 +0100 +++ b/hgext/convert/hg.py Mon Mar 23 13:13:06 2009 +0100 @@ -42,7 +42,7 @@ if not self.repo.local(): raise NoRepo(_('%s is not a local Mercurial repo') % path) self.created.append(path) - except error.RepoError, err: + except error.RepoError: ui.print_exc() raise NoRepo("could not create hg repo %s as sink" % path) self.lock = None @@ -158,7 +158,7 @@ try: parentctx = self.repo[self.tagsbranch] tagparent = parentctx.node() - except error.RepoError, inst: + except error.RepoError: parentctx = None tagparent = nullid
--- a/hgext/convert/subversion.py Mon Mar 23 13:13:02 2009 +0100 +++ b/hgext/convert/subversion.py Mon Mar 23 13:13:06 2009 +0100 @@ -194,7 +194,7 @@ self.commits = {} self.paths = {} self.uuid = svn.ra.get_uuid(self.ra).decode(self.encoding) - except SubversionException, e: + except SubversionException: ui.print_exc() raise NoRepo("%s does not look like a Subversion repo" % self.url) @@ -215,7 +215,7 @@ try: self.get_blacklist() - except IOError, e: + except IOError: pass self.head = self.latest(self.module, latest) @@ -246,7 +246,7 @@ svn.client.ls(self.url.rstrip('/') + '/' + urllib.quote(path), optrev, False, self.ctx) return True - except SubversionException, err: + except SubversionException: return False def getheads(self): @@ -438,7 +438,7 @@ pendings = remainings tagspath = srctagspath - except SubversionException, (inst, num): + except SubversionException: self.ui.note(_('no tags found at revision %d\n') % start) return tags @@ -533,7 +533,7 @@ try: svn_rev = int(line.strip()) blacklist.add(svn_rev) - except ValueError, e: + except ValueError: pass # not an integer or a comment def is_blacklisted(self, svn_rev): @@ -1103,7 +1103,7 @@ for f, v in files: try: data = source.getfile(f, v) - except IOError, inst: + except IOError: self.delete.append(f) else: e = source.getmode(f, v)
--- a/hgext/graphlog.py Mon Mar 23 13:13:02 2009 +0100 +++ b/hgext/graphlog.py Mon Mar 23 13:13:06 2009 +0100 @@ -384,8 +384,6 @@ chlist = other.changelog.nodesbetween(incoming, revs)[0] revdag = graphrevs(other, chlist, opts) - other_parents = [] - displayer = show_changeset(ui, other, opts, buffered=True) graphdag = graphabledag(ui, repo, revdag, opts) ascii(ui, grapher(graphdag))
--- a/hgext/inotify/linux/__init__.py Mon Mar 23 13:13:02 2009 +0100 +++ b/hgext/inotify/linux/__init__.py Mon Mar 23 13:13:06 2009 +0100 @@ -27,7 +27,7 @@ def read_value(): try: return int(open(procfs_path + '/' + name).read()) - except OSError, err: + except OSError: return None read_value.__doc__ = '''Return the value of the %s setting from /proc.
--- a/hgext/rebase.py Mon Mar 23 13:13:02 2009 +0100 +++ b/hgext/rebase.py Mon Mar 23 13:13:06 2009 +0100 @@ -337,7 +337,6 @@ def buildstate(repo, dest, src, base, collapse): 'Define which revisions are going to be rebased and where' - state = {} targetancestors = util.set() if not dest:
--- a/mercurial/commands.py Mon Mar 23 13:13:02 2009 +0100 +++ b/mercurial/commands.py Mon Mar 23 13:13:06 2009 +0100 @@ -2435,7 +2435,6 @@ wlock = repo.wlock() try: # walk dirstate. - files = [] m = cmdutil.match(repo, pats, opts) m.bad = lambda x,y: False
--- a/mercurial/hgweb/webcommands.py Mon Mar 23 13:13:02 2009 +0100 +++ b/mercurial/hgweb/webcommands.py Mon Mar 23 13:13:06 2009 +0100 @@ -172,7 +172,6 @@ return _search(web, tmpl, hi) # XXX redirect to 404 page? def changelist(limit=0, **map): - cl = web.repo.changelog l = [] # build a list in forward order for efficiency for i in xrange(start, end): ctx = web.repo[i]
--- a/mercurial/keepalive.py Mon Mar 23 13:13:02 2009 +0100 +++ b/mercurial/keepalive.py Mon Mar 23 13:13:06 2009 +0100 @@ -447,7 +447,6 @@ return value def readline(self, limit=-1): - data = "" i = self._rbuf.find('\n') while i < 0 and not (0 < limit <= len(self._rbuf)): new = self._raw_read(self._rbufsize) @@ -616,7 +615,7 @@ def test(url, N=10): print "checking error hander (do this on a non-200)" try: error_handler(url) - except IOError, e: + except IOError: print "exiting - exception will prevent further tests" sys.exit() print
--- a/mercurial/localrepo.py Mon Mar 23 13:13:02 2009 +0100 +++ b/mercurial/localrepo.py Mon Mar 23 13:13:06 2009 +0100 @@ -160,7 +160,7 @@ if local: try: fp = self.opener('localtags', 'r+') - except IOError, err: + except IOError: fp = self.opener('localtags', 'a') else: prevtags = fp.read() @@ -174,7 +174,7 @@ if use_dirstate: try: fp = self.wfile('.hgtags', 'rb+') - except IOError, err: + except IOError: fp = self.wfile('.hgtags', 'ab') else: prevtags = fp.read()
--- a/mercurial/lsprof.py Mon Mar 23 13:13:02 2009 +0100 +++ b/mercurial/lsprof.py Mon Mar 23 13:13:06 2009 +0100 @@ -42,7 +42,6 @@ d = d[:top] cols = "% 12s %12s %11.4f %11.4f %s\n" hcols = "% 12s %12s %12s %12s %s\n" - cols2 = "+%12s %12s %11.4f %11.4f + %s\n" file.write(hcols % ("CallCount", "Recursive", "Total(ms)", "Inline(ms)", "module:lineno(function)")) count = 0
--- a/mercurial/sshserver.py Mon Mar 23 13:13:02 2009 +0100 +++ b/mercurial/sshserver.py Mon Mar 23 13:13:06 2009 +0100 @@ -122,8 +122,6 @@ self.fout.flush() def do_changegroupsubset(self): - bases = [] - heads = [] argmap = dict([self.getarg(), self.getarg()]) bases = [bin(n) for n in argmap['bases'].split(' ')] heads = [bin(n) for n in argmap['heads'].split(' ')]
--- a/mercurial/util.py Mon Mar 23 13:13:02 2009 +0100 +++ b/mercurial/util.py Mon Mar 23 13:13:06 2009 +0100 @@ -904,7 +904,6 @@ def _statfiles_clustered(files): '''Stat each file in files and yield stat or None if file does not exist. Cluster and cache stat per directory to minimize number of OS stat calls.''' - lstat = os.lstat ncase = os.path.normcase sep = os.sep dircache = {} # dirname -> filename -> status | None if file does not exist