/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/plugins/stats/cmds.py

  • Committer: Jelmer Vernooij
  • Date: 2019-03-04 05:10:44 UTC
  • mfrom: (7293 work)
  • mto: This revision was merged to the branch mainline in revision 7294.
  • Revision ID: jelmer@jelmer.uk-20190304051044-vph4s8p9qvpy2qe9
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
from __future__ import absolute_import
19
19
 
 
20
import operator
 
21
 
20
22
from ... import (
21
23
    branch,
22
24
    commands,
59
61
            info[2][username] = info[2].setdefault(username, 0) + 1
60
62
    res = [(len(revs), revs, emails, fnames)
61
63
           for revs, emails, fnames in committer_to_info.values()]
62
 
    res.sort(reverse=True)
 
64
    res.sort(reverse=True, key=operator.itemgetter(0))
63
65
    return res
64
66
 
65
67
 
279
281
 
280
282
    encoding_type = 'replace'
281
283
 
 
284
    hidden = True
 
285
 
282
286
    def run(self, location='.'):
283
287
        try:
284
288
            wt = workingtree.WorkingTree.open_containing(location)[0]
311
315
            for delta in repository.get_deltas_for_revisions(revs):
312
316
                pb.update("classifying commits", i, len(revs))
313
317
                for c in classify_delta(delta):
314
 
                    if not c in ret:
 
318
                    if c not in ret:
315
319
                        ret[c] = 0
316
320
                    ret[c] += 1
317
321
                    total += 1
365
369
                    continue
366
370
                for c in set(classify_delta(delta)):
367
371
                    for author in rev.get_apparent_authors():
368
 
                        if not author in ret[c]:
 
372
                        if author not in ret[c]:
369
373
                            ret[c][author] = 0
370
374
                        ret[c][author] += 1
371
375