##// END OF EJS Templates
scripts: drop isort --wrap-length 160 - it is broken with py3 and not really necessary...
scripts: drop isort --wrap-length 160 - it is broken with py3 and not really necessary Under Python 3, isort 4.3.21 failed with https://github.com/timothycrosley/isort/issues/741 on kallithea/controllers/api/api.py : Traceback (most recent call last): File "data/env/bin/isort", line 10, in <module> sys.exit(main()) File ".../env/lib64/python3.7/site-packages/isort/main.py", line 379, in main for sort_attempt in attempt_iterator: File ".../env/lib64/python3.7/site-packages/isort/main.py", line 377, in <genexpr> attempt_iterator = (sort_imports(file_name, **arguments) for file_name in file_names) File ".../env/lib64/python3.7/site-packages/isort/main.py", line 88, in sort_imports result = SortImports(file_name, **arguments) File ".../env/lib64/python3.7/site-packages/isort/isort.py", line 207, in __init__ self._add_formatted_imports() File ".../env/lib64/python3.7/site-packages/isort/isort.py", line 606, in _add_formatted_imports self._add_from_imports(from_modules, section, section_output, sort_ignore_case) File ".../env/lib64/python3.7/site-packages/isort/isort.py", line 526, in _add_from_imports import_statement = self._multi_line_reformat(import_start, from_import_section, comments) File ".../env/lib64/python3.7/site-packages/isort/isort.py", line 552, in _multi_line_reformat dynamic_indent, indent, line_length, comments) File ".../env/lib64/python3.7/site-packages/isort/isort.py", line 705, in _output_grid if len(next_statement.split(self.line_separator)[-1]) + 1 > line_length: TypeError: '>' not supported between instances of 'int' and 'str'

File last commit:

r8053:aa6f17a5 default
r8157:5b1f4302 default
Show More
shortlog.py
36 lines | 1.0 KiB | text/x-python | PythonLexer
Mads Kiilerich
py3: switch to use Python 3 interpreter, temporarily leaving many things very broken until they have been migrated/fixed in a reviewable way...
r8053 #!/usr/bin/env python3
Thomas De Schampheleire
scripts/shortlog: new script...
r7497 # -*- coding: utf-8 -*-
"""
Kallithea script for generating a quick overview of contributors and their
commit counts in a given revision set.
"""
import argparse
import os
from collections import Counter
Mads Kiilerich
scripts: initial run of import cleanup using isort
r7718
Mads Kiilerich
scripts: use explicit relative imports of contributor_data...
r8041 from . import contributor_data
Thomas De Schampheleire
scripts/shortlog: new script...
r7497
Mads Kiilerich
scripts: initial run of import cleanup using isort
r7718
Thomas De Schampheleire
scripts/shortlog: new script...
r7497 def main():
parser = argparse.ArgumentParser(description='Generate a list of committers and commit counts.')
parser.add_argument('revset',
help='revision set specifying the commits to count')
args = parser.parse_args()
repo_entries = [
(contributor_data.name_fixes.get(name) or contributor_data.name_fixes.get(name.rsplit('<', 1)[0].strip()) or name).rsplit('<', 1)[0].strip()
for name in (line.strip()
for line in os.popen("""hg log -r '%s' -T '{author}\n'""" % args.revset).readlines())
]
counter = Counter(repo_entries)
for name, count in counter.most_common():
if name == '':
continue
print('%4s %s' % (count, name))
if __name__ == '__main__':
main()