annotate tests/test-status @ 5210:90d9ec0dc69d

merge: forcefully mark files that we get from the second parent as dirty After a hg merge, we want to include in the commit all the files that we got from the second parent, so that we have the correct file-level history. To make them visible to hg commit, we try to mark them as dirty. Unfortunately, right now we can't really mark them as dirty[1] - the best we can do is to mark them as needing a full comparison of their contents, but they will still be considered clean if they happen to be identical to the version in the first parent. This changeset extends the dirstate format in a compatible way, so that we can mark a file as dirty: Right now we use a negative file size to indicate we don't have valid stat data for this entry. In practice, this size is always -1. This patch uses -2 to indicate that the entry is dirty. Older versions of hg won't choke on this dirstate, but they may happily mark the file as clean after a full comparison, destroying all of our hard work. The patch adds a dirstate.normallookup method with the semantics of the current normaldirty, and changes normaldirty to forcefully mark the entry as dirty. This should fix issue522. [1] - well, we could put them in state 'm', but that state has a different meaning.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Thu, 23 Aug 2007 01:48:29 -0300
parents a7b61c3b0f93
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1624
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
1 #!/bin/sh
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
2
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
3 hg init repo1
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
4 cd repo1
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
5 mkdir a b a/1 b/1 b/2
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
6 touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
7 echo "hg status in repo root:"
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
8 hg status
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
9 echo "hg status . in repo root:"
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
10 hg status .
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
11 for dir in a b a/1 b/1 b/2; do
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
12 echo "hg status in $dir:"
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
13 hg status --cwd "$dir"
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
14 echo "hg status . in $dir:"
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
15 hg status --cwd "$dir" .
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
16 echo "hg status .. in $dir:"
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
17 hg status --cwd "$dir" ..
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
18 done
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
19 cd ..
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
20
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
21 hg init repo2
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
22 cd repo2
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
23 touch modified removed deleted ignored
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
24 echo "ignored" > .hgignore
1933
7544700fd931 Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1624
diff changeset
25 hg ci -A -m 'initial checkin' -d "1000000 0"
1624
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
26 sleep 1 # make sure mtime is changed
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
27 touch modified added unknown ignored
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
28 hg add added
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
29 hg remove removed
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
30 rm deleted
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
31 echo "hg status:"
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
32 hg status
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
33 echo "hg status modified added removed deleted unknown never-existed ignored:"
d9e576e55d81 Added test for relative paths and all status flags for 'hg status'
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
34 hg status modified added removed deleted unknown never-existed ignored
2639
001703ec311d Add an option '-C|--copies' to hg status to show the source of copied files.
Brendan Cully <brendan@kublai.com>
parents: 1933
diff changeset
35 hg copy modified copied
001703ec311d Add an option '-C|--copies' to hg status to show the source of copied files.
Brendan Cully <brendan@kublai.com>
parents: 1933
diff changeset
36 echo "hg status -C:"
001703ec311d Add an option '-C|--copies' to hg status to show the source of copied files.
Brendan Cully <brendan@kublai.com>
parents: 1933
diff changeset
37 hg status -C
2661
5c10b7ed3411 status: add -c (clean) and -A (all files) options
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2639
diff changeset
38 echo "hg status -A:"
5c10b7ed3411 status: add -c (clean) and -A (all files) options
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2639
diff changeset
39 hg status -A