/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/fastimport/processors/info_processor.py

  • Committer: Martin
  • Date: 2017-06-05 20:48:31 UTC
  • mto: This revision was merged to the branch mainline in revision 6658.
  • Revision ID: gzlist@googlemail.com-20170605204831-20accykspjcrx0a8
Apply 2to3 dict fixer and clean up resulting mess using view helpers

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
        # Commit stats
88
88
        if self.cmd_counts['commit']:
89
89
            p_items = []
90
 
            for _ in range(self.max_parent_count + 1):
 
90
            for i in range(self.max_parent_count + 1):
91
91
                if i in self.parent_counts:
92
92
                    count = self.parent_counts[i]
93
93
                    p_items.append(("parents-%d" % i, count))
94
 
            merges_count = len(self.merges.keys())
 
94
            merges_count = len(self.merges)
95
95
            p_items.append(('total revisions merged', merges_count))
96
96
            flags = {
97
97
                'separate authors found': self.separate_authors_found,
100
100
                'blobs referenced by SHA': self.sha_blob_references,
101
101
                }
102
102
            self._dump_stats_group("Parent counts", p_items, str)
103
 
            self._dump_stats_group("Commit analysis", flags.iteritems(), _found)
 
103
            self._dump_stats_group("Commit analysis", flags.items(), _found)
104
104
            heads = invert_dictset(self.reftracker.heads)
105
 
            self._dump_stats_group("Head analysis", heads.iteritems(), None,
 
105
            self._dump_stats_group("Head analysis", heads.items(), None,
106
106
                                    _iterable_as_config_list)
107
107
            # note("\t%d\t%s" % (len(self.committers), 'unique committers'))
108
 
            self._dump_stats_group("Merges", self.merges.iteritems(), None)
 
108
            self._dump_stats_group("Merges", self.merges.items(), None)
109
109
            # We only show the rename old path and copy source paths when -vv
110
110
            # (verbose=2) is specified. The output here for mysql's data can't
111
111
            # be parsed currently so this bit of code needs more work anyhow ..
112
112
            if self.verbose >= 2:
113
113
                self._dump_stats_group("Rename old paths",
114
 
                    self.rename_old_paths.iteritems(), len,
 
114
                    self.rename_old_paths.items(), len,
115
115
                    _iterable_as_config_list)
116
116
                self._dump_stats_group("Copy source paths",
117
 
                    self.copy_source_paths.iteritems(), len,
 
117
                    self.copy_source_paths.items(), len,
118
118
                    _iterable_as_config_list)
119
119
 
120
120
        # Blob stats
123
123
            if self.verbose:
124
124
                del self.blobs['used']
125
125
            self._dump_stats_group("Blob usage tracking",
126
 
                self.blobs.iteritems(), len, _iterable_as_config_list)
 
126
                self.blobs.items(), len, _iterable_as_config_list)
127
127
        if self.blob_ref_counts:
128
128
            blobs_by_count = invert_dict(self.blob_ref_counts)
129
 
            blob_items = blobs_by_count.items()
130
 
            blob_items.sort()
 
129
            blob_items = sorted(blobs_by_count.items())
131
130
            self._dump_stats_group("Blob reference counts",
132
131
                blob_items, len, _iterable_as_config_list)
133
132
 
136
135
            reset_stats = {
137
136
                'lightweight tags': self.lightweight_tags,
138
137
                }
139
 
            self._dump_stats_group("Reset analysis", reset_stats.iteritems())
 
138
            self._dump_stats_group("Reset analysis", reset_stats.items())
140
139
 
141
140
    def _dump_stats_group(self, title, items, normal_formatter=None,
142
141
        verbose_formatter=None):