##// END OF EJS Templates
backout most of 4f8067c94729
Matt Mackall -
r12401:4cdaf1ad default
parent child Browse files
Show More
@@ -177,7 +177,7 class p4_source(converter_source):
177 177 elif "k" in flags:
178 178 keywords = self.re_keywords
179 179
180 elif code in ("text", "binary"):
180 elif code == "text" or code == "binary":
181 181 contents += data
182 182
183 183 if mode is None:
@@ -34,7 +34,7 def ancestor(a, b, pfunc):
34 34 visit.pop()
35 35 else:
36 36 for p in pl:
37 if p in (a, b): # did we find a or b as a parent?
37 if p == a or p == 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)
@@ -531,7 +531,7 class dirstate(object):
531 531 match.dir(nf)
532 532 if not dirignore(nf):
533 533 wadd(nf)
534 elif kind in (regkind, lnkkind):
534 elif kind == regkind or kind == lnkkind:
535 535 results[nf] = st
536 536 else:
537 537 badfn(ff, badtype(kind))
@@ -25,7 +25,7 def moduledoc(file):
25 25 break
26 26
27 27 start = line[:3]
28 if start in ('"""', "'''"):
28 if start == '"""' or start == "'''":
29 29 line = line[3:]
30 30 while line:
31 31 if line.rstrip().endswith(start):
@@ -496,7 +496,7 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 in (p1, p2): # linear
499 if pa == p1 or pa == 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 "
@@ -87,7 +87,7 def tokenize(program):
87 87 # helpers
88 88
89 89 def getstring(x, err):
90 if x and x[0] in ('string', 'symbol'):
90 if x and (x[0] == 'string' or x[0] == 'symbol'):
91 91 return x[1]
92 92 raise error.ParseError(err)
93 93
@@ -537,7 +537,7 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 in ('and', 'dagrange'):
540 elif op == 'and' or op == '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 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 in ('a', 'same'):
113 elif what == 'a' or what == '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 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 in ('a', 'same'):
145 elif what == 'a' or what == '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 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 in ('a', 'same'):
184 elif what == 'a' or what == '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 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] in (os.sep, os.altsep):
643 if name[l] == os.sep or name[l] == os.altsep:
644 644 l = l + 1
645 645 name = name[l:]
646 646
@@ -1008,7 +1008,7 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 in ("GMT", "UTC"):
1011 if tz == "GMT" or tz == "UTC":
1012 1012 return 0
1013 1013 return None
1014 1014
@@ -50,7 +50,7 def nlinks(pathname):
50 50 if not dirname:
51 51 dirname = '.'
52 52 dt = win32file.GetDriveType(dirname + '\\')
53 if dt in (4, 1):
53 if dt == 4 or dt == 1:
54 54 # Fake hardlink to force COW for network drives
55 55 links = 2
56 56 return links
General Comments 0
You need to be logged in to leave comments. Login now