##// END OF EJS Templates
churn: sort users with same churn by name...
Mads Kiilerich -
r18369:2150e70c default
parent child Browse files
Show More
@@ -144,8 +144,10 def churn(ui, repo, *pats, **opts):
144 if not rate:
144 if not rate:
145 return
145 return
146
146
147 sortkey = ((not opts.get('sort')) and (lambda x: -sum(x[1])) or None)
147 if opts.get('sort'):
148 rate.sort(key=sortkey)
148 rate.sort()
149 else:
150 rate.sort(key=lambda x: (-sum(x[1]), x))
149
151
150 # Be careful not to have a zero maxcount (issue833)
152 # Be careful not to have a zero maxcount (issue833)
151 maxcount = float(max(sum(v) for k, v in rate)) or 1.0
153 maxcount = float(max(sum(v) for k, v in rate)) or 1.0
@@ -37,16 +37,16 churn separate directories
37 churn all
37 churn all
38
38
39 $ hg churn
39 $ hg churn
40 user1 3 ***************************************************************
40 user3 3 ***************************************************************
41 user3 3 ***************************************************************
41 user1 3 ***************************************************************
42 user2 2 ******************************************
42 user2 2 ******************************************
43
43
44 churn excluding one dir
44 churn excluding one dir
45
45
46 $ hg churn -X e
46 $ hg churn -X e
47 user3 3 ***************************************************************
47 user3 3 ***************************************************************
48 user1 2 ******************************************
48 user2 2 ******************************************
49 user2 2 ******************************************
49 user1 2 ******************************************
50
50
51 churn up to rev 2
51 churn up to rev 2
52
52
@@ -68,16 +68,16 churn with .hgchurn
68 $ mv ../aliases .hgchurn
68 $ mv ../aliases .hgchurn
69 $ hg churn
69 $ hg churn
70 skipping malformed alias: not-an-alias
70 skipping malformed alias: not-an-alias
71 alias1 3 **************************************************************
71 alias3 3 **************************************************************
72 alias3 3 **************************************************************
72 alias1 3 **************************************************************
73 user2 2 *****************************************
73 user2 2 *****************************************
74 $ rm .hgchurn
74 $ rm .hgchurn
75
75
76 churn with column specifier
76 churn with column specifier
77
77
78 $ COLUMNS=40 hg churn
78 $ COLUMNS=40 hg churn
79 user1 3 ***********************
79 user3 3 ***********************
80 user3 3 ***********************
80 user1 3 ***********************
81 user2 2 ***************
81 user2 2 ***************
82
82
83 churn by hour
83 churn by hour
@@ -155,8 +155,8 Ignore trailing or leading spaces in ema
155 $ hg churn -c
155 $ hg churn -c
156 user1 4 *********************************************************
156 user1 4 *********************************************************
157 user3 3 *******************************************
157 user3 3 *******************************************
158 user2 2 *****************************
158 user4@x.com 2 *****************************
159 user4@x.com 2 *****************************
159 user2 2 *****************************
160 with space 1 **************
160 with space 1 **************
161
161
162 $ cd ..
162 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now