hgext/churn.py
changeset 7888 206334f8aa0b
parent 7873 4a4c7f6a5912
parent 7870 7bcce39e8f07
child 7987 17147b465a9d
--- a/hgext/churn.py	Sun Mar 22 20:59:03 2009 +0100
+++ b/hgext/churn.py	Tue Mar 24 16:41:41 2009 -0500
@@ -21,9 +21,10 @@
     t.use_template(tmpl)
     return t
 
-def changedlines(ui, repo, ctx1, ctx2):
+def changedlines(ui, repo, ctx1, ctx2, fns):
     lines = 0
-    diff = ''.join(patch.diff(repo, ctx1.node(), ctx2.node()))
+    fmatch = cmdutil.match(repo, pats=fns)
+    diff = ''.join(patch.diff(repo, ctx1.node(), ctx2.node(), fmatch))
     for l in diff.split('\n'):
         if (l.startswith("+") and not l.startswith("+++ ") or
             l.startswith("-") and not l.startswith("--- ")):
@@ -71,7 +72,7 @@
                 continue
 
             ctx1 = parents[0]
-            lines = changedlines(ui, repo, ctx1, ctx)
+            lines = changedlines(ui, repo, ctx1, ctx, fns)
             rate[key] = rate.get(key, 0) + lines
 
         if opts.get('progress'):