# HG changeset patch # User Brodie Rao # Date 2012-05-12 14:00:57 # Node ID 67964cda87011c8717d4a6ec24540d20012df084 # Parent 43d55088415a5424bcbf03511026199d535dacc9 cleanup: "not x in y" -> "x not in y" diff --git a/doc/hgmanpage.py b/doc/hgmanpage.py --- a/doc/hgmanpage.py +++ b/doc/hgmanpage.py @@ -582,7 +582,7 @@ class Translator(nodes.NodeVisitor): self._docinfo[name], self.defs['indent'][1], self.defs['indent'][1])) - elif not name in skip: + elif name not in skip: if name in self._docinfo_names: label = self._docinfo_names[name] else: diff --git a/hgext/convert/convcmd.py b/hgext/convert/convcmd.py --- a/hgext/convert/convcmd.py +++ b/hgext/convert/convcmd.py @@ -190,7 +190,7 @@ class converter(object): children.setdefault(n, []) hasparent = False for p in parents[n]: - if not p in self.map: + if p not in self.map: visit.append(p) hasparent = True children.setdefault(p, []).append(n) diff --git a/hgext/convert/hg.py b/hgext/convert/hg.py --- a/hgext/convert/hg.py +++ b/hgext/convert/hg.py @@ -224,7 +224,7 @@ class mercurial_sink(converter_sink): bookmarks.write(self.repo) def hascommit(self, rev): - if not rev in self.repo and self.clonebranches: + if rev not in self.repo and self.clonebranches: raise util.Abort(_('revision %s not found in destination ' 'repository (lookups with clonebranches=true ' 'are not implemented)') % rev) diff --git a/hgext/extdiff.py b/hgext/extdiff.py --- a/hgext/extdiff.py +++ b/hgext/extdiff.py @@ -88,7 +88,7 @@ def snapshot(ui, repo, files, node, tmpr ctx = repo[node] for fn in files: wfn = util.pconvert(fn) - if not wfn in ctx: + if wfn not in ctx: # File doesn't exist; could be a bogus modify continue ui.note(' %s\n' % wfn) diff --git a/hgext/keyword.py b/hgext/keyword.py --- a/hgext/keyword.py +++ b/hgext/keyword.py @@ -238,7 +238,7 @@ class kwtemplater(object): def iskwfile(self, cand, ctx): '''Returns subset of candidates which are configured for keyword expansion but are not symbolic links.''' - return [f for f in cand if self.match(f) and not 'l' in ctx.flags(f)] + return [f for f in cand if self.match(f) and 'l' not in ctx.flags(f)] def overwrite(self, ctx, candidates, lookup, expand, rekw=False): '''Overwrites selected files expanding/shrinking keywords.''' @@ -651,7 +651,7 @@ def reposetup(ui, repo): return kwt.match(source) candidates = [f for f in repo.dirstate.copies() if - not 'l' in wctx.flags(f) and haskwsource(f)] + 'l' not in wctx.flags(f) and haskwsource(f)] kwt.overwrite(wctx, candidates, False, False) def kw_dorecord(orig, ui, repo, commitfunc, *pats, **opts): @@ -680,7 +680,7 @@ def reposetup(ui, repo): # not make sense if (fctx._filerev is None and (self._repo._encodefilterpats or - kwt.match(fctx.path()) and not 'l' in fctx.flags() or + kwt.match(fctx.path()) and 'l' not in fctx.flags() or self.size() - 4 == fctx.size()) or self.size() == fctx.size()): return self._filelog.cmp(self._filenode, fctx.data()) diff --git a/hgext/largefiles/wirestore.py b/hgext/largefiles/wirestore.py --- a/hgext/largefiles/wirestore.py +++ b/hgext/largefiles/wirestore.py @@ -14,7 +14,7 @@ class wirestore(remotestore.remotestore) if not cap: raise lfutil.storeprotonotcapable([]) storetypes = cap.split(',') - if not 'serve' in storetypes: + if 'serve' not in storetypes: raise lfutil.storeprotonotcapable(storetypes) self.remote = remote super(wirestore, self).__init__(ui, repo, remote.url()) diff --git a/hgext/relink.py b/hgext/relink.py --- a/hgext/relink.py +++ b/hgext/relink.py @@ -79,7 +79,7 @@ def collect(src, ui): dirnames.sort() relpath = dirpath[len(src) + seplen:] for filename in sorted(filenames): - if not filename[-2:] in ('.d', '.i'): + if filename[-2:] not in ('.d', '.i'): continue st = os.stat(os.path.join(dirpath, filename)) if not stat.S_ISREG(st.st_mode): diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py --- a/mercurial/bundlerepo.py +++ b/mercurial/bundlerepo.py @@ -54,7 +54,7 @@ class bundlerevlog(revlog.revlog): continue for p in (p1, p2): - if not p in self.nodemap: + if p not in self.nodemap: raise error.LookupError(p, self.indexfile, _("unknown parent")) # start, size, full unc. size, base (unused), link, p1, p2, node diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -696,7 +696,7 @@ class dirstate(object): visit = sorted([f for f in dmap if f not in results and matchfn(f)]) for nf, st in zip(visit, util.statfiles([join(i) for i in visit])): if (not st is None and - not getkind(st.st_mode) in (regkind, lnkkind)): + getkind(st.st_mode) not in (regkind, lnkkind)): st = None results[nf] = st for s in subrepos: diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py --- a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -706,7 +706,7 @@ def lsprofile(ui, func, fp): field = ui.config('profiling', 'sort', default='inlinetime') climit = ui.configint('profiling', 'nested', default=5) - if not format in ['text', 'kcachegrind']: + if format not in ['text', 'kcachegrind']: ui.warn(_("unrecognized profiling format '%s'" " - Ignored\n") % format) format = 'text' diff --git a/mercurial/keepalive.py b/mercurial/keepalive.py --- a/mercurial/keepalive.py +++ b/mercurial/keepalive.py @@ -136,7 +136,7 @@ class ConnectionManager(object): def add(self, host, connection, ready): self._lock.acquire() try: - if not host in self._hostmap: + if host not in self._hostmap: self._hostmap[host] = [] self._hostmap[host].append(connection) self._connmap[connection] = host diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -1659,7 +1659,7 @@ def difflabel(func, *args, **kw): if line.startswith('@'): head = False else: - if line and not line[0] in ' +-@\\': + if line and line[0] not in ' +-@\\': head = True stripline = line if not head and line and line[0] in '+-': diff --git a/mercurial/pure/osutil.py b/mercurial/pure/osutil.py --- a/mercurial/pure/osutil.py +++ b/mercurial/pure/osutil.py @@ -119,7 +119,7 @@ else: flags = _O_TEXT m0 = mode[0] - if m0 == 'r' and not '+' in mode: + if m0 == 'r' and '+' not in mode: flags |= _O_RDONLY access = _GENERIC_READ else: diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -1208,7 +1208,7 @@ class revlog(object): continue for p in (p1, p2): - if not p in self.nodemap: + if p not in self.nodemap: raise LookupError(p, self.indexfile, _('unknown parent')) diff --git a/mercurial/templatefilters.py b/mercurial/templatefilters.py --- a/mercurial/templatefilters.py +++ b/mercurial/templatefilters.py @@ -260,7 +260,7 @@ def person(author): >>> person('"Foo Bar ') 'Foo Bar' """ - if not '@' in author: + if '@' not in author: return author f = author.find('<') if f != -1: diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -312,7 +312,7 @@ class templater(object): def load(self, t): '''Get the template for the given template name. Use a local cache.''' - if not t in self.cache: + if t not in self.cache: try: self.cache[t] = util.readfile(self.map[t][1]) except KeyError, inst: diff --git a/tests/test-walkrepo.py b/tests/test-walkrepo.py --- a/tests/test-walkrepo.py +++ b/tests/test-walkrepo.py @@ -43,7 +43,7 @@ def runtest(): print "reposet = %r" % (reposet,) print "sub1set and reposet should have exactly one path in common." sub3 = pjoin('.', 'circle', 'top1') - if sym and not (sub3 in reposet): + if sym and sub3 not in reposet: print "reposet = %r" % (reposet,) print "Symbolic links are supported and %s is not in reposet" % (sub3,)