comparison tests/test-churn.t @ 40241:81e4f039a0cd

churn: use integer division consistently This results in slight output changes, but it's at least consistent between Python 2 and 3. Since the output is just bar graphs anyway, I'm content with the changes. Differential Revision: https://phab.mercurial-scm.org/D5063
author Augie Fackler <augie@google.com>
date Sat, 13 Oct 2018 06:02:27 -0400
parents 1aee2ab0f902
children b84c3d43ff2e
comparison
equal deleted inserted replaced
40240:6f3e733848ae 40241:81e4f039a0cd
50 50
51 churn up to rev 2 51 churn up to rev 2
52 52
53 $ hg churn -r :2 53 $ hg churn -r :2
54 user2 2 *************************************************************** 54 user2 2 ***************************************************************
55 user1 1 ******************************** 55 user1 1 *******************************
56 $ cd .. 56 $ cd ..
57 57
58 churn with aliases 58 churn with aliases
59 59
60 $ cat > ../aliases <<EOF 60 $ cat > ../aliases <<EOF
81 user2 2 *************** 81 user2 2 ***************
82 82
83 churn by hour 83 churn by hour
84 84
85 $ hg churn -f '%H' -s 85 $ hg churn -f '%H' -s
86 06 1 ***************** 86 06 1 ****************
87 09 2 ********************************* 87 09 2 *********************************
88 12 4 ****************************************************************** 88 12 4 ******************************************************************
89 13 1 ***************** 89 13 1 ****************
90 90
91 91
92 churn with separated added/removed lines 92 churn with separated added/removed lines
93 93
94 $ hg rm d/g/f2.txt 94 $ hg rm d/g/f2.txt
95 $ hg ci -Am "removed d/g/f2.txt" -u user1 -d 14:00 d/g/f2.txt 95 $ hg ci -Am "removed d/g/f2.txt" -u user1 -d 14:00 d/g/f2.txt
96 $ hg churn --diffstat 96 $ hg churn --diffstat
97 user1 +3/-1 +++++++++++++++++++++++++++++++++++++++++-------------- 97 user1 +3/-1 ++++++++++++++++++++++++++++++++++++++++-------------
98 user3 +3/-0 +++++++++++++++++++++++++++++++++++++++++ 98 user3 +3/-0 ++++++++++++++++++++++++++++++++++++++++
99 user2 +2/-0 +++++++++++++++++++++++++++ 99 user2 +2/-0 +++++++++++++++++++++++++++
100 100
101 churn --diffstat with color 101 churn --diffstat with color
102 102
103 $ hg --config extensions.color= churn --config color.mode=ansi \ 103 $ hg --config extensions.color= churn --config color.mode=ansi \
104 > --diffstat --color=always 104 > --diffstat --color=always
105 user1 +3/-1 \x1b[0;32m+++++++++++++++++++++++++++++++++++++++++\x1b[0m\x1b[0;31m--------------\x1b[0m (esc) 105 user1 +3/-1 \x1b[0;32m++++++++++++++++++++++++++++++++++++++++\x1b[0m\x1b[0;31m-------------\x1b[0m (esc)
106 user3 +3/-0 \x1b[0;32m+++++++++++++++++++++++++++++++++++++++++\x1b[0m (esc) 106 user3 +3/-0 \x1b[0;32m++++++++++++++++++++++++++++++++++++++++\x1b[0m (esc)
107 user2 +2/-0 \x1b[0;32m+++++++++++++++++++++++++++\x1b[0m (esc) 107 user2 +2/-0 \x1b[0;32m+++++++++++++++++++++++++++\x1b[0m (esc)
108 108
109 109
110 changeset number churn 110 changeset number churn
111 111
112 $ hg churn -c 112 $ hg churn -c
113 user1 4 *************************************************************** 113 user1 4 ***************************************************************
114 user3 3 *********************************************** 114 user3 3 ***********************************************
115 user2 2 ******************************** 115 user2 2 *******************************
116 116
117 $ echo 'with space = no-space' >> ../aliases 117 $ echo 'with space = no-space' >> ../aliases
118 $ echo a >> a 118 $ echo a >> a
119 $ hg commit -m a -u 'with space' -d 15:00 119 $ hg commit -m a -u 'with space' -d 15:00
120 120
152 $ hg log -l2 --template '[{author|email}]\n' 152 $ hg log -l2 --template '[{author|email}]\n'
153 [ user4@x.com ] 153 [ user4@x.com ]
154 [user4@x.com] 154 [user4@x.com]
155 $ hg churn -c 155 $ hg churn -c
156 user1 4 ********************************************************* 156 user1 4 *********************************************************
157 user3 3 ******************************************* 157 user3 3 ******************************************
158 user2 2 ***************************** 158 user2 2 ****************************
159 user4@x.com 2 ***************************** 159 user4@x.com 2 ****************************
160 with space 1 ************** 160 with space 1 **************
161 161
162 Test multibyte sequences in names 162 Test multibyte sequences in names
163 163
164 $ echo bar >> bar 164 $ echo bar >> bar
165 $ hg --encoding utf-8 ci -m'changed bar' -u 'El Niño <nino@x.com>' 165 $ hg --encoding utf-8 ci -m'changed bar' -u 'El Niño <nino@x.com>'
166 $ hg --encoding utf-8 churn -ct '{author|person}' 166 $ hg --encoding utf-8 churn -ct '{author|person}'
167 user1 4 ********************************************************** 167 user1 4 **********************************************************
168 user3 3 ******************************************** 168 user3 3 *******************************************
169 user2 2 ***************************** 169 user2 2 *****************************
170 user4 2 ***************************** 170 user4 2 *****************************
171 El Ni\xc3\xb1o 1 *************** (esc) 171 El Ni\xc3\xb1o 1 ************** (esc)
172 with space 1 *************** 172 with space 1 **************
173 173
174 Test --template argument, with backwards compatibility 174 Test --template argument, with backwards compatibility
175 175
176 $ hg churn -t '{author|user}' 176 $ hg churn -t '{author|user}'
177 user1 4 *************************************************************** 177 user1 4 ***************************************************************
178 user3 3 *********************************************** 178 user3 3 ***********************************************
179 user2 2 ******************************** 179 user2 2 *******************************
180 nino 1 **************** 180 nino 1 ***************
181 with 1 **************** 181 with 1 ***************
182 0 182 0
183 user4 0 183 user4 0
184 $ hg churn -T '{author|user}' 184 $ hg churn -T '{author|user}'
185 user1 4 *************************************************************** 185 user1 4 ***************************************************************
186 user3 3 *********************************************** 186 user3 3 ***********************************************
187 user2 2 ******************************** 187 user2 2 *******************************
188 nino 1 **************** 188 nino 1 ***************
189 with 1 **************** 189 with 1 ***************
190 0 190 0
191 user4 0 191 user4 0
192 $ hg churn -t 'alltogether' 192 $ hg churn -t 'alltogether'
193 alltogether 11 ********************************************************* 193 alltogether 11 *********************************************************
194 $ hg churn -T 'alltogether' 194 $ hg churn -T 'alltogether'