##// END OF EJS Templates
cleanup: "not x in y" -> "x not in y"
Brodie Rao -
r16686:67964cda default
parent child Browse files
Show More
@@ -582,7 +582,7 b' class Translator(nodes.NodeVisitor):'
582 self._docinfo[name],
582 self._docinfo[name],
583 self.defs['indent'][1],
583 self.defs['indent'][1],
584 self.defs['indent'][1]))
584 self.defs['indent'][1]))
585 elif not name in skip:
585 elif name not in skip:
586 if name in self._docinfo_names:
586 if name in self._docinfo_names:
587 label = self._docinfo_names[name]
587 label = self._docinfo_names[name]
588 else:
588 else:
@@ -190,7 +190,7 b' class converter(object):'
190 children.setdefault(n, [])
190 children.setdefault(n, [])
191 hasparent = False
191 hasparent = False
192 for p in parents[n]:
192 for p in parents[n]:
193 if not p in self.map:
193 if p not in self.map:
194 visit.append(p)
194 visit.append(p)
195 hasparent = True
195 hasparent = True
196 children.setdefault(p, []).append(n)
196 children.setdefault(p, []).append(n)
@@ -224,7 +224,7 b' class mercurial_sink(converter_sink):'
224 bookmarks.write(self.repo)
224 bookmarks.write(self.repo)
225
225
226 def hascommit(self, rev):
226 def hascommit(self, rev):
227 if not rev in self.repo and self.clonebranches:
227 if rev not in self.repo and self.clonebranches:
228 raise util.Abort(_('revision %s not found in destination '
228 raise util.Abort(_('revision %s not found in destination '
229 'repository (lookups with clonebranches=true '
229 'repository (lookups with clonebranches=true '
230 'are not implemented)') % rev)
230 'are not implemented)') % rev)
@@ -88,7 +88,7 b' def snapshot(ui, repo, files, node, tmpr'
88 ctx = repo[node]
88 ctx = repo[node]
89 for fn in files:
89 for fn in files:
90 wfn = util.pconvert(fn)
90 wfn = util.pconvert(fn)
91 if not wfn in ctx:
91 if wfn not in ctx:
92 # File doesn't exist; could be a bogus modify
92 # File doesn't exist; could be a bogus modify
93 continue
93 continue
94 ui.note(' %s\n' % wfn)
94 ui.note(' %s\n' % wfn)
@@ -238,7 +238,7 b' class kwtemplater(object):'
238 def iskwfile(self, cand, ctx):
238 def iskwfile(self, cand, ctx):
239 '''Returns subset of candidates which are configured for keyword
239 '''Returns subset of candidates which are configured for keyword
240 expansion but are not symbolic links.'''
240 expansion but are not symbolic links.'''
241 return [f for f in cand if self.match(f) and not 'l' in ctx.flags(f)]
241 return [f for f in cand if self.match(f) and 'l' not in ctx.flags(f)]
242
242
243 def overwrite(self, ctx, candidates, lookup, expand, rekw=False):
243 def overwrite(self, ctx, candidates, lookup, expand, rekw=False):
244 '''Overwrites selected files expanding/shrinking keywords.'''
244 '''Overwrites selected files expanding/shrinking keywords.'''
@@ -651,7 +651,7 b' def reposetup(ui, repo):'
651 return kwt.match(source)
651 return kwt.match(source)
652
652
653 candidates = [f for f in repo.dirstate.copies() if
653 candidates = [f for f in repo.dirstate.copies() if
654 not 'l' in wctx.flags(f) and haskwsource(f)]
654 'l' not in wctx.flags(f) and haskwsource(f)]
655 kwt.overwrite(wctx, candidates, False, False)
655 kwt.overwrite(wctx, candidates, False, False)
656
656
657 def kw_dorecord(orig, ui, repo, commitfunc, *pats, **opts):
657 def kw_dorecord(orig, ui, repo, commitfunc, *pats, **opts):
@@ -680,7 +680,7 b' def reposetup(ui, repo):'
680 # not make sense
680 # not make sense
681 if (fctx._filerev is None and
681 if (fctx._filerev is None and
682 (self._repo._encodefilterpats or
682 (self._repo._encodefilterpats or
683 kwt.match(fctx.path()) and not 'l' in fctx.flags() or
683 kwt.match(fctx.path()) and 'l' not in fctx.flags() or
684 self.size() - 4 == fctx.size()) or
684 self.size() - 4 == fctx.size()) or
685 self.size() == fctx.size()):
685 self.size() == fctx.size()):
686 return self._filelog.cmp(self._filenode, fctx.data())
686 return self._filelog.cmp(self._filenode, fctx.data())
@@ -14,7 +14,7 b' class wirestore(remotestore.remotestore)'
14 if not cap:
14 if not cap:
15 raise lfutil.storeprotonotcapable([])
15 raise lfutil.storeprotonotcapable([])
16 storetypes = cap.split(',')
16 storetypes = cap.split(',')
17 if not 'serve' in storetypes:
17 if 'serve' not in storetypes:
18 raise lfutil.storeprotonotcapable(storetypes)
18 raise lfutil.storeprotonotcapable(storetypes)
19 self.remote = remote
19 self.remote = remote
20 super(wirestore, self).__init__(ui, repo, remote.url())
20 super(wirestore, self).__init__(ui, repo, remote.url())
@@ -79,7 +79,7 b' def collect(src, ui):'
79 dirnames.sort()
79 dirnames.sort()
80 relpath = dirpath[len(src) + seplen:]
80 relpath = dirpath[len(src) + seplen:]
81 for filename in sorted(filenames):
81 for filename in sorted(filenames):
82 if not filename[-2:] in ('.d', '.i'):
82 if filename[-2:] not in ('.d', '.i'):
83 continue
83 continue
84 st = os.stat(os.path.join(dirpath, filename))
84 st = os.stat(os.path.join(dirpath, filename))
85 if not stat.S_ISREG(st.st_mode):
85 if not stat.S_ISREG(st.st_mode):
@@ -54,7 +54,7 b' class bundlerevlog(revlog.revlog):'
54 continue
54 continue
55
55
56 for p in (p1, p2):
56 for p in (p1, p2):
57 if not p in self.nodemap:
57 if p not in self.nodemap:
58 raise error.LookupError(p, self.indexfile,
58 raise error.LookupError(p, self.indexfile,
59 _("unknown parent"))
59 _("unknown parent"))
60 # start, size, full unc. size, base (unused), link, p1, p2, node
60 # start, size, full unc. size, base (unused), link, p1, p2, node
@@ -696,7 +696,7 b' class dirstate(object):'
696 visit = sorted([f for f in dmap if f not in results and matchfn(f)])
696 visit = sorted([f for f in dmap if f not in results and matchfn(f)])
697 for nf, st in zip(visit, util.statfiles([join(i) for i in visit])):
697 for nf, st in zip(visit, util.statfiles([join(i) for i in visit])):
698 if (not st is None and
698 if (not st is None and
699 not getkind(st.st_mode) in (regkind, lnkkind)):
699 getkind(st.st_mode) not in (regkind, lnkkind)):
700 st = None
700 st = None
701 results[nf] = st
701 results[nf] = st
702 for s in subrepos:
702 for s in subrepos:
@@ -706,7 +706,7 b' def lsprofile(ui, func, fp):'
706 field = ui.config('profiling', 'sort', default='inlinetime')
706 field = ui.config('profiling', 'sort', default='inlinetime')
707 climit = ui.configint('profiling', 'nested', default=5)
707 climit = ui.configint('profiling', 'nested', default=5)
708
708
709 if not format in ['text', 'kcachegrind']:
709 if format not in ['text', 'kcachegrind']:
710 ui.warn(_("unrecognized profiling format '%s'"
710 ui.warn(_("unrecognized profiling format '%s'"
711 " - Ignored\n") % format)
711 " - Ignored\n") % format)
712 format = 'text'
712 format = 'text'
@@ -136,7 +136,7 b' class ConnectionManager(object):'
136 def add(self, host, connection, ready):
136 def add(self, host, connection, ready):
137 self._lock.acquire()
137 self._lock.acquire()
138 try:
138 try:
139 if not host in self._hostmap:
139 if host not in self._hostmap:
140 self._hostmap[host] = []
140 self._hostmap[host] = []
141 self._hostmap[host].append(connection)
141 self._hostmap[host].append(connection)
142 self._connmap[connection] = host
142 self._connmap[connection] = host
@@ -1659,7 +1659,7 b' def difflabel(func, *args, **kw):'
1659 if line.startswith('@'):
1659 if line.startswith('@'):
1660 head = False
1660 head = False
1661 else:
1661 else:
1662 if line and not line[0] in ' +-@\\':
1662 if line and line[0] not in ' +-@\\':
1663 head = True
1663 head = True
1664 stripline = line
1664 stripline = line
1665 if not head and line and line[0] in '+-':
1665 if not head and line and line[0] in '+-':
@@ -119,7 +119,7 b' else:'
119 flags = _O_TEXT
119 flags = _O_TEXT
120
120
121 m0 = mode[0]
121 m0 = mode[0]
122 if m0 == 'r' and not '+' in mode:
122 if m0 == 'r' and '+' not in mode:
123 flags |= _O_RDONLY
123 flags |= _O_RDONLY
124 access = _GENERIC_READ
124 access = _GENERIC_READ
125 else:
125 else:
@@ -1208,7 +1208,7 b' class revlog(object):'
1208 continue
1208 continue
1209
1209
1210 for p in (p1, p2):
1210 for p in (p1, p2):
1211 if not p in self.nodemap:
1211 if p not in self.nodemap:
1212 raise LookupError(p, self.indexfile,
1212 raise LookupError(p, self.indexfile,
1213 _('unknown parent'))
1213 _('unknown parent'))
1214
1214
@@ -260,7 +260,7 b' def person(author):'
260 >>> person('"Foo Bar <foo@bar>')
260 >>> person('"Foo Bar <foo@bar>')
261 'Foo Bar'
261 'Foo Bar'
262 """
262 """
263 if not '@' in author:
263 if '@' not in author:
264 return author
264 return author
265 f = author.find('<')
265 f = author.find('<')
266 if f != -1:
266 if f != -1:
@@ -312,7 +312,7 b' class templater(object):'
312
312
313 def load(self, t):
313 def load(self, t):
314 '''Get the template for the given template name. Use a local cache.'''
314 '''Get the template for the given template name. Use a local cache.'''
315 if not t in self.cache:
315 if t not in self.cache:
316 try:
316 try:
317 self.cache[t] = util.readfile(self.map[t][1])
317 self.cache[t] = util.readfile(self.map[t][1])
318 except KeyError, inst:
318 except KeyError, inst:
@@ -43,7 +43,7 b' def runtest():'
43 print "reposet = %r" % (reposet,)
43 print "reposet = %r" % (reposet,)
44 print "sub1set and reposet should have exactly one path in common."
44 print "sub1set and reposet should have exactly one path in common."
45 sub3 = pjoin('.', 'circle', 'top1')
45 sub3 = pjoin('.', 'circle', 'top1')
46 if sym and not (sub3 in reposet):
46 if sym and sub3 not in reposet:
47 print "reposet = %r" % (reposet,)
47 print "reposet = %r" % (reposet,)
48 print "Symbolic links are supported and %s is not in reposet" % (sub3,)
48 print "Symbolic links are supported and %s is not in reposet" % (sub3,)
49
49
General Comments 0
You need to be logged in to leave comments. Login now