Mercurial > hg > mercurial-crew-with-dirclash
annotate tests/test-incoming-outgoing @ 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 | 9dcf9d45cab8 |
children | e3a0c092b4e2 |
rev | line source |
---|---|
2260
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
1 #!/bin/sh |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
2 |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
3 mkdir test |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
4 cd test |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
5 hg init |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
6 for i in 0 1 2 3 4 5 6 7 8; do |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
7 echo $i >> foo |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
8 hg commit -A -m $i -d "1000000 0" |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
9 done |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
10 hg verify |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
11 hg serve -p 20059 -d --pid-file=hg.pid |
2570
83cfd95eafb5
tests: add timeouts, make run-tests.py clean up dead daemon processes
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2521
diff
changeset
|
12 cat hg.pid >> $DAEMON_PIDS |
2260
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
13 cd .. |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
14 |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
15 hg init new |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
16 # http incoming |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
17 http_proxy= hg -R new incoming http://localhost:20059/ |
2521
9cceb439048b
add -r/--rev arguments to incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
2260
diff
changeset
|
18 http_proxy= hg -R new incoming -r 4 http://localhost:20059/ |
2260
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
19 # local incoming |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
20 hg -R new incoming test |
2521
9cceb439048b
add -r/--rev arguments to incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
2260
diff
changeset
|
21 hg -R new incoming -r 4 test |
2260
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
22 |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
23 # test with --bundle |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
24 http_proxy= hg -R new incoming --bundle test.hg http://localhost:20059/ |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
25 hg -R new incoming --bundle test2.hg test |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
26 |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
27 # test the resulting bundles |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
28 hg init temp |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
29 hg init temp2 |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
30 hg -R temp unbundle test.hg |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
31 hg -R temp2 unbundle test2.hg |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
32 hg -R temp tip |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
33 hg -R temp2 tip |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
34 |
3988
9dcf9d45cab8
Don't use -f for rm in tests where not needed. Drop /bin/ from /bin/rm.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
2570
diff
changeset
|
35 rm -r temp temp2 new |
2260
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
36 |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
37 # test outgoing |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
38 hg clone test test-dev |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
39 cd test-dev |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
40 for i in 9 10 11 12 13; do |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
41 echo $i >> foo |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
42 hg commit -A -m $i -d "1000000 0" |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
43 done |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
44 hg verify |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
45 cd .. |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
46 hg -R test-dev outgoing test |
99d6cae511f7
add tests for incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
47 http_proxy= hg -R test-dev outgoing http://localhost:20059/ |
2521
9cceb439048b
add -r/--rev arguments to incoming and outgoing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
2260
diff
changeset
|
48 http_proxy= hg -R test-dev outgoing -r 11 http://localhost:20059/ |