annotate tests/test-serve.t @ 22288:4e2559841d6c

largefiles: update largefiles even if rebase is aborted by conflict Before this patch, largefiles in the working directory aren't updated correctly, if rebase is aborted by conflict. This prevents users from viewing appropriate largefiles while resolving conflicts. While rebase, largefiles in the working directory are updated only at successful committing in the special code path of "lfilesrepo.commit()". To update largefiles even if rebase is aborted by conflict, this patch centralizes the logic of updating largefiles in the working directory into the "mergeupdate" wrapping "merge.update". This is a temporary way to fix with less changes. For fundamental resolution of this kind of problems in the future, largefiles in the working directory should be updated with other (normal) files simultaneously while "merge.update" execution: maybe by hooking "applyupdates". "Action list based updating" introduced by hooking "applyupdates" will also improve performance of updating, because it automatically decreases target files to be checked. Just after this patch, there are some improper things in "Case 0" code path of "lfilesrepo.commit()": - "updatelfiles" invocation is redundant for rebase - detailed comment doesn't meet to rebase behavior These will be resolved after the subsequent patch for transplant, because this code path is shared with transplant. Even though replacing "merge.update" in rebase extension by "hg.merge" can also avoid this problem, this patch chooses centralizing the logic into "mergeupdate", because: - "merge.update" invocation in rebase extension can't be directly replaced by "hg.merge", because: - rebase requires some extra arguments, which "hg.merge" doesn't take (e.g. "ancestor") - rebase doesn't require statistics information forcibly displayed in "hg.merge" - introducing "mergeupdate" can resolve also problem of some other code paths directly using "merge.update" largefiles in the working directory aren't updated regardless of the result of commands below, before this patch: - backout (for revisions other than the parent revision of the working directory without "--merge") - graft - histedit (for revisions other than the parent of the working directory When "partial" is specified, "merge.update" doesn't update dirstate entries for standins, even though standins themselves are updated. In this case, "normallookup" should be used to mark largefiles as "possibly dirty" forcibly, because applying "normal" on lfdirstate treats them as "clean" unexpectedly. This is reason why "normallookup=partial" is specified for "lfcommands.updatelfiles". This patch doesn't test "hg rebase --continue", because it doesn't work correctly if largefiles in the working directory are modified manually while resolving conflicts. This will be fixed in the next step of refactoring for largefiles. All changes of tests/*.t files other than test-largefiles-update.t in this patch come from invoking "updatelfiles" not after but before statistics output of "hg.update", "hg.clean" and "hg.merge".
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Sun, 24 Aug 2014 23:47:26 +0900
parents 7a9cbb315d84
children 4d2b9b304ad0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22046
7a9cbb315d84 tests: replace exit 80 with #require
Matt Mackall <mpm@selenic.com>
parents: 20008
diff changeset
1 #require serve
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
2
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
3 $ hgserve()
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
4 > {
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
5 > hg serve -a localhost -d --pid-file=hg.pid -E errors.log -v $@ \
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
6 > | sed -e "s/:$HGPORT1\\([^0-9]\\)/:HGPORT1\1/g" \
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
7 > -e "s/:$HGPORT2\\([^0-9]\\)/:HGPORT2\1/g" \
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
8 > -e 's/http:\/\/[^/]*\//http:\/\/localhost\//'
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
9 > cat hg.pid >> "$DAEMON_PIDS"
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
10 > echo % errors
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
11 > cat errors.log
18602
339a3fa19695 tests: remove last two check-code warnings about killdaemons
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
12 > "$TESTDIR/killdaemons.py" hg.pid
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
13 > }
4504
c68e6486f295 Add test reproducing a bug in "hg serve -v"
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
14
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
15 $ hg init test
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
16 $ cd test
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
17 $ echo '[web]' > .hg/hgrc
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
18 $ echo 'accesslog = access.log' >> .hg/hgrc
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
19 $ echo "port = $HGPORT1" >> .hg/hgrc
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
20
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
21 Without -v
6300
874ca958025b test-serve: replace copy/paste with shell function
Patrick Mezard <pmezard@gmail.com>
parents: 6262
diff changeset
22
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
23 $ hg serve -a localhost -p $HGPORT -d --pid-file=hg.pid -E errors.log
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
24 $ cat hg.pid >> "$DAEMON_PIDS"
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
25 $ if [ -f access.log ]; then
16487
4fe874697a4d tests: fix incorrect markup of continued lines of sh commands
Mads Kiilerich <mads@kiilerich.com>
parents: 16364
diff changeset
26 > echo 'access log created - .hg/hgrc respected'
4fe874697a4d tests: fix incorrect markup of continued lines of sh commands
Mads Kiilerich <mads@kiilerich.com>
parents: 16364
diff changeset
27 > fi
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
28 access log created - .hg/hgrc respected
4504
c68e6486f295 Add test reproducing a bug in "hg serve -v"
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
29
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
30 errors
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
31
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
32 $ cat errors.log
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
33
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
34 With -v
4835
9858477ed74c serve: respect settings from .hg/hgrc
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4506
diff changeset
35
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
36 $ hgserve
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
37 listening at http://localhost/ (bound to 127.0.0.1:HGPORT1)
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
38 % errors
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
39
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
40 With -v and -p HGPORT2
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
41
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
42 $ hgserve -p "$HGPORT2"
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
43 listening at http://localhost/ (bound to 127.0.0.1:HGPORT2)
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
44 % errors
4504
c68e6486f295 Add test reproducing a bug in "hg serve -v"
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
45
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
46 With -v and -p daytime (should fail because low port)
5971
6d5ecf824a65 tests for hg serve prefix option
Michele Cella <michele.cella@gmail.com>
parents: 5384
diff changeset
47
20008
e54a078153f7 tests: skip tests that require not having root (issue4089)
Matt Mackall <mpm@selenic.com>
parents: 18602
diff changeset
48 #if no-root
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
49 $ KILLQUIETLY=Y
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
50 $ hgserve -p daytime
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
51 abort: cannot start server at 'localhost:13': Permission denied
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
52 abort: child process failed to start
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
53 % errors
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
54 $ KILLQUIETLY=N
20008
e54a078153f7 tests: skip tests that require not having root (issue4089)
Matt Mackall <mpm@selenic.com>
parents: 18602
diff changeset
55 #endif
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
56
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
57 With --prefix foo
10633
3318431f2ab4 test-serve: Show if port config and option are correctly used
Thomas Arendsen Hein <thomas@intevation.de>
parents: 6461
diff changeset
58
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
59 $ hgserve --prefix foo
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
60 listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1)
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
61 % errors
12076
49463314c24f mail/hgweb: support service names for ports (issue2350)
Brodie Rao <brodie@bitheap.org>
parents: 10633
diff changeset
62
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
63 With --prefix /foo
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
64
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
65 $ hgserve --prefix /foo
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
66 listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1)
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
67 % errors
5971
6d5ecf824a65 tests for hg serve prefix option
Michele Cella <michele.cella@gmail.com>
parents: 5384
diff changeset
68
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
69 With --prefix foo/
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
70
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
71 $ hgserve --prefix foo/
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
72 listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1)
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
73 % errors
5971
6d5ecf824a65 tests for hg serve prefix option
Michele Cella <michele.cella@gmail.com>
parents: 5384
diff changeset
74
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
75 With --prefix /foo/
5971
6d5ecf824a65 tests for hg serve prefix option
Michele Cella <michele.cella@gmail.com>
parents: 5384
diff changeset
76
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
77 $ hgserve --prefix /foo/
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
78 listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1)
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
79 % errors
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16487
diff changeset
80
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16487
diff changeset
81 $ cd ..