Merge lp:~gz/brz/lint_E71 into lp:brz

Proposed by Martin Packman on 2018-11-17
Status: Merged
Approved by: Jelmer Vernooij on 2018-11-17
Approved revision: 7184
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~gz/brz/lint_E71
Merge into: lp:brz
Diff against target: 416 lines (+37/-41)
25 files modified
breezy/bzr/check.py (+1/-1)
breezy/bzr/groupcompress.py (+1/-1)
breezy/bzr/inventorytree.py (+3/-3)
breezy/bzr/remote.py (+1/-1)
breezy/bzr/repository.py (+1/-1)
breezy/bzr/smart/vfs.py (+2/-2)
breezy/git/fetch.py (+1/-1)
breezy/plugins/email/emailer.py (+1/-1)
breezy/plugins/fastimport/helpers.py (+2/-2)
breezy/plugins/fastimport/processors/generic_processor.py (+1/-1)
breezy/plugins/grep/cmds.py (+2/-2)
breezy/plugins/stats/cmds.py (+2/-2)
breezy/plugins/weave_fmt/store/__init__.py (+1/-1)
breezy/plugins/weave_fmt/workingtree.py (+1/-1)
breezy/push.py (+1/-1)
breezy/shelf.py (+3/-3)
breezy/status.py (+1/-1)
breezy/symbol_versioning.py (+1/-1)
breezy/tests/__init__.py (+1/-1)
breezy/tests/test_config.py (+1/-1)
breezy/transport/__init__.py (+2/-2)
breezy/transport/memory.py (+4/-4)
setup.cfg (+0/-4)
setup.py (+1/-1)
tools/win32/brz_postinstall.py (+2/-2)
To merge this branch: bzr merge lp:~gz/brz/lint_E71
Reviewer Review Type Date Requested Status
Jelmer Vernooij 2018-11-17 Approve on 2018-11-17
Review via email: mp+358946@code.launchpad.net

Description of the change

Fix E71* lint errors

Mostly moving nots around and a few equality to idenity check changes.

