changeset 7874:d812029cda85

cleanup: drop variables for unused return values They are unnecessary. I did leave them in localrepo.py where there is something like: _junk = foo() _junk = None to free memory early. I don't know if just `foo()` will free the return value as early.
author Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
date Mon, 23 Mar 2009 13:13:02 +0100
parents 4a4c7f6a5912
children 553aa0cbeab6
files hgext/convert/cvs.py hgext/convert/hg.py hgext/convert/subversion.py hgext/mq.py hgext/patchbomb.py hgext/transplant.py hgext/zeroconf/Zeroconf.py hgext/zeroconf/__init__.py mercurial/commands.py mercurial/context.py mercurial/keepalive.py mercurial/revlog.py mercurial/verify.py
diffstat 13 files changed, 27 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/cvs.py	Mon Mar 23 13:12:07 2009 +0100
+++ b/hgext/convert/cvs.py	Mon Mar 23 13:13:02 2009 +0100
@@ -327,7 +327,7 @@
                 elif line.startswith("E "):
                     self.ui.warn(_("cvs server: %s\n") % line[2:])
                 elif line.startswith("Remove"):
-                    l = self.readp.readline()
+                    self.readp.readline()
                 else:
                     raise util.Abort(_("unknown CVS response: %s") % line)
 
--- a/hgext/convert/hg.py	Mon Mar 23 13:12:07 2009 +0100
+++ b/hgext/convert/hg.py	Mon Mar 23 13:13:02 2009 +0100
@@ -142,7 +142,7 @@
             p2 = parents.pop(0)
             ctx = context.memctx(self.repo, (p1, p2), text, files.keys(), getfilectx,
                                  commit.author, commit.date, extra)
-            a = self.repo.commitctx(ctx)
+            self.repo.commitctx(ctx)
             text = "(octopus merge fixup)\n"
             p2 = hex(self.repo.changelog.tip())
 
--- a/hgext/convert/subversion.py	Mon Mar 23 13:12:07 2009 +0100
+++ b/hgext/convert/subversion.py	Mon Mar 23 13:13:02 2009 +0100
@@ -177,7 +177,7 @@
             if at >= 0:
                 latest = int(url[at+1:])
                 url = url[:at]
-        except ValueError, e:
+        except ValueError:
             pass
         self.url = geturl(url)
         self.encoding = 'UTF-8' # Subversion is always nominal UTF-8
--- a/hgext/mq.py	Mon Mar 23 13:12:07 2009 +0100
+++ b/hgext/mq.py	Mon Mar 23 13:13:02 2009 +0100
@@ -1742,7 +1742,7 @@
     else:
         patchespath = patchdir(sr)
     try:
-        pr = hg.repository(ui, patchespath)
+        hg.repository(ui, patchespath)
     except error.RepoError:
         raise util.Abort(_('versioned patch repository not found'
                            ' (see qinit -c)'))
@@ -1768,9 +1768,9 @@
                       update=False,
                       stream=opts['uncompressed'])
     ui.note(_('cloning patch repo\n'))
-    spr, dpr = hg.clone(ui, opts['patches'] or patchdir(sr), patchdir(dr),
-                        pull=opts['pull'], update=not opts['noupdate'],
-                        stream=opts['uncompressed'])
+    hg.clone(ui, opts['patches'] or patchdir(sr), patchdir(dr),
+             pull=opts['pull'], update=not opts['noupdate'],
+             stream=opts['uncompressed'])
     if dr.local():
         if qbase:
             ui.note(_('stripping applied patches from destination repo\n'))
--- a/hgext/patchbomb.py	Mon Mar 23 13:12:07 2009 +0100
+++ b/hgext/patchbomb.py	Mon Mar 23 13:13:02 2009 +0100
@@ -230,8 +230,8 @@
     def getpatches(revs):
         for r in cmdutil.revrange(repo, revs):
             output = cStringIO.StringIO()
