##// END OF EJS Templates
tests: unify test-addremove-similar
Martin Geisler -
r11851:db955418 default
parent child Browse files
Show More
@@ -1,67 +1,99 b''
1 #!/bin/sh
1 $ hg init rep; cd rep
2
3 $ touch empty-file
4 $ python -c 'for x in range(10000): print x' > large-file
2
5
3 hg init rep; cd rep
6 $ hg addremove
7 adding empty-file
8 adding large-file
4
9
5 touch empty-file
10 $ hg commit -m A
6 python -c 'for x in range(10000): print x' > large-file
7
11
8 hg addremove
12 $ rm large-file empty-file
9
13 $ python -c 'for x in range(10,10000): print x' > another-file
10 hg commit -m A
11
14
12 rm large-file empty-file
15 $ hg addremove -s50
13 python -c 'for x in range(10,10000): print x' > another-file
16 adding another-file
17 removing empty-file
18 removing large-file
19 recording removal of large-file as rename to another-file (99% similar)
14
20
15 hg addremove -s50
21 $ hg commit -m B
22
23 comparing two empty files caused ZeroDivisionError in the past
16
24
17 hg commit -m B
25 $ hg update -C 0
26 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
27 $ rm empty-file
28 $ touch another-empty-file
29 $ hg addremove -s50
30 adding another-empty-file
31 removing empty-file
18
32
19 echo % comparing two empty files caused ZeroDivisionError in the past
33 $ cd ..
20 hg update -C 0
34
21 rm empty-file
35 $ hg init rep2; cd rep2
22 touch another-empty-file
23 hg addremove -s50
24
36
25 cd ..
37 $ python -c 'for x in range(10000): print x' > large-file
26
38 $ python -c 'for x in range(50): print x' > tiny-file
27 hg init rep2; cd rep2
28
39
29 python -c 'for x in range(10000): print x' > large-file
40 $ hg addremove
30 python -c 'for x in range(50): print x' > tiny-file
41 adding large-file
42 adding tiny-file
31
43
32 hg addremove
44 $ hg commit -m A
45
46 $ python -c 'for x in range(70): print x' > small-file
47 $ rm tiny-file
48 $ rm large-file
33
49
34 hg commit -m A
50 $ hg addremove -s50
51 removing large-file
52 adding small-file
53 removing tiny-file
54 recording removal of tiny-file as rename to small-file (82% similar)
35
55
36 python -c 'for x in range(70): print x' > small-file
56 $ hg commit -m B
37 rm tiny-file
38 rm large-file
39
57
40 hg addremove -s50
58 should all fail
41
59
42 hg commit -m B
60 $ hg addremove -s foo
61 abort: similarity must be a number
62 $ hg addremove -s -1
63 abort: similarity must be between 0 and 100
64 $ hg addremove -s 1e6
65 abort: similarity must be between 0 and 100
43
66
44 echo % should all fail
67 $ cd ..
45 hg addremove -s foo
46 hg addremove -s -1
47 hg addremove -s 1e6
48
68
49 cd ..
69 issue 1527
50
70
51 echo '% issue 1527'
71 $ hg init rep3; cd rep3
52 hg init rep3; cd rep3
72 $ mkdir d
53 mkdir d
73 $ echo a > d/a
54 echo a > d/a
74 $ hg add d/a
55 hg add d/a
75 $ hg commit -m 1
56 hg commit -m 1
57
76
58 mv d/a d/b
77 $ mv d/a d/b
59 hg addremove -s80
78 $ hg addremove -s80
60 hg debugstate
79 removing d/a
61 mv d/b c
80 adding d/b
62 echo "% no copies found here (since the target isn't in d"
81 recording removal of d/a as rename to d/b (100% similar)
63 hg addremove -s80 d
82 $ hg debugstate
64 echo "% copies here"
83 r 0 0 1970-01-01 00:00:00 d/a
65 hg addremove -s80
84 a 0 -1 unset d/b
85 copy: d/a -> d/b
86 $ mv d/b c
66
87
67 true
88 no copies found here (since the target isn't in d
89
90 $ hg addremove -s80 d
91 removing d/b
92
93 copies here
94
95 $ hg addremove -s80
96 adding c
97 recording removal of d/a as rename to c (100% similar)
98
99 $ true
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