# HG changeset patch # User Matt Mackall # Date 1285350414 18000 # Node ID 4cdaf1adafc80ab9d63a12b27699b378142a5004 # Parent 40852b4b910cac3c5552348322c0dec0180dcbab backout most of 4f8067c94729 diff -r 40852b4b910c -r 4cdaf1adafc8 hgext/convert/p4.py --- a/hgext/convert/p4.py Fri Sep 24 12:00:55 2010 +0200 +++ b/hgext/convert/p4.py Fri Sep 24 12:46:54 2010 -0500 @@ -177,7 +177,7 @@ elif "k" in flags: keywords = self.re_keywords - elif code in ("text", "binary"): + elif code == "text" or code == "binary": contents += data if mode is None: diff -r 40852b4b910c -r 4cdaf1adafc8 mercurial/ancestor.py --- a/mercurial/ancestor.py Fri Sep 24 12:00:55 2010 +0200 +++ b/mercurial/ancestor.py Fri Sep 24 12:46:54 2010 -0500 @@ -34,7 +34,7 @@ visit.pop() else: for p in pl: - if p in (a, b): # did we find a or b as a parent? + if p == a or p == b: # did we find a or b as a parent? return p # we're done if p not in depth: visit.append(p) diff -r 40852b4b910c -r 4cdaf1adafc8 mercurial/dirstate.py --- a/mercurial/dirstate.py Fri Sep 24 12:00:55 2010 +0200 +++ b/mercurial/dirstate.py Fri Sep 24 12:46:54 2010 -0500 @@ -531,7 +531,7 @@ match.dir(nf) if not dirignore(nf): wadd(nf) - elif kind in (regkind, lnkkind): + elif kind == regkind or kind == lnkkind: results[nf] = st else: badfn(ff, badtype(kind)) diff -r 40852b4b910c -r 4cdaf1adafc8 mercurial/help.py --- a/mercurial/help.py Fri Sep 24 12:00:55 2010 +0200 +++ b/mercurial/help.py Fri Sep 24 12:46:54 2010 -0500 @@ -25,7 +25,7 @@ break start = line[:3] - if start in ('"""', "'''"): + if start == '"""' or start == "'''": line = line[3:] while line: if line.rstrip().endswith(start): diff -r 40852b4b910c -r 4cdaf1adafc8 mercurial/merge.py --- a/mercurial/merge.py Fri Sep 24 12:00:55 2010 +0200 +++ b/mercurial/merge.py Fri Sep 24 12:46:54 2010 -0500 @@ -496,7 +496,7 @@ raise util.Abort(_("outstanding uncommitted changes " "(use 'hg status' to list changes)")) elif not overwrite: - if pa in (p1, p2): # linear + if pa == p1 or pa == p2: # linear pass # all good elif wc.files() or wc.deleted(): raise util.Abort(_("crosses branches (use 'hg merge' to merge " diff -r 40852b4b910c -r 4cdaf1adafc8 mercurial/revset.py --- a/mercurial/revset.py Fri Sep 24 12:00:55 2010 +0200 +++ b/mercurial/revset.py Fri Sep 24 12:46:54 2010 -0500 @@ -87,7 +87,7 @@ # helpers def getstring(x, err): - if x and x[0] in ('string', 'symbol'): + if x and (x[0] == 'string' or x[0] == 'symbol'): return x[1] raise error.ParseError(err) @@ -537,7 +537,7 @@ '-' + getstring(x[1], _("can't negate that"))), small) elif op in 'string symbol negate': return smallbonus, x # single revisions are small - elif op in ('and', 'dagrange'): + elif op == 'and' or op == 'dagrange': wa, ta = optimize(x[1], True) wb, tb = optimize(x[2], True) w = min(wa, wb) diff -r 40852b4b910c -r 4cdaf1adafc8 mercurial/simplemerge.py --- a/mercurial/simplemerge.py Fri Sep 24 12:00:55 2010 +0200 +++ b/mercurial/simplemerge.py Fri Sep 24 12:46:54 2010 -0500 @@ -110,7 +110,7 @@ if what == 'unchanged': for i in range(t[1], t[2]): yield self.base[i] - elif what in ('a', 'same'): + elif what == 'a' or what == 'same': for i in range(t[1], t[2]): yield self.a[i] elif what == 'b': @@ -142,7 +142,7 @@ if what == 'unchanged': for i in range(t[1], t[2]): yield 'u | ' + self.base[i] - elif what in ('a', 'same'): + elif what == 'a' or what == 'same': for i in range(t[1], t[2]): yield what[0] + ' | ' + self.a[i] elif what == 'b': @@ -181,7 +181,7 @@ what = t[0] if what == 'unchanged': yield what, self.base[t[1]:t[2]] - elif what in ('a', 'same'): + elif what == 'a' or what == 'same': yield what, self.a[t[1]:t[2]] elif what == 'b': yield what, self.b[t[1]:t[2]] diff -r 40852b4b910c -r 4cdaf1adafc8 mercurial/util.py --- a/mercurial/util.py Fri Sep 24 12:00:55 2010 +0200 +++ b/mercurial/util.py Fri Sep 24 12:46:54 2010 -0500 @@ -640,7 +640,7 @@ # If name is absolute, make it relative if name.lower().startswith(root.lower()): l = len(root) - if name[l] in (os.sep, os.altsep): + if name[l] == os.sep or name[l] == os.altsep: l = l + 1 name = name[l:] @@ -1008,7 +1008,7 @@ hours = int(tz[1:3]) minutes = int(tz[3:5]) return -sign * (hours * 60 + minutes) * 60 - if tz in ("GMT", "UTC"): + if tz == "GMT" or tz == "UTC": return 0 return None diff -r 40852b4b910c -r 4cdaf1adafc8 mercurial/win32.py --- a/mercurial/win32.py Fri Sep 24 12:00:55 2010 +0200 +++ b/mercurial/win32.py Fri Sep 24 12:46:54 2010 -0500 @@ -50,7 +50,7 @@ if not dirname: dirname = '.' dt = win32file.GetDriveType(dirname + '\\') - if dt in (4, 1): + if dt == 4 or dt == 1: # Fake hardlink to force COW for network drives links = 2 return links