Show More
@@ -1,81 +1,141 b'' | |||||
1 | #!/bin/sh |
|
1 | $ echo "[extensions]" >> $HGRCPATH | |
|
2 | $ echo "churn=" >> $HGRCPATH | |||
|
3 | ||||
|
4 | create test repository | |||
2 |
|
5 | |||
3 | echo "[extensions]" >> $HGRCPATH |
|
6 | $ hg init repo | |
4 | echo "churn=" >> $HGRCPATH |
|
7 | $ cd repo | |
|
8 | $ echo a > a | |||
|
9 | $ hg ci -Am adda -u user1 -d 6:00 | |||
|
10 | adding a | |||
|
11 | $ echo b >> a | |||
|
12 | $ echo b > b | |||
|
13 | $ hg ci -m changeba -u user2 -d 9:00 a | |||
|
14 | $ hg ci -Am addb -u user2 -d 9:30 | |||
|
15 | adding b | |||
|
16 | $ echo c >> a | |||
|
17 | $ echo c >> b | |||
|
18 | $ echo c > c | |||
|
19 | $ hg ci -m changeca -u user3 -d 12:00 a | |||
|
20 | $ hg ci -m changecb -u user3 -d 12:15 b | |||
|
21 | $ hg ci -Am addc -u user3 -d 12:30 | |||
|
22 | adding c | |||
|
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 | |||
|
29 | ||||
|
30 | ||||
|
31 | churn separate directories | |||
5 |
|
32 | |||
6 | echo % create test repository |
|
33 | $ cd d | |
7 | hg init repo |
|
34 | $ hg churn e | |
8 | cd repo |
|
35 | user1 1 *************************************************************** | |
9 | echo a > a |
|
36 | ||
10 | hg ci -Am adda -u user1 -d 6:00 |
|
37 | churn all | |
11 | echo b >> a |
|
38 | ||
12 | echo b > b |
|
39 | $ hg churn | |
13 | hg ci -m changeba -u user2 -d 9:00 a |
|
40 | user3 3 *************************************************************** | |
14 | hg ci -Am addb -u user2 -d 9:30 |
|
41 | user1 3 *************************************************************** | |
15 | echo c >> a |
|
42 | user2 2 ****************************************** | |
16 | echo c >> b |
|
43 | ||
17 | echo c > c |
|
44 | churn excluding one dir | |
18 | hg ci -m changeca -u user3 -d 12:00 a |
|
|||
19 | hg ci -m changecb -u user3 -d 12:15 b |
|
|||
20 | hg ci -Am addc -u user3 -d 12:30 |
|
|||
21 | mkdir -p d/e |
|
|||
22 | echo abc > d/e/f1.txt |
|
|||
23 | hg ci -Am "add d/e/f1.txt" -u user1 -d 12:45 d/e/f1.txt |
|
|||
24 | mkdir -p d/g |
|
|||
25 | echo def > d/g/f2.txt |
|
|||
26 | hg ci -Am "add d/g/f2.txt" -u user1 -d 13:00 d/g/f2.txt |
|
|||
27 |
|
45 | |||
28 | echo % churn separate directories |
|
46 | $ hg churn -X e | |
29 | cd d |
|
47 | user3 3 *************************************************************** | |
30 | hg churn e |
|
48 | user2 2 ****************************************** | |
31 | echo % churn all |
|
49 | user1 2 ****************************************** | |
32 | hg churn |
|
50 | ||
33 | echo % churn excluding one dir |
|
51 | churn up to rev 2 | |
34 | hg churn -X e |
|
52 | ||
35 | echo % churn up to rev 2 |
|
53 | $ hg churn -r :2 | |
36 | hg churn -r :2 |
|
54 | user2 2 *************************************************************** | |
37 | cd .. |
|
55 | user1 1 ******************************** | |
38 | echo % churn with aliases |
|
56 | $ cd .. | |
39 | cat > ../aliases <<EOF |
|
57 | ||
40 | user1 alias1 |
|
58 | churn with aliases | |
|
59 | ||||
|
60 | $ cat > ../aliases <<EOF | |||
|
61 | > user1 alias1 | |||
|
62 | > user3 alias3 | |||
|
63 | > not-an-alias | |||
|
64 | > EOF | |||
|
65 | ||||
|
66 | churn with .hgchurn | |||
41 |
|
67 | |||
42 | user3 alias3 |
|
68 | $ mv ../aliases .hgchurn | |
43 | not-an-alias |
|
69 | $ hg churn | |
44 | EOF |
|
70 | skipping malformed alias: not-an-alias | |
45 | hg churn --aliases ../aliases |
|
71 | alias3 3 ************************************************************** | |
46 | echo % churn with .hgchurn |
|
72 | alias1 3 ************************************************************** | |
47 | mv ../aliases .hgchurn |
|
73 | user2 2 ***************************************** | |
48 |
hg |
|
74 | $ rm .hgchurn | |
49 | rm .hgchurn |
|
75 | ||
50 |
|
|
76 | churn with column specifier | |
51 | COLUMNS=40 hg churn |
|
77 | ||
52 | echo % churn by hour |
|
78 | $ COLUMNS=40 hg churn | |
53 | hg churn -f '%H' -s |
|
79 | user3 3 *********************** | |
|
80 | user1 3 *********************** | |||
|
81 | user2 2 *************** | |||
|
82 | ||||
|
83 | churn by hour | |||
|
84 | ||||
|
85 | $ hg churn -f '%H' -s | |||
|
86 | 06 1 ***************** | |||
|
87 | 09 2 ********************************* | |||
|
88 | 12 4 ****************************************************************** | |||
|
89 | 13 1 ***************** | |||
|
90 | ||||
|
91 | ||||
|
92 | churn with separated added/removed lines | |||
|
93 | ||||
|
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 | |||
|
96 | $ hg churn --diffstat | |||
|
97 | user1 +3/-1 +++++++++++++++++++++++++++++++++++++++++-------------- | |||
|
98 | user3 +3/-0 +++++++++++++++++++++++++++++++++++++++++ | |||
|
99 | user2 +2/-0 +++++++++++++++++++++++++++ | |||
|
100 | ||||
|
101 | churn --diffstat with color | |||
54 |
|
102 | |||
55 | echo % churn with separated added/removed lines |
|
103 | $ hg --config extensions.color= churn --config color.mode=ansi \ | |
56 | hg rm d/g/f2.txt |
|
104 | > --diffstat --color=always | |
57 | hg ci -Am "removed d/g/f2.txt" -u user1 -d 14:00 d/g/f2.txt |
|
105 | user1 +3/-1 [0;32m+++++++++++++++++++++++++++++++++++++++++[0m[0;31m--------------[0m | |
58 | hg churn --diffstat |
|
106 | user3 +3/-0 [0;32m+++++++++++++++++++++++++++++++++++++++++[0m | |
59 | echo % churn --diffstat with color |
|
107 | user2 +2/-0 [0;32m+++++++++++++++++++++++++++[0m | |
60 | hg --config extensions.color= churn --config color.mode=ansi \ |
|
108 | ||
61 | --diffstat --color=always |
|
109 | ||
|
110 | changeset number churn | |||
62 |
|
111 | |||
63 | echo % changeset number churn |
|
112 | $ hg churn -c | |
64 | hg churn -c |
|
113 | user1 4 *************************************************************** | |
|
114 | user3 3 *********************************************** | |||
|
115 | user2 2 ******************************** | |||
|
116 | ||||
|
117 | $ echo 'with space = no-space' >> ../aliases | |||
|
118 | $ echo a >> a | |||
|
119 | $ hg commit -m a -u 'with space' -d 15:00 | |||
|
120 | ||||
|
121 | churn with space in alias | |||
65 |
|
122 | |||
66 | echo 'with space = no-space' >> ../aliases |
|
123 | $ hg churn --aliases ../aliases -r tip | |
67 | echo a >> a |
|
124 | no-space 1 ************************************************************ | |
68 | hg commit -m a -u 'with space' -d 15:00 |
|
|||
69 | echo % churn with space in alias |
|
|||
70 | hg churn --aliases ../aliases -r tip |
|
|||
71 |
|
125 | |||
72 | cd .. |
|
126 | $ cd .. | |
|
127 | ||||
|
128 | ||||
|
129 | issue 833: ZeroDivisionError | |||
73 |
|
130 | |||
74 | # issue 833: ZeroDivisionError |
|
131 | $ hg init issue-833 | |
75 |
|
|
132 | $ cd issue-833 | |
76 | cd issue-833 |
|
133 | $ touch foo | |
77 | touch foo |
|
134 | $ hg ci -Am foo | |
78 | hg ci -Am foo |
|
135 | adding foo | |
79 | # this was failing with a ZeroDivisionError |
|
136 | ||
80 | hg churn |
|
137 | this was failing with a ZeroDivisionError | |
81 | cd .. |
|
138 | ||
|
139 | $ hg churn | |||
|
140 | test 0 | |||
|
141 | $ cd .. |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now