##// END OF EJS Templates
cleanup: re-run black on the codebase...
Augie Fackler -
r44787:a0ec05d9 default
parent child Browse files
Show More
@@ -291,8 +291,8 b' class branchcache(object):'
291 % (
291 % (
292 _branchcachedesc(repo),
292 _branchcachedesc(repo),
293 pycompat.bytestr(
293 pycompat.bytestr(
294 inst # pytype: disable=wrong-arg-types
294 inst
295 ),
295 ), # pytype: disable=wrong-arg-types
296 )
296 )
297 )
297 )
298 bcache = None
298 bcache = None
@@ -1149,8 +1149,8 b' class cgpacker(object):'
1149 if fastpathlinkrev:
1149 if fastpathlinkrev:
1150 assert not tree
1150 assert not tree
1151 return (
1151 return (
1152 manifests.__getitem__ # pytype: disable=unsupported-operands
1152 manifests.__getitem__
1153 )
1153 ) # pytype: disable=unsupported-operands
1154
1154
1155 def lookupmflinknode(x):
1155 def lookupmflinknode(x):
1156 """Callback for looking up the linknode for manifests.
1156 """Callback for looking up the linknode for manifests.
@@ -170,7 +170,12 b' logopts = ['
170
170
171 diffopts = [
171 diffopts = [
172 (b'a', b'text', None, _(b'treat all files as text')),
172 (b'a', b'text', None, _(b'treat all files as text')),
173 (b'g', b'git', None, _(b'use git extended diff format (DEFAULT: diff.git)')),
173 (
174 b'g',
175 b'git',
176 None,
177 _(b'use git extended diff format (DEFAULT: diff.git)'),
178 ),
174 (b'', b'binary', None, _(b'generate binary diffs in git mode (default)')),
179 (b'', b'binary', None, _(b'generate binary diffs in git mode (default)')),
175 (b'', b'nodates', None, _(b'omit dates from diff headers')),
180 (b'', b'nodates', None, _(b'omit dates from diff headers')),
176 ]
181 ]
@@ -209,7 +214,9 b' diffopts2 = ('
209 b'p',
214 b'p',
210 b'show-function',
215 b'show-function',
211 None,
216 None,
212 _(b'show which function each change is in (DEFAULT: diff.showfunc)'),
217 _(
218 b'show which function each change is in (DEFAULT: diff.showfunc)'
219 ),
213 ),
220 ),
214 (b'', b'reverse', None, _(b'produce a diff that undoes the changes')),
221 (b'', b'reverse', None, _(b'produce a diff that undoes the changes')),
215 ]
222 ]
@@ -6646,7 +6646,12 b' def shelve(ui, repo, *pats, **opts):'
6646 (b'i', b'ignored', None, _(b'show only ignored files')),
6646 (b'i', b'ignored', None, _(b'show only ignored files')),
6647 (b'n', b'no-status', None, _(b'hide status prefix')),
6647 (b'n', b'no-status', None, _(b'hide status prefix')),
6648 (b't', b'terse', _NOTTERSE, _(b'show the terse output (EXPERIMENTAL)')),
6648 (b't', b'terse', _NOTTERSE, _(b'show the terse output (EXPERIMENTAL)')),
6649 (b'C', b'copies', None, _(b'show source of copied files (DEFAULT: ui.statuscopies)')),
6649 (
6650 b'C',
6651 b'copies',
6652 None,
6653 _(b'show source of copied files (DEFAULT: ui.statuscopies)'),
6654 ),
6650 (
6655 (
6651 b'0',
6656 b'0',
6652 b'print0',
6657 b'print0',
@@ -3429,6 +3429,7 b' def debugsuccessorssets(ui, repo, *revs,'
3429 ui.write(node2str(node))
3429 ui.write(node2str(node))
3430 ui.write(b'\n')
3430 ui.write(b'\n')
3431
3431
3432
3432 @command(b'debugtagscache', [])
3433 @command(b'debugtagscache', [])
3433 def debugtagscache(ui, repo):
3434 def debugtagscache(ui, repo):
3434 """display the contents of .hg/cache/hgtagsfnodes1"""
3435 """display the contents of .hg/cache/hgtagsfnodes1"""
@@ -3439,6 +3440,7 b' def debugtagscache(ui, repo):'
3439 tagsnodedisplay = hex(tagsnode) if tagsnode else 'missing/invalid'
3440 tagsnodedisplay = hex(tagsnode) if tagsnode else 'missing/invalid'
3440 ui.write(b'%s %s %s\n' % (r, hex(node), tagsnodedisplay))
3441 ui.write(b'%s %s %s\n' % (r, hex(node), tagsnodedisplay))
3441
3442
3443
3442 @command(
3444 @command(
3443 b'debugtemplate',
3445 b'debugtemplate',
3444 [
3446 [
@@ -448,7 +448,7 b' def checkheads(pushop):'
448 if branch not in (b'default', None):
448 if branch not in (b'default', None):
449 errormsg = _(
449 errormsg = _(
450 b"push creates new remote head %s on branch '%s'!"
450 b"push creates new remote head %s on branch '%s'!"
451 ) % (short(dhs[0]), branch)
451 ) % (short(dhs[0]), branch,)
452 elif repo[dhs[0]].bookmarks():
452 elif repo[dhs[0]].bookmarks():
453 errormsg = _(
453 errormsg = _(
454 b"push creates new remote head %s "
454 b"push creates new remote head %s "
@@ -624,7 +624,7 b' class cmdalias(object):'
624 except error.AmbiguousCommand:
624 except error.AmbiguousCommand:
625 self.badalias = _(
625 self.badalias = _(
626 b"alias '%s' resolves to ambiguous command '%s'"
626 b"alias '%s' resolves to ambiguous command '%s'"
627 ) % (self.name, cmd)
627 ) % (self.name, cmd,)
628
628
629 def _populatehelp(self, ui, name, cmd, fn, defaulthelp=None):
629 def _populatehelp(self, ui, name, cmd, fn, defaulthelp=None):
630 # confine strings to be passed to i18n.gettext()
630 # confine strings to be passed to i18n.gettext()
@@ -152,6 +152,7 b' def extshelp(ui):'
152 doc = b''.join(rst)
152 doc = b''.join(rst)
153 return doc
153 return doc
154
154
155
155 def parsedefaultmarker(text):
156 def parsedefaultmarker(text):
156 """given a text 'abc (DEFAULT: def.ghi)',
157 """given a text 'abc (DEFAULT: def.ghi)',
157 returns (b'abc', (b'def', b'ghi')). Otherwise return None"""
158 returns (b'abc', (b'def', b'ghi')). Otherwise return None"""
@@ -159,9 +160,10 b' def parsedefaultmarker(text):'
159 marker = b' (DEFAULT: '
160 marker = b' (DEFAULT: '
160 pos = text.find(marker)
161 pos = text.find(marker)
161 if pos >= 0:
162 if pos >= 0:
162 item = text[pos + len(marker):-1]
163 item = text[pos + len(marker) : -1]
163 return text[:pos], item.split(b'.', 2)
164 return text[:pos], item.split(b'.', 2)
164
165
166
165 def optrst(header, options, verbose, ui):
167 def optrst(header, options, verbose, ui):
166 data = []
168 data = []
167 multioccur = False
169 multioccur = False
@@ -734,7 +736,9 b' def help_('
734
736
735 if ui.verbose:
737 if ui.verbose:
736 rst.append(
738 rst.append(
737 optrst(_(b"global options"), commands.globalopts, ui.verbose, ui)
739 optrst(
740 _(b"global options"), commands.globalopts, ui.verbose, ui
741 )
738 )
742 )
739
743
740 if not ui.verbose:
744 if not ui.verbose:
@@ -874,7 +878,9 b' def help_('
874 elif ui.verbose:
878 elif ui.verbose:
875 rst.append(
879 rst.append(
876 b'\n%s\n'
880 b'\n%s\n'
877 % optrst(_(b"global options"), commands.globalopts, ui.verbose, ui)
881 % optrst(
882 _(b"global options"), commands.globalopts, ui.verbose, ui
883 )
878 )
884 )
879 if name == b'shortlist':
885 if name == b'shortlist':
880 rst.append(
886 rst.append(
@@ -324,9 +324,8 b' def checklink(path):'
324 open(fullpath, b'w').close()
324 open(fullpath, b'w').close()
325 except IOError as inst:
325 except IOError as inst:
326 if (
326 if (
327 inst[0] # pytype: disable=unsupported-operands
327 inst[0] == errno.EACCES
328 == errno.EACCES
328 ): # pytype: disable=unsupported-operands
329 ):
330 # If we can't write to cachedir, just pretend
329 # If we can't write to cachedir, just pretend
331 # that the fs is readonly and by association
330 # that the fs is readonly and by association
332 # that the fs won't support symlinks. This
331 # that the fs won't support symlinks. This
@@ -720,7 +720,9 b' class hgtagsfnodescache(object):'
720
720
721 self._dirtyoffset = None
721 self._dirtyoffset = None
722
722
723 rawlentokeep = min(wantedlen, (rawlen / _fnodesrecsize) * _fnodesrecsize)
723 rawlentokeep = min(
724 wantedlen, (rawlen / _fnodesrecsize) * _fnodesrecsize
725 )
724 if rawlen > rawlentokeep:
726 if rawlen > rawlentokeep:
725 # There's no easy way to truncate array instances. This seems
727 # There's no easy way to truncate array instances. This seems
726 # slightly less evil than copying a potentially large array slice.
728 # slightly less evil than copying a potentially large array slice.
General Comments 0
You need to be logged in to leave comments. Login now