Mercurial > hg > mercurial-crew-with-dirclash
comparison contrib/churn.py @ 3057:50e0392d51df
Fix for Python 2.3 compatibility.
Note: Name of comparing function of sort() is "cmpfunc" in Python 2.3
and "cmp" in Python 2.4.
author | Shun-ichi GOTO <shunichi.goto@gmail.com> |
---|---|
date | Tue, 05 Sep 2006 12:40:45 +0900 |
parents | 51083c31db04 |
children | eeaf9bcdfa25 |
comparison
equal
deleted
inserted
replaced
3049:51083c31db04 | 3057:50e0392d51df |
---|---|
154 revs.sort() | 154 revs.sort() |
155 stats = gather_stats(ui, repo, amap, revs, opts.get('progress')) | 155 stats = gather_stats(ui, repo, amap, revs, opts.get('progress')) |
156 | 156 |
157 # make a list of tuples (name, lines) and sort it in descending order | 157 # make a list of tuples (name, lines) and sort it in descending order |
158 ordered = stats.items() | 158 ordered = stats.items() |
159 ordered.sort(cmp=lambda x, y: cmp(y[1], x[1])) | 159 ordered.sort(lambda x, y: cmp(y[1], x[1])) |
160 | 160 |
161 maximum = ordered[0][1] | 161 maximum = ordered[0][1] |
162 | 162 |
163 ui.note("Assuming 80 character terminal\n") | 163 ui.note("Assuming 80 character terminal\n") |
164 width = 80 - 1 | 164 width = 80 - 1 |