[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.
--- a/hgext/churn.py Sun Sep 03 16:23:18 2006 -0400
+++ b/hgext/churn.py Sun Sep 03 16:25:41 2006 -0400
@@ -14,7 +14,7 @@
from mercurial.demandload import *
from mercurial.i18n import gettext as _
demandload(globals(), 'time sys signal os')
-demandload(globals(), 'mercurial:hg,mdiff,fancyopts,commands,ui,util,templater')
+demandload(globals(), 'mercurial:hg,mdiff,fancyopts,commands,ui,util,templater,node')
def __gather(ui, repo, node1, node2):
def dirtywork(f, mmap1, mmap2):
@@ -82,6 +82,10 @@
node2 = cl.node(rev)
node1 = cl.parents(node2)[0]
+ if cl.parents(node2)[1] != node.nullid:
+ ui.note(_('Revision %d is a merge, ignoring...\n') % (rev,))
+ continue
+
who, lines = __gather(ui, repo, node1, node2)
# remap the owner if possible