annotate tests/test-amend-subrepo.t @ 51681:522b4d729e89

mmap: populate the mapping by default Without pre-population, accessing all data through a mmap can result in many pagefault, reducing performance significantly. If the mmap is prepopulated, the performance can no longer get slower than a full read. (See benchmark number below) In some cases were very few data is read, prepopulating can be overkill and slower than populating on access (through page fault). So that behavior can be controlled when the caller can pre-determine the best behavior. (See benchmark number below) In addition, testing with populating in a secondary thread yield great result combining the best of each approach. This might be implemented in later changesets. In all cases, using mmap has a great effect on memory usage when many processes run in parallel on the same machine. ### Benchmarks # What did I run A couple of month back I ran a large benchmark campaign to assess the impact of various approach for using mmap with the revlog (and other files), it highlighted a few benchmarks that capture the impact of the changes well. So to validate this change I checked the following: - log command displaying various revisions (read the changelog index) - log command displaying the patch of listed revisions (read the changelog index, the manifest index and a few files indexes) - unbundling a few revisions (read and write changelog, manifest and few files indexes, and walk the graph to update some cache) - pushing a few revisions (read and write changelog, manifest and few files indexes, walk the graph to update some cache, performs various accesses locally and remotely during discovery) Benchmarks were run using the default module policy (c+py) and the rust one. No significant difference were found between the two implementation, so we will present result using the default policy (unless otherwise specified). I ran them on a few repositories : - mercurial: a "public changeset only" copy of mercurial from 2018-08-01 using zstd compression and sparse-revlog - pypy: a copy of pypy from 2018-08-01 using zstd compression and sparse-revlog - netbeans: a copy of netbeans from 2018-08-01 using zstd compression and sparse-revlog - mozilla-try: a copy of mozilla-try from 2019-02-18 using zstd compression and sparse-revlog - mozilla-try persistent-nodemap: Same as the above but with a persistent nodemap. Used for the log --patch benchmark only # Results For the smaller repositories (mercurial, pypy), the impact of mmap is almost imperceptible, other cost dominating the operation. The impact of prepopulating is undiscernible in the benchmark we ran. For larger repositories the benchmark support explanation given above: On netbeans, the log can be about 1% faster without repopulation (for a difference < 100ms) but unbundle becomes a bit slower, even when small. ### data-env-vars.name = netbeans-2018-08-01-zstd-sparse-revlog # benchmark.name = hg.command.unbundle # benchmark.variants.issue6528 = disabled # benchmark.variants.reuse-external-delta-parent = yes # benchmark.variants.revs = any-1-extra-rev # benchmark.variants.source = unbundle # benchmark.variants.verbosity = quiet with-populate: 0.240157 no-populate: 0.265087 (+10.38%, +0.02) # benchmark.variants.revs = any-100-extra-rev with-populate: 1.459518 no-populate: 1.481290 (+1.49%, +0.02) ## benchmark.name = hg.command.push # benchmark.variants.explicit-rev = none # benchmark.variants.issue6528 = disabled # benchmark.variants.protocol = ssh # benchmark.variants.reuse-external-delta-parent = yes # benchmark.variants.revs = any-1-extra-rev with-populate: 0.771919 no-populate: 0.792025 (+2.60%, +0.02) # benchmark.variants.revs = any-100-extra-rev with-populate: 1.459518 no-populate: 1.481290 (+1.49%, +0.02) For mozilla-try, the "slow down" from pre-populate for small `hg log` is more visible, but still small in absolute time. (using rust value for the persistent nodemap value to be relevant). ### data-env-vars.name = mozilla-try-2019-02-18-ds2-pnm # benchmark.name = hg.command.log # bin-env-vars.hg.flavor = rust # benchmark.variants.patch = yes # benchmark.variants.limit-rev = 1 with-populate: 0.237813 no-populate: 0.229452 (-3.52%, -0.01) # benchmark.variants.limit-rev = 10 # benchmark.variants.patch = yes with-populate: 1.213578 no-populate: 1.205189 ### data-env-vars.name = mozilla-try-2019-02-18-zstd-sparse-revlog # benchmark.variants.limit-rev = 1000 # benchmark.variants.patch = no # benchmark.variants.rev = tip with-populate: 0.198607 no-populate: 0.195038 (-1.80%, -0.00) However pre-populating provide a significant boost on more complex operations like unbundle or push: ### data-env-vars.name = mozilla-try-2019-02-18-zstd-sparse-revlog # benchmark.name = hg.command.push # benchmark.variants.explicit-rev = none # benchmark.variants.issue6528 = disabled # benchmark.variants.protocol = ssh # benchmark.variants.reuse-external-delta-parent = yes # benchmark.variants.revs = any-1-extra-rev with-populate: 4.798632 no-populate: 4.953295 (+3.22%, +0.15) # benchmark.variants.revs = any-100-extra-rev with-populate: 4.903618 no-populate: 5.014963 (+2.27%, +0.11) ## benchmark.name = hg.command.unbundle # benchmark.variants.revs = any-1-extra-rev with-populate: 1.423411 no-populate: 1.585365 (+11.38%, +0.16) # benchmark.variants.revs = any-100-extra-rev with-populate: 1.537909 no-populate: 1.688489 (+9.79%, +0.15)
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 11 Apr 2024 00:02:07 +0200
parents c84844cd523a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
35024
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
1 #testcases obsstore-off obsstore-on
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
2
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
3 $ cat << EOF >> $HGRCPATH
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
4 > [extensions]
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
5 > amend =
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
6 > EOF
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
7
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
8 #if obsstore-on
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
9 $ cat << EOF >> $HGRCPATH
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
10 > [experimental]
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
11 > evolution.createmarkers = True
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
12 > EOF
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
13 #endif
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
14
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
15 Prepare parent repo
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
16 -------------------
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
17
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
18 $ hg init r
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
19 $ cd r
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
20
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
21 $ echo a > a
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
22 $ hg ci -Am0
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
23 adding a
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
24
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
25 Link first subrepo
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
26 ------------------
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
27
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
28 $ echo 's = s' >> .hgsub
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
29 $ hg add .hgsub
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
30 $ hg init s
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
31
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
32 amend without .hgsub
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
33
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
34 $ hg amend s
35026
691524f0bbf6 amend: update .hgsubstate before committing a memctx (issue5677)
Yuya Nishihara <yuya@tcha.org>
parents: 35024
diff changeset
35 abort: can't commit subrepos without .hgsub
691524f0bbf6 amend: update .hgsubstate before committing a memctx (issue5677)
Yuya Nishihara <yuya@tcha.org>
parents: 35024
diff changeset
36 [255]
35024
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
37
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
38 amend with subrepo
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
39
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
40 $ hg amend
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
41 saved backup bundle to * (glob) (obsstore-off !)
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
42 $ hg status --change .
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
43 A .hgsub
35026
691524f0bbf6 amend: update .hgsubstate before committing a memctx (issue5677)
Yuya Nishihara <yuya@tcha.org>
parents: 35024
diff changeset
44 A .hgsubstate
35024
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
45 A a
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
46 $ cat .hgsubstate
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
47 0000000000000000000000000000000000000000 s
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
48
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
49 Update subrepo
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
50 --------------
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
51
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
52 add new commit to be amended
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
53
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
54 $ echo a >> a
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
55 $ hg ci -m1
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
56
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
57 amend with dirty subrepo
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
58
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
59 $ echo a >> s/a
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
60 $ hg add -R s
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35166
diff changeset
61 adding s/a
35024
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
62 $ hg amend
35026
691524f0bbf6 amend: update .hgsubstate before committing a memctx (issue5677)
Yuya Nishihara <yuya@tcha.org>
parents: 35024
diff changeset
63 abort: uncommitted changes in subrepository "s"
691524f0bbf6 amend: update .hgsubstate before committing a memctx (issue5677)
Yuya Nishihara <yuya@tcha.org>
parents: 35024
diff changeset
64 (use --subrepos for recursive commit)
691524f0bbf6 amend: update .hgsubstate before committing a memctx (issue5677)
Yuya Nishihara <yuya@tcha.org>
parents: 35024
diff changeset
65 [255]
35024
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
66
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
67 amend with modified subrepo
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
68
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
69 $ hg ci -R s -m0
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
70 $ hg amend
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
71 saved backup bundle to * (glob) (obsstore-off !)
35026
691524f0bbf6 amend: update .hgsubstate before committing a memctx (issue5677)
Yuya Nishihara <yuya@tcha.org>
parents: 35024
diff changeset
72 $ hg status --change .
691524f0bbf6 amend: update .hgsubstate before committing a memctx (issue5677)
Yuya Nishihara <yuya@tcha.org>
parents: 35024
diff changeset
73 M .hgsubstate
691524f0bbf6 amend: update .hgsubstate before committing a memctx (issue5677)
Yuya Nishihara <yuya@tcha.org>
parents: 35024
diff changeset
74 M a
35024
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
75 $ cat .hgsubstate
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
76 f7b1eb17ad24730a1651fccd46c43826d1bbc2ac s
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
77
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
78 revert subrepo change
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
79
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
80 $ hg up -R s -q null
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
81 $ hg amend
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
82 saved backup bundle to * (glob) (obsstore-off !)
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
83 $ hg status --change .
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
84 M a
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
85
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
86 Link another subrepo
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
87 --------------------
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
88
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
89 add new commit to be amended
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
90
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
91 $ echo b >> b
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
92 $ hg ci -qAm2
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
93
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
94 also checks if non-subrepo change is included
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
95
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
96 $ echo a >> a
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
97
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
98 amend with another subrepo
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
99
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
100 $ hg init t
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
101 $ echo b >> t/b
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
102 $ hg ci -R t -Am0
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
103 adding b
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
104 $ echo 't = t' >> .hgsub
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
105 $ hg amend
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
106 saved backup bundle to * (glob) (obsstore-off !)
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
107 $ hg status --change .
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
108 M .hgsub
35026
691524f0bbf6 amend: update .hgsubstate before committing a memctx (issue5677)
Yuya Nishihara <yuya@tcha.org>
parents: 35024
diff changeset
109 M .hgsubstate
35024
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
110 M a
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
111 A b
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
112 $ cat .hgsubstate
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
113 0000000000000000000000000000000000000000 s
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
114 bfb1a4fb358498a9533dabf4f2043d94162f1fcd t
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
115
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
116 Unlink one subrepo
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
117 ------------------
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
118
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
119 add new commit to be amended
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
120
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
121 $ echo a >> a
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
122 $ hg ci -m3
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
123
41977
4ea21df312ec record: prevent commits that don't pick up dirty subrepo changes (issue6102)
Matt Harbison <matt_harbison@yahoo.com>
parents: 35393
diff changeset
124 $ echo 't = t' > .hgsub
4ea21df312ec record: prevent commits that don't pick up dirty subrepo changes (issue6102)
Matt Harbison <matt_harbison@yahoo.com>
parents: 35393
diff changeset
125
4ea21df312ec record: prevent commits that don't pick up dirty subrepo changes (issue6102)
Matt Harbison <matt_harbison@yahoo.com>
parents: 35393
diff changeset
126 --interactive won't silently ignore dirty subrepos
4ea21df312ec record: prevent commits that don't pick up dirty subrepo changes (issue6102)
Matt Harbison <matt_harbison@yahoo.com>
parents: 35393
diff changeset
127
4ea21df312ec record: prevent commits that don't pick up dirty subrepo changes (issue6102)
Matt Harbison <matt_harbison@yahoo.com>
parents: 35393
diff changeset
128 $ echo modified > t/b
4ea21df312ec record: prevent commits that don't pick up dirty subrepo changes (issue6102)
Matt Harbison <matt_harbison@yahoo.com>
parents: 35393
diff changeset
129 $ hg amend --interactive --config ui.interactive=True
4ea21df312ec record: prevent commits that don't pick up dirty subrepo changes (issue6102)
Matt Harbison <matt_harbison@yahoo.com>
parents: 35393
diff changeset
130 abort: uncommitted changes in subrepository "t"
4ea21df312ec record: prevent commits that don't pick up dirty subrepo changes (issue6102)
Matt Harbison <matt_harbison@yahoo.com>
parents: 35393
diff changeset
131 [255]
4ea21df312ec record: prevent commits that don't pick up dirty subrepo changes (issue6102)
Matt Harbison <matt_harbison@yahoo.com>
parents: 35393
diff changeset
132 $ hg amend --interactive --config ui.interactive=True --config ui.commitsubrepos=True
4ea21df312ec record: prevent commits that don't pick up dirty subrepo changes (issue6102)
Matt Harbison <matt_harbison@yahoo.com>
parents: 35393
diff changeset
133 abort: uncommitted changes in subrepository "t"
4ea21df312ec record: prevent commits that don't pick up dirty subrepo changes (issue6102)
Matt Harbison <matt_harbison@yahoo.com>
parents: 35393
diff changeset
134 [255]
4ea21df312ec record: prevent commits that don't pick up dirty subrepo changes (issue6102)
Matt Harbison <matt_harbison@yahoo.com>
parents: 35393
diff changeset
135
4ea21df312ec record: prevent commits that don't pick up dirty subrepo changes (issue6102)
Matt Harbison <matt_harbison@yahoo.com>
parents: 35393
diff changeset
136 $ hg -R t revert -q --all --no-backup
4ea21df312ec record: prevent commits that don't pick up dirty subrepo changes (issue6102)
Matt Harbison <matt_harbison@yahoo.com>
parents: 35393
diff changeset
137
35024
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
138 amend with one subrepo dropped
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
139
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
140 $ hg amend
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
141 saved backup bundle to * (glob) (obsstore-off !)
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
142 $ hg status --change .
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
143 M .hgsub
35026
691524f0bbf6 amend: update .hgsubstate before committing a memctx (issue5677)
Yuya Nishihara <yuya@tcha.org>
parents: 35024
diff changeset
144 M .hgsubstate
35024
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
145 M a
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
146 $ cat .hgsubstate
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
147 bfb1a4fb358498a9533dabf4f2043d94162f1fcd t
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
148
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
149 Unlink subrepos completely
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
150 --------------------------
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
151
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
152 add new commit to be amended
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
153
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
154 $ echo a >> a
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
155 $ hg ci -m3
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
156
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
157 amend with .hgsub removed
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
158
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
159 $ hg rm .hgsub
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
160 $ hg amend
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
161 saved backup bundle to * (glob) (obsstore-off !)
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
162 $ hg status --change .
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
163 M a
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
164 R .hgsub
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
165 R .hgsubstate
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
166
43913
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
167 broken repositories will refuse to push
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
168
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
169 #if obsstore-off
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
170 $ hg up -q -C 2
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
171 #else
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
172 $ hg up -q -C 6
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
173 #endif
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
174 $ echo c >> t/b
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
175 $ hg amend -q -R t
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
176
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
177 $ hg init ../dest
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
178 $ hg init ../dest/t
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
179 $ hg init ../dest/s
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
180 $ hg push -q ../dest
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
181 abort: subrepo 't' is hidden in revision 04aa62396ec6 (obsstore-on !)
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
182 abort: subrepo 't' not found in revision 04aa62396ec6 (obsstore-off !)
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
183 [255]
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
184
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
185 ... unless forced
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
186
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
187 $ hg push --force -q ../dest
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
188 $ hg verify -R ../dest
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
189 checking changesets
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
190 checking manifests
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
191 crosschecking files in changesets and manifests
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
192 checking files
49826
c84844cd523a verify: also check dirstate
Raphaël Gomès <rgomes@octobus.net>
parents: 43913
diff changeset
193 checking dirstate
43913
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
194 checked 5 changesets with 12 changes to 4 files
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
195 checking subrepo links
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
196 subrepo 't' not found in revision 04aa62396ec6
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
197 subrepo 't' not found in revision 6bce99600681
4b7d5d10c45d exchange: ensure all outgoing subrepo references are present before pushing
Matt Harbison <matt_harbison@yahoo.com>
parents: 41977
diff changeset
198
35024
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
199 $ cd ..