-            p = patch.export(repo, [r], fp=output,
-                             opts=patch.diffopts(ui, opts))
+            patch.export(repo, [r], fp=output,
+                         opts=patch.diffopts(ui, opts))
             yield output.getvalue().split('\n')
 
     def getbundle(dest):
--- a/hgext/transplant.py	Mon Mar 23 13:12:07 2009 +0100
+++ b/hgext/transplant.py	Mon Mar 23 13:13:02 2009 +0100
@@ -216,8 +216,8 @@
             try:
                 files = {}
                 try:
-                    fuzz = patch.patch(patchfile, self.ui, cwd=repo.root,
-                                       files=files)
+                    patch.patch(patchfile, self.ui, cwd=repo.root,
+                                files=files)
                     if not files:
                         self.ui.warn(_('%s: empty changeset')
                                      % revlog.hex(node))
--- a/hgext/zeroconf/Zeroconf.py	Mon Mar 23 13:12:07 2009 +0100
+++ b/hgext/zeroconf/Zeroconf.py	Mon Mar 23 13:13:02 2009 +0100
@@ -866,7 +866,6 @@
 					pass
 
 	def getReaders(self):
-		result = []
 		self.condition.acquire()
 		result = self.readers.keys()
 		self.condition.release()
@@ -1486,14 +1485,14 @@
 			out = DNSOutgoing(_FLAGS_QR_RESPONSE | _FLAGS_AA, 0)
 			for question in msg.questions:
 				out.addQuestion(question)
-		
+
 		for question in msg.questions:
 			if question.type == _TYPE_PTR:
 				if question.name == "_services._dns-sd._udp.local.":
 					for stype in self.servicetypes.keys():
 						if out is None:
 							out = DNSOutgoing(_FLAGS_QR_RESPONSE | _FLAGS_AA)
-						out.addAnswer(msg, DNSPointer("_services._dns-sd._udp.local.", _TYPE_PTR, _CLASS_IN, _DNS_TTL, stype))						
+						out.addAnswer(msg, DNSPointer("_services._dns-sd._udp.local.", _TYPE_PTR, _CLASS_IN, _DNS_TTL, stype))
 				for service in self.services.values():
 					if question.name == service.type:
 						if out is None:
@@ -1503,16 +1502,16 @@
 				try:
 					if out is None:
 						out = DNSOutgoing(_FLAGS_QR_RESPONSE | _FLAGS_AA)
-					
+
 					# Answer A record queries for any service addresses we know
 					if question.type == _TYPE_A or question.type == _TYPE_ANY:
 						for service in self.services.values():
 							if service.server == question.name.lower():
 								out.addAnswer(msg, DNSAddress(question.name, _TYPE_A, _CLASS_IN | _CLASS_UNIQUE, _DNS_TTL, service.address))
-					
+
 					service = self.services.get(question.name.lower(), None)
 					if not service: continue
-					
+
 					if question.type == _TYPE_SRV or question.type == _TYPE_ANY:
 						out.addAnswer(msg, DNSService(question.name, _TYPE_SRV, _CLASS_IN | _CLASS_UNIQUE, _DNS_TTL, service.priority, service.weight, service.port, service.server))
 					if question.type == _TYPE_TXT or question.type == _TYPE_ANY:
@@ -1521,7 +1520,7 @@
 						out.addAdditionalAnswer(DNSAddress(service.server, _TYPE_A, _CLASS_IN | _CLASS_UNIQUE, _DNS_TTL, service.address))
 				except:
 					traceback.print_exc()
-				
+
 		if out is not None and out.answers:
 			out.id = msg.id
 			self.send(out, addr, port)
@@ -1531,7 +1530,7 @@
 		# This is a quick test to see if we can parse the packets we generate
 		#temp = DNSIncoming(out.packet())
 		try:
