Debian Codegraph @

tests/test-obsolete-changeset-exchange.t

raw
1 Test changesets filtering during exchanges (some tests are still in
2 test-obsolete.t)
3
4 $ cat >> $HGRCPATH << EOF
5 > [experimental]
6 > evolution.createmarkers=True
7 > EOF
8
9 Push does not corrupt remote
10 ----------------------------
11
12 Create a DAG where a changeset reuses a revision from a file first used in an
13 extinct changeset.
14
15 $ hg init local
16 $ cd local
17 $ echo 'base' > base
18 $ hg commit -Am base
19 adding base
20 $ echo 'A' > A
21 $ hg commit -Am A
22 adding A
23 $ hg up 0
24 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
25 $ hg revert -ar 1
26 adding A
27 $ hg commit -Am "A'"
28 created new head
29 $ hg log -G --template='{desc} {node}'
30 @ A' f89bcc95eba5174b1ccc3e33a82e84c96e8338ee
31 |
32 | o A 9d73aac1b2ed7d53835eaeec212ed41ea47da53a
33 |/
34 o base d20a80d4def38df63a4b330b7fb688f3d4cae1e3
35
36 $ hg debugobsolete 9d73aac1b2ed7d53835eaeec212ed41ea47da53a f89bcc95eba5174b1ccc3e33a82e84c96e8338ee
37 1 new obsolescence markers
38 obsoleted 1 changesets
39
40 Push it. The bundle should not refer to the extinct changeset.
41
42 $ hg init ../other
43 $ hg push ../other
44 pushing to ../other
45 searching for changes
46 adding changesets
47 adding manifests
48 adding file changes
49 added 2 changesets with 2 changes to 2 files
50 $ hg -R ../other verify -q
51
52 Adding a changeset going extinct locally
53 ------------------------------------------
54
55 Pull a changeset that will immediatly goes extinct (because you already have a
56 marker to obsolete him)
57 (test resolution of issue3788)
58
59 $ hg phase --draft --force f89bcc95eba5
60 $ hg phase -R ../other --draft --force f89bcc95eba5
61 $ hg commit --amend -m "A''"
62 $ hg --hidden --config extensions.mq= strip --no-backup f89bcc95eba5
63 $ hg pull ../other
64 pulling from ../other
65 searching for changes
66 adding changesets
67 adding manifests
68 adding file changes
69 added 1 changesets with 0 changes to 1 files (+1 heads)
70 1 new phase-divergent changesets
71 new changesets f89bcc95eba5
72 (run 'hg heads' to see heads, 'hg merge' to merge)
73
74 check that bundle is not affected
75
76 $ hg bundle --hidden --rev f89bcc95eba5 --base "f89bcc95eba5^" ../f89bcc95eba5.hg
77 1 changesets found
78 $ hg --hidden --config extensions.mq= strip --no-backup f89bcc95eba5
79 $ hg unbundle ../f89bcc95eba5.hg
80 adding changesets
81 adding manifests
82 adding file changes
83 added 1 changesets with 0 changes to 1 files (+1 heads)
84 (1 other changesets obsolete on arrival)
85 (run 'hg heads' to see heads)
86
87 check-that bundle can contain markers:
88
89 $ hg bundle --hidden --rev f89bcc95eba5 --base "f89bcc95eba5^" ../f89bcc95eba5-obs.hg --config experimental.evolution.bundle-obsmarker=1
90 1 changesets found
91 $ hg debugbundle ../f89bcc95eba5.hg
92 Stream params: {Compression: BZ}
93 changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
94 f89bcc95eba5174b1ccc3e33a82e84c96e8338ee
95 cache:rev-branch-cache -- {} (mandatory: False)
96 $ hg debugbundle ../f89bcc95eba5-obs.hg
97 Stream params: {Compression: BZ}
98 changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
99 f89bcc95eba5174b1ccc3e33a82e84c96e8338ee
100 cache:rev-branch-cache -- {} (mandatory: False)
101 obsmarkers -- {} (mandatory: True)
102 version: 1 (70 bytes)
103 9d73aac1b2ed7d53835eaeec212ed41ea47da53a f89bcc95eba5174b1ccc3e33a82e84c96e8338ee 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
104
105 $ cd ..
106
107 pull does not fetch excessive changesets when common node is hidden (issue4982)
108 -------------------------------------------------------------------------------
109
110 initial repo with server and client matching
111
112 $ hg init pull-hidden-common
113 $ cd pull-hidden-common
114 $ touch foo
115 $ hg -q commit -A -m initial
116 $ echo 1 > foo
117 $ hg commit -m 1
118 $ echo 2a > foo
119 $ hg commit -m 2a
120 $ cd ..
121 $ hg clone --pull pull-hidden-common pull-hidden-common-client
122 requesting all changes
123 adding changesets
124 adding manifests
125 adding file changes
126 added 3 changesets with 3 changes to 1 files
127 new changesets 96ee1d7354c4:6a29ed9c68de
128 updating to branch default
129 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
130
131 server obsoletes the old head
132
133 $ cd pull-hidden-common
134 $ hg -q up -r 1
135 $ echo 2b > foo
136 $ hg -q commit -m 2b
137 $ hg debugobsolete 6a29ed9c68defff1a139e5c6fa9696fb1a75783d bec0734cd68e84477ba7fc1d13e6cff53ab70129
138 1 new obsolescence markers
139 obsoleted 1 changesets
140 $ cd ..
141
142 client only pulls down 1 changeset
143
144 $ cd pull-hidden-common-client
145 $ hg pull --debug
146 pulling from $TESTTMP/pull-hidden-common
147 query 1; heads
148 searching for changes
149 taking quick initial sample
150 query 2; still undecided: 2, sample size is: 2
151 2 total queries in *.????s (glob)
152 1 changesets found
153 list of changesets:
154 bec0734cd68e84477ba7fc1d13e6cff53ab70129
155 listing keys for "bookmarks"
156 bundle2-output-bundle: "HG20", 3 parts total
157 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
158 bundle2-output-part: "listkeys" (params: 1 mandatory) empty payload
159 bundle2-output-part: "phase-heads" 24 bytes payload
160 bundle2-input-bundle: with-transaction
161 bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported
162 adding changesets
163 add changeset bec0734cd68e
164 adding manifests
165 adding file changes
166 adding foo revisions
167 bundle2-input-part: total payload size 486
168 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
169 bundle2-input-part: "phase-heads" supported
170 bundle2-input-part: total payload size 24
171 bundle2-input-bundle: 3 parts total
172 checking for updated bookmarks
173 updating the branch cache
174 added 1 changesets with 1 changes to 1 files (+1 heads)
175 new changesets bec0734cd68e
176 (run 'hg heads' to see heads, 'hg merge' to merge)