Mercurial > hg
annotate tests/test-hgignore @ 4531:b51a8138292a
Avoid extra filelogs entries.
Right now, there are some situations in which localrepo.filecommit can
create filelog entries even though they're not needed. For example:
- permissions for a file have changed;
- qrefresh can create a filelog entry identical to its parent (see the
added test);
- convert-repo creates extra filelog entries in every merge where the
first parent has added files (for example, changeset ebebe9577a1a of
the kernel repo added extra filelog entries to files in the
arch/blackfin directory, even though the merge should only touch the
drivers/ata directory). This makes "hg log file" in a converted repo
less useful than it could be, since it may mention many merges that
don't actually touch that specific file.
They all come from the same basic problem: localrepo.commit (through
filecommit) creates new filelog entries for all files passed to it
(except for some cases during a merge).
Patch and test case provided by Benoit.
This should fix issue351.
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Sat, 09 Jun 2007 01:04:28 -0300 |
parents | 4e521a3ee5eb |
children | ac97e065cfc7 |
rev | line source |
---|---|
1478
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
1 #!/bin/sh |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
2 |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
3 hg init |
4439
4e521a3ee5eb
Test issue 562: .hgignore requires newline at end
Patrick Mezard <pmezard@gmail.com>
parents:
2009
diff
changeset
|
4 |
4e521a3ee5eb
Test issue 562: .hgignore requires newline at end
Patrick Mezard <pmezard@gmail.com>
parents:
2009
diff
changeset
|
5 # Test issue 562: .hgignore requires newline at end |
4e521a3ee5eb
Test issue 562: .hgignore requires newline at end
Patrick Mezard <pmezard@gmail.com>
parents:
2009
diff
changeset
|
6 touch foo |
4e521a3ee5eb
Test issue 562: .hgignore requires newline at end
Patrick Mezard <pmezard@gmail.com>
parents:
2009
diff
changeset
|
7 touch bar |
4e521a3ee5eb
Test issue 562: .hgignore requires newline at end
Patrick Mezard <pmezard@gmail.com>
parents:
2009
diff
changeset
|
8 touch baz |
4e521a3ee5eb
Test issue 562: .hgignore requires newline at end
Patrick Mezard <pmezard@gmail.com>
parents:
2009
diff
changeset
|
9 cat > makeignore.py <<EOF |
4e521a3ee5eb
Test issue 562: .hgignore requires newline at end
Patrick Mezard <pmezard@gmail.com>
parents:
2009
diff
changeset
|
10 f = open(".hgignore", "w") |
4e521a3ee5eb
Test issue 562: .hgignore requires newline at end
Patrick Mezard <pmezard@gmail.com>
parents:
2009
diff
changeset
|
11 f.write("ignore\n") |
4e521a3ee5eb
Test issue 562: .hgignore requires newline at end
Patrick Mezard <pmezard@gmail.com>
parents:
2009
diff
changeset
|
12 f.write("foo\n") |
4e521a3ee5eb
Test issue 562: .hgignore requires newline at end
Patrick Mezard <pmezard@gmail.com>
parents:
2009
diff
changeset
|
13 # No EOL here |
4e521a3ee5eb
Test issue 562: .hgignore requires newline at end
Patrick Mezard <pmezard@gmail.com>
parents:
2009
diff
changeset
|
14 f.write("bar") |
4e521a3ee5eb
Test issue 562: .hgignore requires newline at end
Patrick Mezard <pmezard@gmail.com>
parents:
2009
diff
changeset
|
15 f.close() |
4e521a3ee5eb
Test issue 562: .hgignore requires newline at end
Patrick Mezard <pmezard@gmail.com>
parents:
2009
diff
changeset
|
16 EOF |
4e521a3ee5eb
Test issue 562: .hgignore requires newline at end
Patrick Mezard <pmezard@gmail.com>
parents:
2009
diff
changeset
|
17 |
4e521a3ee5eb
Test issue 562: .hgignore requires newline at end
Patrick Mezard <pmezard@gmail.com>
parents:
2009
diff
changeset
|
18 python makeignore.py |
4e521a3ee5eb
Test issue 562: .hgignore requires newline at end
Patrick Mezard <pmezard@gmail.com>
parents:
2009
diff
changeset
|
19 echo % should display baz only |
4e521a3ee5eb
Test issue 562: .hgignore requires newline at end
Patrick Mezard <pmezard@gmail.com>
parents:
2009
diff
changeset
|
20 hg status |
4e521a3ee5eb
Test issue 562: .hgignore requires newline at end
Patrick Mezard <pmezard@gmail.com>
parents:
2009
diff
changeset
|
21 rm foo bar baz .hgignore makeignore.py |
4e521a3ee5eb
Test issue 562: .hgignore requires newline at end
Patrick Mezard <pmezard@gmail.com>
parents:
2009
diff
changeset
|
22 |
1478
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
23 touch a.o |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
24 touch a.c |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
25 touch syntax |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
26 mkdir dir |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
27 touch dir/a.o |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
28 touch dir/b.o |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
29 touch dir/c.o |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
30 |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
31 hg add dir/a.o |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
32 hg commit -m 0 |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
33 hg add dir/b.o |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
34 |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
35 echo "--" ; hg status |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
36 |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
37 echo "*.o" > .hgignore |
2009
182f500805db
Fix broken hgignore tests due to full path showing up in output.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1568
diff
changeset
|
38 echo "--" ; hg status 2>&1 | sed -e 's/abort: .*\.hgignore:/abort: .hgignore:/' |
1478
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
39 |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
40 echo ".*\.o" > .hgignore |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
41 echo "--" ; hg status |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
42 |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
43 # XXX: broken |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
44 #echo "glob:**.o" > .hgignore |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
45 #echo "--" ; hg status |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
46 # |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
47 #echo "glob:*.o" > .hgignore |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
48 #echo "--" ; hg status |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
49 |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
50 echo "syntax: invalid" > .hgignore |
2009
182f500805db
Fix broken hgignore tests due to full path showing up in output.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1568
diff
changeset
|
51 echo "--" ; hg status 2>&1 | sed -e 's/.*\.hgignore:/.hgignore:/' |
1478
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
52 |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
53 echo "syntax: glob" > .hgignore |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
54 echo "*.o" >> .hgignore |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
55 echo "--" ; hg status |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
56 |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
57 echo "relglob:syntax*" > .hgignore |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
58 echo "--" ; hg status |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
59 |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
60 echo "relglob:*" > .hgignore |
e6dd91a88b57
add a test for hgignore
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
61 echo "--" ; hg status |
1491
91c0e8d7ddcf
fix a bug in dirstate.changes when cwd != repo.root
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
1478
diff
changeset
|
62 |
91c0e8d7ddcf
fix a bug in dirstate.changes when cwd != repo.root
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
1478
diff
changeset
|
63 cd dir |
1568
1d7d0c07e8f3
make all commands be repo-wide by default
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
1491
diff
changeset
|
64 echo "--" ; hg status . |