-			bytes_sent = self.socket.sendto(out.packet(), 0, (addr, port))
+			self.socket.sendto(out.packet(), 0, (addr, port))
 		except:
 			# Ignore this, it may be a temporary loss of network connection
 			pass
--- a/hgext/zeroconf/__init__.py	Mon Mar 23 13:12:07 2009 +0100
+++ b/hgext/zeroconf/__init__.py	Mon Mar 23 13:13:02 2009 +0100
@@ -131,7 +131,7 @@
 def getzcpaths():
     server = Zeroconf.Zeroconf()
     l = listener()
-    browser = Zeroconf.ServiceBrowser(server, "_hg._tcp.local.", l)
+    Zeroconf.ServiceBrowser(server, "_hg._tcp.local.", l)
     time.sleep(1)
     server.close()
     for v in l.found.values():
--- a/mercurial/commands.py	Mon Mar 23 13:12:07 2009 +0100
+++ b/mercurial/commands.py	Mon Mar 23 13:13:02 2009 +0100
@@ -894,7 +894,7 @@
     ui.status(_("Checking templates...\n"))
     try:
         import templater
-        t = templater.templater(templater.templatepath("map-cmdline.default"))
+        templater.templater(templater.templatepath("map-cmdline.default"))
     except Exception, inst:
         ui.write(" %s\n" % inst)
         ui.write(_(" (templates seem to have been installed incorrectly)\n"))
@@ -1690,8 +1690,8 @@
 
                 files = {}
                 try:
-                    fuzz = patch.patch(tmpname, ui, strip=strip, cwd=repo.root,
-                                       files=files)
+                    patch.patch(tmpname, ui, strip=strip, cwd=repo.root,
+                                files=files)
                 finally:
                     files = patch.updatedir(ui, repo, files, similarity=sim/100.)
                 if not opts.get('no_commit'):
--- a/mercurial/context.py	Mon Mar 23 13:12:07 2009 +0100
+++ b/mercurial/context.py	Mon Mar 23 13:13:02 2009 +0100
@@ -233,7 +233,7 @@
 
     def __nonzero__(self):
         try:
-            n = self._filenode
+            self._filenode
             return True
         except error.LookupError:
             # file is missing
--- a/mercurial/keepalive.py	Mon Mar 23 13:12:07 2009 +0100
+++ b/mercurial/keepalive.py	Mon Mar 23 13:13:02 2009 +0100
@@ -494,7 +494,7 @@
         HANDLE_ERRORS = i
         try:
             fo = urllib2.urlopen(url)
-            foo = fo.read()
+            fo.read()
             fo.close()
             try: status, reason = fo.status, fo.reason
             except AttributeError: status, reason = None, None
--- a/mercurial/revlog.py	Mon Mar 23 13:12:07 2009 +0100
+++ b/mercurial/revlog.py	Mon Mar 23 13:13:02 2009 +0100
@@ -835,7 +835,7 @@
             # odds of a binary node being all hex in ASCII are 1 in 10**25
             try:
                 node = id
-                r = self.rev(node) # quick search the index
+                self.rev(node) # quick search the index
                 return node
             except LookupError:
                 pass # may be partial hex id
@@ -855,7 +855,7 @@
             try:
                 # a full hex nodeid?
                 node = bin(id)
-                r = self.rev(node)
+                self.rev(node)
                 return node
             except (TypeError, LookupError):
                 pass
--- a/mercurial/verify.py	Mon Mar 23 13:12:07 2009 +0100
+++ b/mercurial/verify.py	Mon Mar 23 13:13:02 2009 +0100
@@ -219,7 +219,7 @@
                         warn(_("warning: %s@%s: copy source revision is nullid %s:%s")
                             % (f, lr, rp[0], short(rp[1])))
                     else:
-                        rev = fl2.rev(rp[1])
+                        fl2.rev(rp[1])
             except Exception, inst:
                 exc(lr, _("checking rename of %s") % short(n), inst, f)