diff --git a/hgext/convert/p4.py b/hgext/convert/p4.py --- a/hgext/convert/p4.py +++ b/hgext/convert/p4.py @@ -177,7 +177,7 @@ class p4_source(converter_source): 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 --git a/mercurial/ancestor.py b/mercurial/ancestor.py --- a/mercurial/ancestor.py +++ b/mercurial/ancestor.py @@ -34,7 +34,7 @@ def ancestor(a, b, pfunc): 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 --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -531,7 +531,7 @@ class dirstate(object): 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 --git a/mercurial/help.py b/mercurial/help.py --- a/mercurial/help.py +++ b/mercurial/help.py @@ -25,7 +25,7 @@ def moduledoc(file): break start = line[:3] - if start in ('"""', "'''"): + if start == '"""' or start == "'''": line = line[3:] while line: if line.rstrip().endswith(start): diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -496,7 +496,7 @@ def update(repo, node, branchmerge, forc 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 --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -87,7 +87,7 @@ def tokenize(program): # 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 @@ def optimize(x, small): '-' + 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 --git a/mercurial/simplemerge.py b/mercurial/simplemerge.py --- a/mercurial/simplemerge.py +++ b/mercurial/simplemerge.py @@ -110,7 +110,7 @@ class Merge3Text(object): 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 @@ class Merge3Text(object): 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 @@ class Merge3Text(object): 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 --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -640,7 +640,7 @@ def fspath(name, root): # 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 @@ def strdate(string, format, defaults=[]) 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 --git a/mercurial/win32.py b/mercurial/win32.py --- a/mercurial/win32.py +++ b/mercurial/win32.py @@ -50,7 +50,7 @@ def nlinks(pathname): 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