Show More
@@ -177,7 +177,7 b' class p4_source(converter_source):' | |||
|
177 | 177 | elif "k" in flags: |
|
178 | 178 | keywords = self.re_keywords |
|
179 | 179 | |
|
180 |
elif code |
|
|
180 | elif code in ("text", "binary"): | |
|
181 | 181 | contents += data |
|
182 | 182 | |
|
183 | 183 | if mode is None: |
@@ -34,7 +34,7 b' def ancestor(a, b, pfunc):' | |||
|
34 | 34 | visit.pop() |
|
35 | 35 | else: |
|
36 | 36 | for p in pl: |
|
37 |
if p |
|
|
37 | if p in (a, b): # did we find a or b as a parent? | |
|
38 | 38 | return p # we're done |
|
39 | 39 | if p not in depth: |
|
40 | 40 | visit.append(p) |
@@ -219,7 +219,7 b' def parsedag(desc):' | |||
|
219 | 219 | yield 'n', (r, [p1]) |
|
220 | 220 | p1 = r |
|
221 | 221 | r += 1 |
|
222 |
elif c |
|
|
222 | elif c in '*/': | |
|
223 | 223 | if c == '*': |
|
224 | 224 | c = nextch() |
|
225 | 225 | c, pref = nextstring(c) |
@@ -531,7 +531,7 b' class dirstate(object):' | |||
|
531 | 531 | match.dir(nf) |
|
532 | 532 | if not dirignore(nf): |
|
533 | 533 | wadd(nf) |
|
534 |
elif kind |
|
|
534 | elif kind in (regkind, lnkkind): | |
|
535 | 535 | results[nf] = st |
|
536 | 536 | else: |
|
537 | 537 | badfn(ff, badtype(kind)) |
@@ -25,7 +25,7 b' def moduledoc(file):' | |||
|
25 | 25 | break |
|
26 | 26 | |
|
27 | 27 | start = line[:3] |
|
28 |
if start |
|
|
28 | if start in ('"""', "'''"): | |
|
29 | 29 | line = line[3:] |
|
30 | 30 | while line: |
|
31 | 31 | if line.rstrip().endswith(start): |
@@ -496,7 +496,7 b' def update(repo, node, branchmerge, forc' | |||
|
496 | 496 | raise util.Abort(_("outstanding uncommitted changes " |
|
497 | 497 | "(use 'hg status' to list changes)")) |
|
498 | 498 | elif not overwrite: |
|
499 |
if pa |
|
|
499 | if pa in (p1, p2): # linear | |
|
500 | 500 | pass # all good |
|
501 | 501 | elif wc.files() or wc.deleted(): |
|
502 | 502 | raise util.Abort(_("crosses branches (use 'hg merge' to merge " |
@@ -41,9 +41,9 b' def fix_newline(hunk, a, b):' | |||
|
41 | 41 | hline = l[:-1] |
|
42 | 42 | c = hline[0] |
|
43 | 43 | |
|
44 |
if c |
|
|
44 | if c in " +": | |
|
45 | 45 | b[-1] = hline[1:] |
|
46 |
if c |
|
|
46 | if c in " -": | |
|
47 | 47 | a[-1] = hline |
|
48 | 48 | hunk[-1] = hline |
|
49 | 49 | return 0 |
@@ -87,7 +87,7 b' def tokenize(program):' | |||
|
87 | 87 | # helpers |
|
88 | 88 | |
|
89 | 89 | def getstring(x, err): |
|
90 |
if x and |
|
|
90 | if x and x[0] in ('string', 'symbol'): | |
|
91 | 91 | return x[1] |
|
92 | 92 | raise error.ParseError(err) |
|
93 | 93 | |
@@ -537,7 +537,7 b' def optimize(x, small):' | |||
|
537 | 537 | '-' + getstring(x[1], _("can't negate that"))), small) |
|
538 | 538 | elif op in 'string symbol negate': |
|
539 | 539 | return smallbonus, x # single revisions are small |
|
540 |
elif op |
|
|
540 | elif op in ('and', 'dagrange'): | |
|
541 | 541 | wa, ta = optimize(x[1], True) |
|
542 | 542 | wb, tb = optimize(x[2], True) |
|
543 | 543 | w = min(wa, wb) |
@@ -110,7 +110,7 b' class Merge3Text(object):' | |||
|
110 | 110 | if what == 'unchanged': |
|
111 | 111 | for i in range(t[1], t[2]): |
|
112 | 112 | yield self.base[i] |
|
113 |
elif what |
|
|
113 | elif what in ('a', 'same'): | |
|
114 | 114 | for i in range(t[1], t[2]): |
|
115 | 115 | yield self.a[i] |
|
116 | 116 | elif what == 'b': |
@@ -142,7 +142,7 b' class Merge3Text(object):' | |||
|
142 | 142 | if what == 'unchanged': |
|
143 | 143 | for i in range(t[1], t[2]): |
|
144 | 144 | yield 'u | ' + self.base[i] |
|
145 |
elif what |
|
|
145 | elif what in ('a', 'same'): | |
|
146 | 146 | for i in range(t[1], t[2]): |
|
147 | 147 | yield what[0] + ' | ' + self.a[i] |
|
148 | 148 | elif what == 'b': |
@@ -181,7 +181,7 b' class Merge3Text(object):' | |||
|
181 | 181 | what = t[0] |
|
182 | 182 | if what == 'unchanged': |
|
183 | 183 | yield what, self.base[t[1]:t[2]] |
|
184 |
elif what |
|
|
184 | elif what in ('a', 'same'): | |
|
185 | 185 | yield what, self.a[t[1]:t[2]] |
|
186 | 186 | elif what == 'b': |
|
187 | 187 | yield what, self.b[t[1]:t[2]] |
@@ -640,7 +640,7 b' def fspath(name, root):' | |||
|
640 | 640 | # If name is absolute, make it relative |
|
641 | 641 | if name.lower().startswith(root.lower()): |
|
642 | 642 | l = len(root) |
|
643 |
if name[l] |
|
|
643 | if name[l] in (os.sep, os.altsep): | |
|
644 | 644 | l = l + 1 |
|
645 | 645 | name = name[l:] |
|
646 | 646 | |
@@ -1008,7 +1008,7 b' def strdate(string, format, defaults=[])' | |||
|
1008 | 1008 | hours = int(tz[1:3]) |
|
1009 | 1009 | minutes = int(tz[3:5]) |
|
1010 | 1010 | return -sign * (hours * 60 + minutes) * 60 |
|
1011 |
if tz |
|
|
1011 | if tz in ("GMT", "UTC"): | |
|
1012 | 1012 | return 0 |
|
1013 | 1013 | return None |
|
1014 | 1014 |
General Comments 0
You need to be logged in to leave comments.
Login now