Mercurial > hg > mercurial-crew-with-dirclash
annotate tests/test-static-http @ 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 | 347766c2ff86 |
children | 598dae804a5f |
rev | line source |
---|---|
1111 | 1 #!/bin/sh |
2 | |
4290
347766c2ff86
test-static-http: use printenv.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3464
diff
changeset
|
3 cp "$TESTDIR"/printenv.py . |
347766c2ff86
test-static-http: use printenv.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3464
diff
changeset
|
4 |
2431
d90a9d7c7d4d
replace old-http:// syntax by static-http:// and deprecate the redundant hg://
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
1962
diff
changeset
|
5 http_proxy= hg clone static-http://localhost:20059/ copy |
1111 | 6 echo $? |
3464
33b6c8193652
Don't use test -e in tests - sh doesn't like it on Solaris
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3418
diff
changeset
|
7 test -d copy || echo copy: No such file or directory |
1111 | 8 |
9 # This server doesn't do range requests so it's basically only good for | |
10 # one pull | |
11 cat > dumb.py <<EOF | |
12 import BaseHTTPServer, SimpleHTTPServer, signal | |
13 | |
14 def run(server_class=BaseHTTPServer.HTTPServer, | |
15 handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler): | |
16 server_address = ('localhost', 20059) | |
17 httpd = server_class(server_address, handler_class) | |
18 httpd.serve_forever() | |
19 | |
20 signal.signal(signal.SIGTERM, lambda x: sys.exit(0)) | |
21 run() | |
22 EOF | |
23 | |
24 python dumb.py 2>/dev/null & | |
2571
d22d730c96ed
tests: record few more daemon pids to be safe
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2431
diff
changeset
|
25 echo $! >> $DAEMON_PIDS |
1111 | 26 |
27 mkdir remote | |
28 cd remote | |
29 hg init | |
30 echo foo > bar | |
31 hg add bar | |
1933
7544700fd931
Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1923
diff
changeset
|
32 hg commit -m"test" -d "1000000 0" |
1111 | 33 hg tip |
34 | |
35 cd .. | |
36 | |
2431
d90a9d7c7d4d
replace old-http:// syntax by static-http:// and deprecate the redundant hg://
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
1962
diff
changeset
|
37 http_proxy= hg clone static-http://localhost:20059/remote local |
1111 | 38 |
39 cd local | |
40 hg verify | |
41 cat bar | |
2673
109a22f5434a
hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2571
diff
changeset
|
42 |
109a22f5434a
hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2571
diff
changeset
|
43 cd ../remote |
109a22f5434a
hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2571
diff
changeset
|
44 echo baz > quux |
109a22f5434a
hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2571
diff
changeset
|
45 hg commit -A -mtest2 -d '100000000 0' |
109a22f5434a
hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2571
diff
changeset
|
46 |
109a22f5434a
hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2571
diff
changeset
|
47 cd ../local |
109a22f5434a
hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2571
diff
changeset
|
48 echo '[hooks]' >> .hg/hgrc |
4290
347766c2ff86
test-static-http: use printenv.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3464
diff
changeset
|
49 echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc |
1502
1170fef58071
Fixed test-static-http with http_proxy variable set again.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1128
diff
changeset
|
50 http_proxy= hg pull |
1111 | 51 |
52 kill $! |