Mercurial > hg > mercurial-crew-with-dirclash
annotate tests/test-bdiff @ 1564:34579a67fa71
Re: [PATCH 2 of 3] remove walk warning about nonexistent files
On 11/15/05, Robin Farine <robin.farine@terminus.org> wrote:
> # HG changeset patch
> # User Robin Farine <robin.farine@terminus.org>
> # Node ID ce0a3cc309a8d1e81278ec01a3c61fbb99c691f4
> # Parent feb77e0951e74d75c213e8471f107fdcc124c876
> remove walk warning about nonexistent files
>
> diff -r feb77e0951e7 -r ce0a3cc309a8 mercurial/dirstate.py
> --- a/mercurial/dirstate.py Tue Nov 15 08:42:45 2005 +0100
> +++ b/mercurial/dirstate.py Tue Nov 15 08:59:50 2005 +0100
> @@ -336,9 +336,6 @@
> try:
> st = os.lstat(f)
> except OSError, inst:
> - if ff not in dc: self.ui.warn('%s: %s\n' % (
> - util.pathto(self.getcwd(), ff),
> - inst.strerror))
> continue
> if stat.S_ISDIR(st.st_mode):
> cmp1 = (lambda x, y: cmp(x[1], y[1]))
this break some tests,
a better fix would be to check if ff can be a directory prefix from files in dc
you can try the attached patch.
Benoit
author | Benoit Boissinot <bboissin@gmail.com> |
---|---|
date | Thu, 01 Dec 2005 10:48:29 -0600 |
parents | 0902ffece4b4 |
children |
rev | line source |
---|---|
400
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
1 #!/usr/bin/env python |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
2 |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
3 import sys |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
4 from mercurial import bdiff, mpatch |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
5 |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
6 def test1(a, b): |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
7 d = bdiff.bdiff(a, b) |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
8 c = a |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
9 if d: |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
10 c = mpatch.patches(a, [d]) |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
11 if c != b: |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
12 print "***", `a`, `b` |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
13 print "bad:" |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
14 print `c`[:200] |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
15 print `d` |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
16 |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
17 def test(a, b): |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
18 print "***", `a`, `b` |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
19 test1(a, b) |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
20 test1(b, a) |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
21 |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
22 test("a\nc\n\n\n\n", "a\nb\n\n\n") |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
23 test("a\nb\nc\n", "a\nc\n") |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
24 test("", "") |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
25 test("a\nb\nc", "a\nb\nc") |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
26 test("a\nb\nc\nd\n", "a\nd\n") |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
27 test("a\nb\nc\nd\n", "a\nc\ne\n") |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
28 test("a\nb\nc\n", "a\nc\n") |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
29 test("a\n", "c\na\nb\n") |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
30 test("a\n", "") |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
31 test("a\n", "b\nc\n") |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
32 test("a\n", "c\na\n") |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
33 test("", "adjfkjdjksdhfksj") |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
34 test("", "ab") |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
35 test("", "abc") |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
36 test("a", "a") |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
37 test("ab", "ab") |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
38 test("abc", "abc") |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
39 test("a\n", "a\n") |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
40 test("a\nb", "a\nb") |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
41 |
8b067bde6679
Add a fast binary diff extension (not yet used)
mpm@selenic.com
parents:
diff
changeset
|
42 print "done" |