##// END OF EJS Templates
bundle: optional advisory obsolescence parts...
Joerg Sonnenberger -
r46780:41d695a0 default
parent child Browse files
Show More
@@ -1739,7 +1739,11 b' def _addpartsfromopts(ui, repo, bundler,'
1739
1739
1740 if opts.get(b'obsolescence', False):
1740 if opts.get(b'obsolescence', False):
1741 obsmarkers = repo.obsstore.relevantmarkers(outgoing.missing)
1741 obsmarkers = repo.obsstore.relevantmarkers(outgoing.missing)
1742 buildobsmarkerspart(bundler, obsmarkers)
1742 buildobsmarkerspart(
1743 bundler,
1744 obsmarkers,
1745 mandatory=opts.get(b'obsolescence-mandatory', True),
1746 )
1743
1747
1744 if opts.get(b'phases', False):
1748 if opts.get(b'phases', False):
1745 headsbyphase = phases.subsetphaseheads(repo, outgoing.missing)
1749 headsbyphase = phases.subsetphaseheads(repo, outgoing.missing)
@@ -1862,7 +1866,7 b' def addpartbundlestream2(bundler, repo, '
1862 part.addparam(b'requirements', requirements, mandatory=True)
1866 part.addparam(b'requirements', requirements, mandatory=True)
1863
1867
1864
1868
1865 def buildobsmarkerspart(bundler, markers):
1869 def buildobsmarkerspart(bundler, markers, mandatory=True):
1866 """add an obsmarker part to the bundler with <markers>
1870 """add an obsmarker part to the bundler with <markers>
1867
1871
1868 No part is created if markers is empty.
1872 No part is created if markers is empty.
@@ -1876,7 +1880,7 b' def buildobsmarkerspart(bundler, markers'
1876 if version is None:
1880 if version is None:
1877 raise ValueError(b'bundler does not support common obsmarker format')
1881 raise ValueError(b'bundler does not support common obsmarker format')
1878 stream = obsolete.encodemarkers(markers, True, version=version)
1882 stream = obsolete.encodemarkers(markers, True, version=version)
1879 return bundler.newpart(b'obsmarkers', data=stream)
1883 return bundler.newpart(b'obsmarkers', data=stream, mandatory=mandatory)
1880
1884
1881
1885
1882 def writebundle(
1886 def writebundle(
@@ -1648,12 +1648,17 b' def bundle(ui, repo, fname, dest=None, *'
1648 if complevel is not None:
1648 if complevel is not None:
1649 compopts[b'level'] = complevel
1649 compopts[b'level'] = complevel
1650
1650
1651 # Allow overriding the bundling of obsmarker in phases through
1651 # Bundling of obsmarker and phases is optional as not all clients
1652 # configuration while we don't have a bundle version that include them
1652 # support the necessary features.
1653 if repo.ui.configbool(b'experimental', b'evolution.bundle-obsmarker'):
1653 cfg = ui.configbool
1654 bundlespec.contentopts[b'obsolescence'] = True
1654 contentopts = {
1655 if repo.ui.configbool(b'experimental', b'bundle-phases'):
1655 b'obsolescence': cfg(b'experimental', b'evolution.bundle-obsmarker'),
1656 bundlespec.contentopts[b'phases'] = True
1656 b'obsolescence-mandatory': cfg(
1657 b'experimental', b'evolution.bundle-obsmarker:mandatory'
1658 ),
1659 b'phases': cfg(b'experimental', b'bundle-phases'),
1660 }
1661 bundlespec.contentopts.update(contentopts)
1657
1662
1658 bundle2.writenewbundle(
1663 bundle2.writenewbundle(
1659 ui,
1664 ui,
@@ -900,6 +900,11 b' coreconfigitem('
900 )
900 )
901 coreconfigitem(
901 coreconfigitem(
902 b'experimental',
902 b'experimental',
903 b'evolution.bundle-obsmarker:mandatory',
904 default=True,
905 )
906 coreconfigitem(
907 b'experimental',
903 b'log.topo',
908 b'log.topo',
904 default=False,
909 default=False,
905 )
910 )
@@ -1444,3 +1444,35 b' Actual testing'
1444 # unbundling: new changesets 9ac430e15fca (1 drafts)
1444 # unbundling: new changesets 9ac430e15fca (1 drafts)
1445 # unbundling: (1 other changesets obsolete on arrival)
1445 # unbundling: (1 other changesets obsolete on arrival)
1446 # unbundling: (run 'hg update' to get a working copy)
1446 # unbundling: (run 'hg update' to get a working copy)
1447
1448 Test that advisory obsolescence markers in bundles are ignored if unsupported
1449
1450 $ hg init repo-with-obs
1451 $ cd repo-with-obs
1452 $ hg debugbuilddag +1
1453 $ hg debugobsolete `getid 0`
1454 1 new obsolescence markers
1455 obsoleted 1 changesets
1456 $ hg bundle --config experimental.evolution.bundle-obsmarker=true --config experimental.evolution.bundle-obsmarker:mandatory=false --all --hidden bundle-with-obs
1457 1 changesets found
1458 $ cd ..
1459 $ hg init repo-without-obs
1460 $ cd repo-without-obs
1461 $ hg --config experimental.evolution=False unbundle ../repo-with-obs/bundle-with-obs --debug
1462 bundle2-input-bundle: 1 params with-transaction
1463 bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported
1464 adding changesets
1465 add changeset 1ea73414a91b
1466 adding manifests
1467 adding file changes
1468 bundle2-input-part: total payload size 190
1469 bundle2-input-part: "cache:rev-branch-cache" (advisory) supported
1470 bundle2-input-part: total payload size 39
1471 bundle2-input-part: "obsmarkers" (advisory) supported
1472 bundle2-input-part: total payload size 50
1473 ignoring obsolescence markers, feature not enabled
1474 bundle2-input-bundle: 3 parts total
1475 updating the branch cache
1476 added 1 changesets with 0 changes to 0 files
1477 new changesets 1ea73414a91b (1 drafts)
1478 (run 'hg update' to get a working copy)
@@ -138,14 +138,42 b' client side: pull from the server'
138
138
139 $ hg up 'desc("ROOT")'
139 $ hg up 'desc("ROOT")'
140 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
140 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
141 $ hg pull --confirm --config ui.interactive=True << EOF
141 $ hg pull --debug --confirm --config ui.interactive=True << EOF
142 > n
142 > n
143 > EOF
143 > EOF
144 pulling from $TESTTMP/distributed-chain-building/server
144 pulling from $TESTTMP/distributed-chain-building/server
145 query 1; heads
145 searching for changes
146 searching for changes
147 taking quick initial sample
148 query 2; still undecided: 1, sample size is: 1
149 2 total queries in *.*s (glob)
150 1 changesets found
151 list of changesets:
152 391a2bf12b1b8b05a72400ae36b26d50a091dc22
153 listing keys for "bookmarks"
154 bundle2-output-bundle: "HG20", 5 parts total
155 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
156 bundle2-output-part: "listkeys" (params: 1 mandatory) empty payload
157 bundle2-output-part: "obsmarkers" streamed payload
158 bundle2-output-part: "phase-heads" 48 bytes payload
159 bundle2-output-part: "cache:rev-branch-cache" (advisory) streamed payload
160 bundle2-input-bundle: with-transaction
161 bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported
146 adding changesets
162 adding changesets
163 add changeset 391a2bf12b1b
147 adding manifests
164 adding manifests
148 adding file changes
165 adding file changes
166 adding c_B1 revisions
167 bundle2-input-part: total payload size 485
168 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
169 bundle2-input-part: "obsmarkers" supported
170 bundle2-input-part: total payload size 143
171 bundle2-input-part: "phase-heads" supported
172 bundle2-input-part: total payload size 48
173 bundle2-input-part: "cache:rev-branch-cache" (advisory) supported
174 bundle2-input-part: total payload size 39
175 bundle2-input-bundle: 5 parts total
176 checking for updated bookmarks
149 adding 1 changesets with 1 changes to 1 files (+1 heads)
177 adding 1 changesets with 1 changes to 1 files (+1 heads)
150 1 new obsolescence markers
178 1 new obsolescence markers
151 obsoleting 1 changesets
179 obsoleting 1 changesets
@@ -1682,6 +1682,24 b' Testing that strip remove markers:'
1682 |
1682 |
1683 @ 0:a78f55e5508c (draft) [ ] 0
1683 @ 0:a78f55e5508c (draft) [ ] 0
1684
1684
1685
1686
1687 Test that bundles can ship the markers without making them mandatory
1688 for non-obsmarker enabled clients:
1689
1690 $ hg --config experimental.evolution.bundle-obsmarker=1 --config experimental.evolution.bundle-obsmarker:mandatory=0 bundle --base 0 -r 1:: obslog-bundle.hg
1691 2 changesets found
1692 $ hg debugbundle obslog-bundle.hg
1693 Stream params: {Compression: BZ}
1694 changegroup -- {nbchanges: 2, version: 02} (mandatory: True)
1695 e016b03fd86fcccc54817d120b90b751aaf367d6
1696 b0551702f918510f01ae838ab03a463054c67b46
1697 cache:rev-branch-cache -- {} (mandatory: False)
1698 obsmarkers -- {} (mandatory: False)
1699 version: 1 (92 bytes)
1700 e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
1701
1702
1685 Test that 'hg debugobsolete --index --rev' can show indices of obsmarkers when
1703 Test that 'hg debugobsolete --index --rev' can show indices of obsmarkers when
1686 only a subset of those are displayed (because of --rev option)
1704 only a subset of those are displayed (because of --rev option)
1687 $ hg init doindexrev
1705 $ hg init doindexrev
General Comments 0
You need to be logged in to leave comments. Login now