To post a comment you must log in.
Jelmer Vernooij (jelmer) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/bzr/check.py'
2--- breezy/bzr/check.py 2018-11-11 04:08:32 +0000
3+++ breezy/bzr/check.py 2018-11-17 17:05:54 +0000
4@@ -268,7 +268,7 @@
5 self.ghosts.discard(rev_id)
6 # Count all parents as ghosts if we haven't seen them yet.
7 for parent in rev.parent_ids:
8- if not parent in self.planned_revisions:
9+ if parent not in self.planned_revisions:
10 self.ghosts.add(parent)
11
12 self.ancestors[rev_id] = tuple(rev.parent_ids) or (NULL_REVISION,)
13
14=== modified file 'breezy/bzr/groupcompress.py'
15--- breezy/bzr/groupcompress.py 2018-11-12 01:41:38 +0000
16+++ breezy/bzr/groupcompress.py 2018-11-17 17:05:54 +0000
17@@ -1628,7 +1628,7 @@
18 """See VersionedFiles.get_sha1s()."""
19 result = {}
20 for record in self.get_record_stream(keys, 'unordered', True):
21- if record.sha1 != None:
22+ if record.sha1 is not None:
23 result[record.key] = record.sha1
24 else:
25 if record.storage_kind != 'absent':
26
27=== modified file 'breezy/bzr/inventorytree.py'
28--- breezy/bzr/inventorytree.py 2018-11-16 18:33:17 +0000
29+++ breezy/bzr/inventorytree.py 2018-11-17 17:05:54 +0000
30@@ -197,7 +197,7 @@
31 inventory_file_ids = []
32 for path in specific_files:
33 inventory, inv_file_id = self._path2inv_file_id(path)
34- if not inventory is self.root_inventory: # for now
35+ if inventory is not self.root_inventory: # for now
36 raise AssertionError("%r != %r" % (
37 inventory, self.root_inventory))
38 inventory_file_ids.append(inv_file_id)
39@@ -917,9 +917,9 @@
40 changed_file_ids = set(changed_file_ids)
41 for relpath, entry in self.target.root_inventory.iter_entries():
42 if (specific_file_ids is not None and
43- not entry.file_id in specific_file_ids):
44+ entry.file_id not in specific_file_ids):
45 continue
46- if not entry.file_id in changed_file_ids:
47+ if entry.file_id not in changed_file_ids:
48 yield (entry.file_id,
49 (relpath, relpath), # Not renamed
50 False, # Not modified
51
52=== modified file 'breezy/bzr/remote.py'
53--- breezy/bzr/remote.py 2018-11-11 04:08:32 +0000
54+++ breezy/bzr/remote.py 2018-11-17 17:05:54 +0000
55@@ -2268,7 +2268,7 @@
56 unused.append(decompressor.unused_data)
57 unused = b""
58 while True:
59- while not b"\n" in unused:
60+ while b"\n" not in unused:
61 try:
62 unused += next(byte_stream)
63 except StopIteration:
64
65=== modified file 'breezy/bzr/repository.py'
66--- breezy/bzr/repository.py 2018-11-11 04:08:32 +0000
67+++ breezy/bzr/repository.py 2018-11-17 17:05:54 +0000
68@@ -135,7 +135,7 @@
69 control_files = self._create_control_files(a_bzrdir)
70 control_files.lock_write()
71 transport = control_files._transport
72- if shared == True:
73+ if shared is True:
74 utf8_files += [('shared-storage', b'')]
75 try:
76 for dir in dirs:
77
78=== modified file 'breezy/bzr/smart/vfs.py'
79--- breezy/bzr/smart/vfs.py 2018-11-11 04:08:32 +0000
80+++ breezy/bzr/smart/vfs.py 2018-11-17 17:05:54 +0000
81@@ -46,9 +46,9 @@
82
83 the VFS is disabled when the BRZ_NO_SMART_VFS environment variable is set.
84
85- :return: True if it is enabled.
86+ :return: ``True`` if it is enabled.
87 """
88- return not 'BRZ_NO_SMART_VFS' in os.environ
89+ return 'BRZ_NO_SMART_VFS' not in os.environ
90
91
92 class VfsRequest(request.SmartServerRequest):
93
94=== modified file 'breezy/git/fetch.py'
95--- breezy/git/fetch.py 2018-11-16 18:33:17 +0000
96+++ breezy/git/fetch.py 2018-11-17 17:05:54 +0000
97@@ -138,7 +138,7 @@
98 ie.revision = ptree.get_file_revision(ppath)
99 break
100 parent_key = (file_id, ptree.get_file_revision(ppath))
101- if not parent_key in parent_keys:
102+ if parent_key not in parent_keys:
103 parent_keys.append(parent_key)
104 if ie.revision is None:
105 # Need to store a new revision
106
107=== modified file 'breezy/plugins/email/emailer.py'
108--- breezy/plugins/email/emailer.py 2018-11-11 04:08:32 +0000
109+++ breezy/plugins/email/emailer.py 2018-11-17 17:05:54 +0000
110@@ -247,7 +247,7 @@
111 msg.add_inline_attachment(diff, self.diff_filename())
112
113 # Add revision_mail_headers to the headers
114- if header != None:
115+ if header is None:
116 for k, v in header.items():
117 msg[k] = v
118
119
120=== modified file 'breezy/plugins/fastimport/helpers.py'
121--- breezy/plugins/fastimport/helpers.py 2018-11-11 04:08:32 +0000
122+++ breezy/plugins/fastimport/helpers.py 2018-11-17 17:05:54 +0000
123@@ -121,9 +121,9 @@
124
125 def kind_to_mode(kind, executable):
126 if kind == "file":
127- if executable == True:
128+ if executable is True:
129 return stat.S_IFREG | 0o755
130- elif executable == False:
131+ elif executable is False:
132 return stat.S_IFREG | 0o644
133 else:
134 raise AssertionError("Executable %r invalid" % executable)
135
136=== modified file 'breezy/plugins/fastimport/processors/generic_processor.py'
137--- breezy/plugins/fastimport/processors/generic_processor.py 2018-11-11 04:08:32 +0000
138+++ breezy/plugins/fastimport/processors/generic_processor.py 2018-11-17 17:05:54 +0000
139@@ -310,7 +310,7 @@
140 marks_file.export_marks(self.params.get("export-marks"),
141 self.cache_mgr.marks)
142
143- if self.cache_mgr.reftracker.last_ref == None:
144+ if self.cache_mgr.reftracker.last_ref is None:
145 """Nothing to refresh"""
146 return
147
148
149=== modified file 'breezy/plugins/grep/cmds.py'
150--- breezy/plugins/grep/cmds.py 2018-11-11 04:08:32 +0000
151+++ breezy/plugins/grep/cmds.py 2018-11-17 17:05:54 +0000
152@@ -178,11 +178,11 @@
153 raise errors.BzrCommandError('Valid values for --color are '
154 '"always", "never" or "auto".')
155
156- if levels == None:
157+ if levels is None:
158 levels = 1
159
160 print_revno = False
161- if revision != None or levels == 0:
162+ if revision is not None or levels == 0:
163 # print revision numbers as we may be showing multiple revisions
164 print_revno = True
165
166
167=== modified file 'breezy/plugins/stats/cmds.py'
168--- breezy/plugins/stats/cmds.py 2018-11-11 04:08:32 +0000
169+++ breezy/plugins/stats/cmds.py 2018-11-17 17:05:54 +0000
170@@ -311,7 +311,7 @@
171 for delta in repository.get_deltas_for_revisions(revs):
172 pb.update("classifying commits", i, len(revs))
173 for c in classify_delta(delta):
174- if not c in ret:
175+ if c not in ret:
176 ret[c] = 0
177 ret[c] += 1
178 total += 1
179@@ -365,7 +365,7 @@
180 continue
181 for c in set(classify_delta(delta)):
182 for author in rev.get_apparent_authors():
183- if not author in ret[c]:
184+ if author not in ret[c]:
185 ret[c][author] = 0
186 ret[c][author] += 1
187
188
189=== modified file 'breezy/plugins/weave_fmt/store/__init__.py'
190--- breezy/plugins/weave_fmt/store/__init__.py 2018-11-11 04:08:32 +0000
191+++ breezy/plugins/weave_fmt/store/__init__.py 2018-11-17 17:05:54 +0000
192@@ -215,7 +215,7 @@
193 self._check_fileid(fileid)
194 if suffixes:
195 for suffix in suffixes:
196- if not suffix in self._suffixes:
197+ if suffix not in self._suffixes:
198 raise ValueError("Unregistered suffix %r" % suffix)
199 self._check_fileid(suffix.encode('utf-8'))
200 else:
201
202=== modified file 'breezy/plugins/weave_fmt/workingtree.py'
203--- breezy/plugins/weave_fmt/workingtree.py 2018-11-11 04:08:32 +0000
204+++ breezy/plugins/weave_fmt/workingtree.py 2018-11-17 17:05:54 +0000
205@@ -234,7 +234,7 @@
206 text = False
207 except errors.NoSuchFile:
208 text = False
209- if text == False:
210+ if text is False:
211 break
212 ctype = {True: 'text conflict',
213 False: 'contents conflict'}[text]
214
215=== modified file 'breezy/push.py'
216--- breezy/push.py 2018-11-16 18:40:46 +0000
217+++ breezy/push.py 2018-11-17 17:05:54 +0000
218@@ -162,7 +162,7 @@
219 " control directory, but not a branch or repository. This"
220 " is an unsupported configuration. Please move the target"
221 " directory out of the way and try again.") % location)
222- if push_result.workingtree_updated == False:
223+ if push_result.workingtree_updated is False:
224 warning("This transport does not update the working "
225 "tree of: %s. See 'brz help working-trees' for "
226 "more information." % push_result.target_branch.base)
227
228=== modified file 'breezy/shelf.py'
229--- breezy/shelf.py 2018-11-16 18:33:17 +0000
230+++ breezy/shelf.py 2018-11-17 17:05:54 +0000
231@@ -109,11 +109,11 @@
232 # Also don't shelve deletion of tree root.
233 if kind[1] is None and names[0] == '':
234 continue
235- if kind[0] is None or versioned[0] == False:
236+ if kind[0] is None or versioned[0] is False:
237 self.creation[file_id] = (kind[1], names[1], parents[1],
238 versioned)
239 yield ('add file', file_id, kind[1], paths[1])
240- elif kind[1] is None or versioned[0] == False:
241+ elif kind[1] is None or versioned[0] is False:
242 self.deletion[file_id] = (kind[0], names[0], parents[0],
243 versioned)
244 yield ('delete file', file_id, kind[0], paths[0])
245@@ -150,7 +150,7 @@
246 def shelve_all(self):
247 """Shelve all changes.
248
249- :return: True if changes were shelved, False if there were no changes.
250+ :return: ``True`` if changes were shelved, otherwise ``False``.
251 """
252 change = None
253 for change in self.iter_shelvable():
254
255=== modified file 'breezy/status.py'
256--- breezy/status.py 2018-11-12 01:41:38 +0000
257+++ breezy/status.py 2018-11-17 17:05:54 +0000
258@@ -341,7 +341,7 @@
259 s = old_tree.filter_unversioned_files(orig_paths)
260 s = new_tree.filter_unversioned_files(s)
261 nonexistent = [path for path in s if not new_tree.has_filename(path)]
262- remaining = [path for path in orig_paths if not path in nonexistent]
263+ remaining = [path for path in orig_paths if path not in nonexistent]
264 # Sorting the 'remaining' list doesn't have much effect in
265 # practice, since the various status output sections will sort
266 # their groups individually. But for consistency of this
267
268=== modified file 'breezy/symbol_versioning.py'
269--- breezy/symbol_versioning.py 2018-11-12 01:41:38 +0000
270+++ breezy/symbol_versioning.py 2018-11-17 17:05:54 +0000
271@@ -79,7 +79,7 @@
272 symbol = "%s.%s.%s" % (a_callable.__self__.__class__.__module__,
273 a_callable.__self__.__class__.__name__,
274 a_callable.__name__)
275- elif getattr(a_callable, '__qualname__', None) is not None and not '<' in a_callable.__qualname__:
276+ elif getattr(a_callable, '__qualname__', None) is not None and '<' not in a_callable.__qualname__:
277 symbol = "%s.%s" % (a_callable.__module__,
278 a_callable.__qualname__)
279 else:
280
281=== modified file 'breezy/tests/__init__.py'
282--- breezy/tests/__init__.py 2018-11-16 12:32:43 +0000
283+++ breezy/tests/__init__.py 2018-11-17 17:05:54 +0000
284@@ -4544,7 +4544,7 @@
285 # We don't want to fail here because some useful display will be lost
286 # otherwise. Polluting the tmp dir is bad, but not giving all the
287 # possible info to the test runner is even worse.
288- if test_id != None:
289+ if test_id is not None:
290 ui.ui_factory.clear_term()
291 sys.stderr.write('\nWhile running: %s\n' % (test_id,))
292 # Ugly, but the last thing we want here is fail, so bear with it.
293
294=== modified file 'breezy/tests/test_config.py'
295--- breezy/tests/test_config.py 2018-11-11 04:08:32 +0000
296+++ breezy/tests/test_config.py 2018-11-17 17:05:54 +0000
297@@ -4597,7 +4597,7 @@
298 def get_credentials(self, scheme, host, port=None, user=None,
299 path=None, realm=None):
300 key = (scheme, host)
301- if not key in self._username:
302+ if key not in self._username:
303 return None
304 return {"scheme": scheme, "host": host, "port": port,
305 "user": self._username[key], "password": self._password[key]}
306
307=== modified file 'breezy/transport/__init__.py'
308--- breezy/transport/__init__.py 2018-11-11 04:08:32 +0000
309+++ breezy/transport/__init__.py 2018-11-17 17:05:54 +0000
310@@ -134,14 +134,14 @@
311
312
313 def register_lazy_transport(prefix, module, classname):
314- if not prefix in transport_list_registry:
315+ if prefix not in transport_list_registry:
316 register_transport_proto(prefix)
317 transport_list_registry.register_lazy_transport_provider(
318 prefix, module, classname)
319
320
321 def register_transport(prefix, klass):
322- if not prefix in transport_list_registry:
323+ if prefix not in transport_list_registry:
324 register_transport_proto(prefix)
325 transport_list_registry.register_transport_provider(prefix, klass)
326
327
328=== modified file 'breezy/transport/memory.py'
329--- breezy/transport/memory.py 2018-11-11 04:08:32 +0000
330+++ breezy/transport/memory.py 2018-11-17 17:05:54 +0000
331@@ -122,7 +122,7 @@
332 def _check_parent(self, _abspath):
333 dir = os.path.dirname(_abspath)
334 if dir != '/':
335- if not dir in self._dirs:
336+ if dir not in self._dirs:
337 raise NoSuchFile(_abspath)
338
339 def has(self, relpath):
340@@ -135,7 +135,7 @@
341 def delete(self, relpath):
342 """See Transport.delete()."""
343 _abspath = self._abspath(relpath)
344- if not _abspath in self._files:
345+ if _abspath not in self._files:
346 raise NoSuchFile(relpath)
347 del self._files[_abspath]
348
349@@ -148,7 +148,7 @@
350 def get(self, relpath):
351 """See Transport.get()."""
352 _abspath = self._abspath(relpath)
353- if not _abspath in self._files:
354+ if _abspath not in self._files:
355 if _abspath in self._dirs:
356 return LateReadError(relpath)
357 else:
358@@ -255,7 +255,7 @@
359 if path.startswith(_abspath + '/') and path != _abspath:
360 self._translate_error(
361 IOError(errno.ENOTEMPTY, relpath), relpath)
362- if not _abspath in self._dirs:
363+ if _abspath not in self._dirs:
364 raise NoSuchFile(relpath)
365 del self._dirs[_abspath]
366
367
368=== modified file 'setup.cfg'
369--- setup.cfg 2018-11-17 16:19:11 +0000
370+++ setup.cfg 2018-11-17 17:05:54 +0000
371@@ -24,10 +24,6 @@
372 E502
373 E702
374 E704
375- E711
376- E712
377- E713
378- E714
379 E722
380 E731
381 E741
382
383=== modified file 'setup.py'
384--- setup.py 2018-11-16 13:15:40 +0000
385+++ setup.py 2018-11-17 17:05:54 +0000
386@@ -743,7 +743,7 @@
387 else:
388 # ad-hoc for easy_install
389 DATA_FILES = []
390- if not 'bdist_egg' in sys.argv:
391+ if 'bdist_egg' not in sys.argv:
392 # generate and install brz.1 only with plain install, not the
393 # easy_install one
394 DATA_FILES = [('man/man1', ['brz.1', 'breezy/git/git-remote-bzr.1'])]
395
396=== modified file 'tools/win32/brz_postinstall.py'
397--- tools/win32/brz_postinstall.py 2018-11-16 13:15:40 +0000
398+++ tools/win32/brz_postinstall.py 2018-11-17 17:05:54 +0000
399@@ -239,7 +239,7 @@
400 _winreg.SetValueEx(hkey, 'Path', 0, type_, path_u)
401 _winreg.FlushKey(hkey)
402
403- if not hkey is None:
404+ if hkey not is None:
405 _winreg.CloseKey(hkey)
406
407 if (add_path or delete_path) and winver == 'Windows 98':
408@@ -305,7 +305,7 @@
409 'EnvironmentError',
410 MB_OK | MB_ICONERROR)
411
412- if not hkey is None:
413+ if hkey not is None:
414 _winreg.SetValue(hkey, '', _winreg.REG_SZ, 'Brz Here')
415 hkey2 = _winreg.CreateKey(hkey, 'command')
416 _winreg.SetValue(hkey2, '', _winreg.REG_SZ,

Subscribers

People subscribed via source and target branches