changeset 1543:93a9298367e0

Merge with Thomas Waldmann
author Thomas Arendsen Hein <thomas@intevation.de>
date Mon, 14 Nov 2005 15:09:34 +0100
parents 5e47e42b14ba (current diff) 8e80eefb3de6 (diff)
children b3184bea3eb3
files mercurial/commands.py
diffstat 11 files changed, 25 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bdiff.c	Sun Nov 13 16:25:45 2005 +0100
+++ b/mercurial/bdiff.c	Mon Nov 14 15:09:34 2005 +0100
@@ -147,7 +147,7 @@
 				break;
 
 		a[i].e = j; /* use equivalence class for quick compare */
-		if(h[j].len <= t)
+		if (h[j].len <= t)
 			a[i].n = h[j].pos; /* point to head of match list */
 		else
 			a[i].n = -1; /* too popular */
@@ -270,7 +270,7 @@
 	if (!l.head || !rl)
 		goto nomem;
 
-	for(h = l.base; h != l.head; h++) {
+	for (h = l.base; h != l.head; h++) {
 		m = Py_BuildValue("iiii", h->a1, h->a2, h->b1, h->b2);
 		PyList_SetItem(rl, pos, m);
 		pos++;
@@ -305,7 +305,7 @@
 		goto nomem;
 
 	/* calculate length of output */
-	for(h = l.base; h != l.head; h++) {
+	for (h = l.base; h != l.head; h++) {
 		if (h->a1 != la || h->b1 != lb)
 			len += 12 + bl[h->b1].l - bl[lb].l;
 		la = h->a2;
@@ -320,7 +320,7 @@
 	rb = PyString_AsString(result);
 	la = lb = 0;
 
-	for(h = l.base; h != l.head; h++) {
+	for (h = l.base; h != l.head; h++) {
 		if (h->a1 != la || h->b1 != lb) {
 			len = bl[h->b1].l - bl[lb].l;
 			*(uint32_t *)(encode)     = htonl(al[la].l - al->l);
@@ -353,3 +353,4 @@
 {
 	Py_InitModule3("bdiff", methods, mdiff_doc);
 }
+
--- a/mercurial/commands.py	Sun Nov 13 16:25:45 2005 +0100
+++ b/mercurial/commands.py	Mon Nov 14 15:09:34 2005 +0100
@@ -644,7 +644,7 @@
                 n = mf[abs]
             except (hg.RepoError, KeyError):
                 try:
-                    n = r.lookup(rev)
+                    n = r.lookup(rev) # XXX rev undefined!
                 except KeyError, inst:
                     raise util.Abort(_('cannot find file %s in rev %s'), rel, rev)
         else:
@@ -1016,7 +1016,7 @@
             change = repo.changelog.read(n)
             m = repo.manifest.read(change[0])
             n = m[relpath(repo, [file])[0]]
-        except hg.RepoError, KeyError:
+        except (hg.RepoError, KeyError):
             n = r.lookup(rev)
     else:
         n = r.tip()
@@ -2470,7 +2470,7 @@
 
     external = []
     for x in u.extensions():
-        def on_exception(Exception, inst):
+        def on_exception(Exception, inst): # XXX Exception is a builtin name!?
             u.warn(_("*** failed to import extension %s\n") % x[1])
             u.warn("%s\n" % inst)
             if "--traceback" in sys.argv[1:]:
--- a/mercurial/dirstate.py	Sun Nov 13 16:25:45 2005 +0100
+++ b/mercurial/dirstate.py	Mon Nov 14 15:09:34 2005 +0100
@@ -213,7 +213,7 @@
         unknown = []
 
         for x in files:
-            if x is '.':
+            if x == '.':
                 return self.map.copy()
             if x not in self.map:
                 unknown.append(x)
@@ -296,7 +296,6 @@
     def walkhelper(self, files, statmatch, dc):
         # recursion free walker, faster than os.walk.
         def findfiles(s):
-            retfiles = []
             work = [s]
             while work:
                 top = work.pop()
--- a/mercurial/fancyopts.py	Sun Nov 13 16:25:45 2005 +0100
+++ b/mercurial/fancyopts.py	Mon Nov 14 15:09:34 2005 +0100
@@ -1,10 +1,10 @@
 import getopt
 
 def fancyopts(args, options, state):
-    long=[]
-    short=''
-    map={}
-    dt={}
+    long = []
+    short = ''
+    map = {}
+    dt = {}
 
     for s, l, d, c in options:
         pl = l.replace('-', '_')
--- a/mercurial/filelog.py	Sun Nov 13 16:25:45 2005 +0100
+++ b/mercurial/filelog.py	Mon Nov 14 15:09:34 2005 +0100
@@ -54,11 +54,11 @@
             mt = ""
             if meta:
                 mt = [ "%s: %s\n" % (k, v) for k,v in meta.items() ]
-            text = "\1\n" + "".join(mt) + "\1\n" + text
+            text = "\1\n%s\1\n%s" % ("".join(mt), text)
         return self.addrevision(text, transaction, link, p1, p2)
 
     def renamed(self, node):
-        if 0 and self.parents(node)[0] != nullid:
+        if 0 and self.parents(node)[0] != nullid: # XXX
             return False
         m = self.readmeta(node)
         if m and m.has_key("copy"):
--- a/mercurial/hgweb.py	Sun Nov 13 16:25:45 2005 +0100
+++ b/mercurial/hgweb.py	Mon Nov 14 15:09:34 2005 +0100
@@ -954,7 +954,7 @@
 def server(path, name, templates, address, port, use_ipv6=False,
            accesslog=sys.stdout, errorlog=sys.stderr):
     httpd = create_server(path, name, templates, address, port, use_ipv6,
-                          accesslog, errorlog)
+                          accesslog, errorlog) # XXX wrong param count
     httpd.serve_forever()
 
 # This is a stopgap
--- a/mercurial/manifest.py	Sun Nov 13 16:25:45 2005 +0100
+++ b/mercurial/manifest.py	Mon Nov 14 15:09:34 2005 +0100
@@ -5,7 +5,7 @@
 # This software may be used and distributed according to the terms
 # of the GNU General Public License, incorporated herein by reference.
 
-import sys, struct
+import struct
 from revlog import *
 from i18n import gettext as _
 from demandload import *
--- a/mercurial/mdiff.py	Sun Nov 13 16:25:45 2005 +0100
+++ b/mercurial/mdiff.py	Mon Nov 14 15:09:34 2005 +0100
@@ -32,8 +32,8 @@
         l = list(difflib.unified_diff(a, b, "a/" + fn, "b/" + fn))
         if not l: return ""
         # difflib uses a space, rather than a tab
-        l[0] = l[0][:-2] + "\t" + ad + "\n"
-        l[1] = l[1][:-2] + "\t" + bd + "\n"
+        l[0] = "%s\t%s\n" % (l[0][:-2], ad)
+        l[1] = "%s\t%s\n" % (l[1][:-2], bd)
 
     for ln in xrange(len(l)):
         if l[ln][-1] != '\n':
--- a/mercurial/node.py	Sun Nov 13 16:25:45 2005 +0100
+++ b/mercurial/node.py	Mon Nov 14 15:09:34 2005 +0100
@@ -7,7 +7,7 @@
 of the GNU General Public License, incorporated herein by reference.
 """
 
-import sha, binascii
+import binascii
 
 nullid = "\0" * 20
 
--- a/mercurial/transaction.py	Sun Nov 13 16:25:45 2005 +0100
+++ b/mercurial/transaction.py	Mon Nov 14 15:09:34 2005 +0100
@@ -12,7 +12,6 @@
 # of the GNU General Public License, incorporated herein by reference.
 
 import os
-import util
 from i18n import gettext as _
 
 class transaction:
--- a/mercurial/util.py	Sun Nov 13 16:25:45 2005 +0100
+++ b/mercurial/util.py	Mon Nov 14 15:09:34 2005 +0100
@@ -158,9 +158,11 @@
     this returns a path in the form used by the local filesystem, not hg.'''
     if not n1: return localpath(n2)
     a, b = n1.split('/'), n2.split('/')
-    a.reverse(), b.reverse()
+    a.reverse()
+    b.reverse()
     while a and b and a[-1] == b[-1]:
-        a.pop(), b.pop()
+        a.pop()
+        b.pop()
     b.reverse()
     return os.sep.join((['..'] * len(a)) + b)
 
@@ -253,7 +255,7 @@
             try:
                 pat = '(?:%s)' % regex(k, p, tail)
                 matches.append(re.compile(pat).match)
-            except re.error, inst:
+            except re.error:
                 raise Abort("invalid pattern: %s:%s" % (k, p))
 
         def buildfn(text):