Mercurial > hg
comparison hgext/churn.py @ 3049:461573aa02ef
[churn] Ignore merge csets
Merge changesets attributed a large number of lines to people that didn't
actually develop it, but simply merged the code. By ignoring merges, we get
a more accurate picture of how much code everyone changed.
author | Josef "Jeff" Sipek <jeffpc@josefsipek.net> |
---|---|
date | Sun, 03 Sep 2006 16:25:41 -0400 |
parents | 8d344bc72e68 |
children | dd1a142988d3 |
comparison
equal
deleted
inserted
replaced
3048:8d344bc72e68 | 3049:461573aa02ef |
---|---|
12 # <alias email> <actual email> | 12 # <alias email> <actual email> |
13 | 13 |
14 from mercurial.demandload import * | 14 from mercurial.demandload import * |
15 from mercurial.i18n import gettext as _ | 15 from mercurial.i18n import gettext as _ |
16 demandload(globals(), 'time sys signal os') | 16 demandload(globals(), 'time sys signal os') |
17 demandload(globals(), 'mercurial:hg,mdiff,fancyopts,commands,ui,util,templater') | 17 demandload(globals(), 'mercurial:hg,mdiff,fancyopts,commands,ui,util,templater,node') |
18 | 18 |
19 def __gather(ui, repo, node1, node2): | 19 def __gather(ui, repo, node1, node2): |
20 def dirtywork(f, mmap1, mmap2): | 20 def dirtywork(f, mmap1, mmap2): |
21 lines = 0 | 21 lines = 0 |
22 | 22 |
79 revs = range(0, cl.count()) | 79 revs = range(0, cl.count()) |
80 | 80 |
81 for rev in revs: | 81 for rev in revs: |
82 node2 = cl.node(rev) | 82 node2 = cl.node(rev) |
83 node1 = cl.parents(node2)[0] | 83 node1 = cl.parents(node2)[0] |
84 | |
85 if cl.parents(node2)[1] != node.nullid: | |
86 ui.note(_('Revision %d is a merge, ignoring...\n') % (rev,)) | |
87 continue | |
84 | 88 |
85 who, lines = __gather(ui, repo, node1, node2) | 89 who, lines = __gather(ui, repo, node1, node2) |
86 | 90 |
87 # remap the owner if possible | 91 # remap the owner if possible |
88 if amap.has_key(who): | 92 if amap.has_key(who): |