##// END OF EJS Templates
addremove: comparing two empty files caused ZeroDivisionError...
Thomas Arendsen Hein -
r4472:736e4929 default
parent child Browse files
Show More
@@ -160,9 +160,11 b' def findrenames(repo, added=None, remove'
160 for line in alines[x1:x2]:
160 for line in alines[x1:x2]:
161 equal += len(line)
161 equal += len(line)
162
162
163 myscore = equal*2.0 / (len(aa)+len(rr))
163 lengths = len(aa) + len(rr)
164 if myscore >= bestscore:
164 if lengths:
165 bestname, bestscore = r, myscore
165 myscore = equal*2.0 / lengths
166 if myscore >= bestscore:
167 bestname, bestscore = r, myscore
166 if bestname:
168 if bestname:
167 yield bestname, a, bestscore
169 yield bestname, a, bestscore
168
170
@@ -16,6 +16,12 b' hg addremove -s50'
16
16
17 hg commit -m B
17 hg commit -m B
18
18
19 echo % comparing two empty files caused ZeroDivisionError in the past
20 hg update -C 0
21 rm empty-file
22 touch another-empty-file
23 hg addremove -s50
24
19 cd ..
25 cd ..
20
26
21 hg init rep2; cd rep2
27 hg init rep2; cd rep2
@@ -4,6 +4,10 b' adding another-file'
4 removing empty-file
4 removing empty-file
5 removing large-file
5 removing large-file
6 recording removal of large-file as rename to another-file (99% similar)
6 recording removal of large-file as rename to another-file (99% similar)
7 % comparing two empty files caused ZeroDivisionError in the past
8 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
9 adding another-empty-file
10 removing empty-file
7 adding large-file
11 adding large-file
8 adding tiny-file
12 adding tiny-file
9 adding small-file
13 adding small-file
General Comments 0
You need to be logged in to leave comments. Login now