##// END OF EJS Templates
Returns lines changed for paths specified as arguments correctly....
madhu@madhu -
r7870:7bcce39e default
parent child Browse files
Show More
@@ -21,9 +21,10 b' def maketemplater(ui, repo, tmpl):'
21 21 t.use_template(tmpl)
22 22 return t
23 23
24 def changedlines(ui, repo, ctx1, ctx2):
24 def changedlines(ui, repo, ctx1, ctx2, fns):
25 25 lines = 0
26 diff = ''.join(patch.diff(repo, ctx1.node(), ctx2.node()))
26 fmatch = cmdutil.match(repo, pats=fns)
27 diff = ''.join(patch.diff(repo, ctx1.node(), ctx2.node(), fmatch))
27 28 for l in diff.split('\n'):
28 29 if (l.startswith("+") and not l.startswith("+++ ") or
29 30 l.startswith("-") and not l.startswith("--- ")):
@@ -71,7 +72,7 b' def countrate(ui, repo, amap, *pats, **o'
71 72 continue
72 73
73 74 ctx1 = parents[0]
74 lines = changedlines(ui, repo, ctx1, ctx)
75 lines = changedlines(ui, repo, ctx1, ctx, fns)
75 76 rate[key] = rate.get(key, 0) + lines
76 77
77 78 if opts.get('progress'):
@@ -20,7 +20,15 b' echo c > c'
20 20 hg ci -m changeca -u user3 -d 12:00 a
21 21 hg ci -m changecb -u user3 -d 12:15 b
22 22 hg ci -Am addc -u user3 -d 12:30
23 mkdir -p d/e
24 echo abc > d/e/f1.txt
25 hg ci -Am "add d/e/f1.txt" -u user1 -d 12:45 d/e/f1.txt
26 mkdir -p d/g
27 echo def > d/g/f2.txt
28 hg ci -Am "add d/g/f2.txt" -u user1 -d 13:00 d/g/f2.txt
23 29
30 echo % churn separate directories
31 hg churn d/e
24 32 echo % churn all
25 33 hg churn
26 34 echo % churn up to rev 2
@@ -2,22 +2,25 b''
2 2 adding a
3 3 adding b
4 4 adding c
5 % churn separate directories
6 user1 1 ***************************************************************
5 7 % churn all
6 8 user3 3 ***************************************************************
9 user1 3 ***************************************************************
7 10 user2 2 ******************************************
8 user1 1 *********************
9 11 % churn up to rev 2
10 12 user2 2 ***************************************************************
11 13 user1 1 *******************************
12 14 % churn with aliases
13 15 alias3 3 **************************************************************
16 alias1 3 **************************************************************
14 17 user2 2 *****************************************
15 alias1 1 ********************
16 18 % churn with column specifier
17 19 user3 3 ***********************
20 user1 3 ***********************
18 21 user2 2 ***************
19 user1 1 *******
20 22 % churn by hour
21 06 1 **********************
22 09 2 ********************************************
23 12 3 ******************************************************************
23 06 1 ****************
24 09 2 *********************************
25 12 4 ******************************************************************
26 13 1 ****************
General Comments 0
You need to be logged in to leave comments. Login now