Show More
@@ -133,8 +133,8 b' pypats = [' | |||
|
133 | 133 | (r'\S;\s*\n', "semicolon"), |
|
134 | 134 | (r'[^_]_\("[^"]+"\s*%', "don't use % inside _()"), |
|
135 | 135 | (r"[^_]_\('[^']+'\s*%", "don't use % inside _()"), |
|
136 | (r'\w,\w', "missing whitespace after ,"), | |
|
137 | (r'\w[+/*\-<>]\w', "missing whitespace in expression"), | |
|
136 | (r'(\w|\)),\w', "missing whitespace after ,"), | |
|
137 | (r'(\w|\))[+/*\-<>]\w', "missing whitespace in expression"), | |
|
138 | 138 | (r'^\s+\w+=\w+[^,)\n]$', "missing whitespace in assignment"), |
|
139 | 139 | (r'(\s+)try:\n((?:\n|\1\s.*\n)+?)\1except.*?:\n' |
|
140 | 140 | r'((?:\n|\1\s.*\n)+?)\1finally:', 'no try/except/finally in Python 2.4'), |
@@ -146,7 +146,7 b' class Table(object):' | |||
|
146 | 146 | text.extend(cell) |
|
147 | 147 | if not text[-1].endswith('\n'): |
|
148 | 148 | text[-1] += '\n' |
|
149 | if i < len(row)-1: | |
|
149 | if i < len(row) - 1: | |
|
150 | 150 | text.append('T}'+self._tab_char+'T{\n') |
|
151 | 151 | else: |
|
152 | 152 | text.append('T}\n') |
@@ -258,7 +258,7 b' class Translator(nodes.NodeVisitor):' | |||
|
258 | 258 | # ensure we get a ".TH" as viewers require it. |
|
259 | 259 | self.head.append(self.header()) |
|
260 | 260 | # filter body |
|
261 | for i in xrange(len(self.body)-1, 0, -1): | |
|
261 | for i in xrange(len(self.body) - 1, 0, -1): | |
|
262 | 262 | # remove superfluous vertical gaps. |
|
263 | 263 | if self.body[i] == '.sp\n': |
|
264 | 264 | if self.body[i - 1][:4] in ('.BI ','.IP '): |
@@ -880,7 +880,7 b' class Translator(nodes.NodeVisitor):' | |||
|
880 | 880 | self.context[-3] = '.BI' # bold/italic alternate |
|
881 | 881 | if node['delimiter'] != ' ': |
|
882 | 882 | self.body.append('\\fB%s ' % node['delimiter']) |
|
883 | elif self.body[len(self.body)-1].endswith('='): | |
|
883 | elif self.body[len(self.body) - 1].endswith('='): | |
|
884 | 884 | # a blank only means no blank in output, just changing font |
|
885 | 885 | self.body.append(' ') |
|
886 | 886 | else: |
@@ -50,7 +50,7 b' def pygmentize(field, fctx, style, tmpl)' | |||
|
50 | 50 | colorized = highlight(text, lexer, formatter) |
|
51 | 51 | # strip wrapping div |
|
52 | 52 | colorized = colorized[:colorized.find('\n</pre>')] |
|
53 | colorized = colorized[colorized.find('<pre>')+5:] | |
|
53 | colorized = colorized[colorized.find('<pre>') + 5:] | |
|
54 | 54 | coloriter = (s.encode(encoding.encoding, 'replace') |
|
55 | 55 | for s in colorized.splitlines()) |
|
56 | 56 |
@@ -72,7 +72,7 b' class event(object):' | |||
|
72 | 72 | |
|
73 | 73 | def __repr__(self): |
|
74 | 74 | r = repr(self.raw) |
|
75 | return 'event(path=' + repr(self.path) + ', ' + r[r.find('(')+1:] | |
|
75 | return 'event(path=' + repr(self.path) + ', ' + r[r.find('(') + 1:] | |
|
76 | 76 | |
|
77 | 77 | |
|
78 | 78 | _event_props = { |
@@ -1147,7 +1147,7 b' class queue(object):' | |||
|
1147 | 1147 | return matches[0] |
|
1148 | 1148 | if self.series and self.applied: |
|
1149 | 1149 | if s == 'qtip': |
|
1150 | return self.series[self.seriesend(True)-1] | |
|
1150 | return self.series[self.seriesend(True) - 1] | |
|
1151 | 1151 | if s == 'qbase': |
|
1152 | 1152 | return self.series[0] |
|
1153 | 1153 | return None |
@@ -1626,7 +1626,7 b' class queue(object):' | |||
|
1626 | 1626 | # if the patch excludes a modified file, mark that |
|
1627 | 1627 | # file with mtime=0 so status can see it. |
|
1628 | 1628 | mm = [] |
|
1629 | for i in xrange(len(m)-1, -1, -1): | |
|
1629 | for i in xrange(len(m) - 1, -1, -1): | |
|
1630 | 1630 | if not matchfn(m[i]): |
|
1631 | 1631 | mm.append(m[i]) |
|
1632 | 1632 | del m[i] |
@@ -121,7 +121,7 b' def forbidnewline(ui, repo, hooktype, no' | |||
|
121 | 121 | # changegroup that contains an unacceptable commit followed later |
|
122 | 122 | # by a commit that fixes the problem. |
|
123 | 123 | tip = repo['tip'] |
|
124 | for rev in xrange(len(repo)-1, repo[node].rev()-1, -1): | |
|
124 | for rev in xrange(len(repo) - 1, repo[node].rev() - 1, -1): | |
|
125 | 125 | c = repo[rev] |
|
126 | 126 | for f in c.files(): |
|
127 | 127 | if f in seen or f not in tip or f not in c: |
@@ -46,7 +46,7 b' def ignorepats(lines):' | |||
|
46 | 46 | pat = line |
|
47 | 47 | break |
|
48 | 48 | elif line.startswith(s+':'): |
|
49 | pat = rels + line[len(s)+1:] | |
|
49 | pat = rels + line[len(s) + 1:] | |
|
50 | 50 | break |
|
51 | 51 | patterns.append(pat) |
|
52 | 52 |
@@ -2655,7 +2655,7 b' class localrepository(object):' | |||
|
2655 | 2655 | fp.write(text) |
|
2656 | 2656 | finally: |
|
2657 | 2657 | fp.close() |
|
2658 | return self.pathto(fp.name[len(self.root)+1:]) | |
|
2658 | return self.pathto(fp.name[len(self.root) + 1:]) | |
|
2659 | 2659 | |
|
2660 | 2660 | # used to avoid circular references so destructors work |
|
2661 | 2661 | def aftertrans(files): |
@@ -1007,7 +1007,7 b' class hunk(object):' | |||
|
1007 | 1007 | |
|
1008 | 1008 | bot = min(fuzz, bot) |
|
1009 | 1009 | top = min(fuzz, top) |
|
1010 | return old[top:len(old)-bot], new[top:len(new)-bot], top | |
|
1010 | return old[top:len(old) - bot], new[top:len(new) - bot], top | |
|
1011 | 1011 | return old, new, 0 |
|
1012 | 1012 | |
|
1013 | 1013 | def fuzzit(self, fuzz, toponly): |
@@ -76,7 +76,7 b' def _buildencodefun():' | |||
|
76 | 76 | cmap = dict([(chr(x), chr(x)) for x in xrange(127)]) |
|
77 | 77 | for x in (range(32) + range(126, 256) + winreserved): |
|
78 | 78 | cmap[chr(x)] = "~%02x" % x |
|
79 | for x in range(ord("A"), ord("Z")+1) + [ord(e)]: | |
|
79 | for x in range(ord("A"), ord("Z") + 1) + [ord(e)]: | |
|
80 | 80 | cmap[chr(x)] = e + chr(x).lower() |
|
81 | 81 | dmap = {} |
|
82 | 82 | for k, v in cmap.iteritems(): |
@@ -128,7 +128,7 b' def _buildlowerencodefun():' | |||
|
128 | 128 | cmap = dict([(chr(x), chr(x)) for x in xrange(127)]) |
|
129 | 129 | for x in (range(32) + range(126, 256) + winreserved): |
|
130 | 130 | cmap[chr(x)] = "~%02x" % x |
|
131 | for x in range(ord("A"), ord("Z")+1): | |
|
131 | for x in range(ord("A"), ord("Z") + 1): | |
|
132 | 132 | cmap[chr(x)] = chr(x).lower() |
|
133 | 133 | return lambda s: "".join([cmap[c] for c in s]) |
|
134 | 134 |
@@ -613,7 +613,7 b' class ui(object):' | |||
|
613 | 613 | ('&None', 'E&xec', 'Sym&link') Responses are case insensitive. |
|
614 | 614 | If ui is not interactive, the default is returned. |
|
615 | 615 | """ |
|
616 | resps = [s[s.index('&')+1].lower() for s in choices] | |
|
616 | resps = [s[s.index('&') + 1].lower() for s in choices] | |
|
617 | 617 | while True: |
|
618 | 618 | r = self.prompt(msg, resps[default]) |
|
619 | 619 | if r.lower() in resps: |
General Comments 0
You need to be logged in to leave comments.
Login now