changeset 37841:d618558e4e8b stable

debugbundle: also display if a part is mandatory or advisory Most parts are mandatory but when introducing new parts, they should be advisory if included by default or old clients won't be able to process it. Differential Revision: https://phab.mercurial-scm.org/D3480
author Boris Feld <boris.feld@octobus.net>
date Tue, 08 May 2018 11:39:38 +0200
parents 1f65d7d46545
children 326b174c6a47
files mercurial/debugcommands.py tests/test-bundle-phases.t tests/test-bundle-type.t tests/test-bundle2-format.t tests/test-debugbundle.t tests/test-generaldelta.t tests/test-getbundle.t tests/test-obsolete-changeset-exchange.t tests/test-obsolete.t tests/test-shelve.t tests/test-stream-bundle-v2.t tests/test-strip.t tests/test-tags.t
diffstat 13 files changed, 64 insertions(+), 63 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Sat May 05 18:03:01 2018 -0500
+++ b/mercurial/debugcommands.py	Tue May 08 11:39:38 2018 +0200
@@ -352,7 +352,8 @@
     for part in gen.iterparts():
         if parttypes and part.type not in parttypes:
             continue
-        ui.write('%s -- %s\n' % (part.type, _quasirepr(part.params)))
+        msg = '%s -- %s (mandatory: %r)\n'
+        ui.write((msg % (part.type, _quasirepr(part.params), part.mandatory)))
         if part.type == 'changegroup':
             version = part.params.get('version', '01')
             cg = changegroup.getunbundler(version, part, 'UN')
--- a/tests/test-bundle-phases.t	Sat May 05 18:03:01 2018 -0500
+++ b/tests/test-bundle-phases.t	Tue May 08 11:39:38 2018 +0200
@@ -38,12 +38,12 @@
   3 changesets found
   $ hg debugbundle bundle
   Stream params: {Compression: BZ}
-  changegroup -- {nbchanges: 3, targetphase: 2, version: 02}
+  changegroup -- {nbchanges: 3, targetphase: 2, version: 02} (mandatory: True)
       26805aba1e600a82e93661149f2313866a221a7b
       f585351a92f85104bff7c284233c338b10eb1df7
       9bc730a19041f9ec7cb33c626e811aa233efb18c
-  cache:rev-branch-cache -- {}
-  phase-heads -- {}
+  cache:rev-branch-cache -- {} (mandatory: True)
+  phase-heads -- {} (mandatory: True)
       26805aba1e600a82e93661149f2313866a221a7b draft
   $ hg strip --no-backup C
   $ hg unbundle -q bundle
@@ -228,14 +228,14 @@
   5 changesets found
   $ hg debugbundle bundle
   Stream params: {Compression: BZ}
-  changegroup -- {nbchanges: 5, targetphase: 2, version: 02}
+  changegroup -- {nbchanges: 5, targetphase: 2, version: 02} (mandatory: True)
       426bada5c67598ca65036d57d9e4b64b0c1ce7a0
       112478962961147124edd43549aedd1a335e44bf
       dc0947a82db884575bb76ea10ac97b08536bfa03
       4e4f9194f9f181c57f62e823e8bdfa46ab9e4ff4
       03ca77807e919db8807c3749086dc36fb478cac0
-  cache:rev-branch-cache -- {}
-  phase-heads -- {}
+  cache:rev-branch-cache -- {} (mandatory: True)
+  phase-heads -- {} (mandatory: True)
       dc0947a82db884575bb76ea10ac97b08536bfa03 public
       03ca77807e919db8807c3749086dc36fb478cac0 draft
   $ hg strip --no-backup A
@@ -257,23 +257,23 @@
   2 changesets found
   $ hg debugbundle bundle
   Stream params: {Compression: BZ}
-  changegroup -- {nbchanges: 2, targetphase: 2, version: 02}
+  changegroup -- {nbchanges: 2, targetphase: 2, version: 02} (mandatory: True)
       112478962961147124edd43549aedd1a335e44bf
       4e4f9194f9f181c57f62e823e8bdfa46ab9e4ff4
-  cache:rev-branch-cache -- {}
-  phase-heads -- {}
+  cache:rev-branch-cache -- {} (mandatory: True)
+  phase-heads -- {} (mandatory: True)
   $ rm bundle
 
   $ hg bundle --base A -r D bundle
   3 changesets found
   $ hg debugbundle bundle
   Stream params: {Compression: BZ}
-  changegroup -- {nbchanges: 3, targetphase: 2, version: 02}
+  changegroup -- {nbchanges: 3, targetphase: 2, version: 02} (mandatory: True)
       112478962961147124edd43549aedd1a335e44bf
       dc0947a82db884575bb76ea10ac97b08536bfa03
       4e4f9194f9f181c57f62e823e8bdfa46ab9e4ff4
-  cache:rev-branch-cache -- {}
-  phase-heads -- {}
+  cache:rev-branch-cache -- {} (mandatory: True)
+  phase-heads -- {} (mandatory: True)
       dc0947a82db884575bb76ea10ac97b08536bfa03 public
   $ rm bundle
 
@@ -281,10 +281,10 @@
   2 changesets found
   $ hg debugbundle bundle
   Stream params: {Compression: BZ}
-  changegroup -- {nbchanges: 2, targetphase: 2, version: 02}
+  changegroup -- {nbchanges: 2, targetphase: 2, version: 02} (mandatory: True)
       4e4f9194f9f181c57f62e823e8bdfa46ab9e4ff4
       03ca77807e919db8807c3749086dc36fb478cac0
-  cache:rev-branch-cache -- {}
-  phase-heads -- {}
+  cache:rev-branch-cache -- {} (mandatory: True)
+  phase-heads -- {} (mandatory: True)
       03ca77807e919db8807c3749086dc36fb478cac0 draft
   $ rm bundle
--- a/tests/test-bundle-type.t	Sat May 05 18:03:01 2018 -0500
+++ b/tests/test-bundle-type.t	Tue May 08 11:39:38 2018 +0200
@@ -66,9 +66,9 @@
   1 changesets found
   HG20\x00\x00 (esc)
   Stream params: {}
-  changegroup -- {nbchanges: 1, version: 02}
+  changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
       c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
-  cache:rev-branch-cache -- {}
+  cache:rev-branch-cache -- {} (mandatory: True)
   none-v2
   
   % test bundle type bzip2
@@ -76,9 +76,9 @@
   1 changesets found
   HG20\x00\x00 (esc)
   Stream params: {Compression: BZ}
-  changegroup -- {nbchanges: 1, version: 02}
+  changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
       c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
-  cache:rev-branch-cache -- {}
+  cache:rev-branch-cache -- {} (mandatory: True)
   bzip2-v2
   
   % test bundle type gzip
@@ -86,9 +86,9 @@
   1 changesets found
   HG20\x00\x00 (esc)
   Stream params: {Compression: GZ}
-  changegroup -- {nbchanges: 1, version: 02}
+  changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
       c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
-  cache:rev-branch-cache -- {}
+  cache:rev-branch-cache -- {} (mandatory: True)
   gzip-v2
   
   % test bundle type none-v2
@@ -96,9 +96,9 @@
   1 changesets found
   HG20\x00\x00 (esc)
   Stream params: {}
-  changegroup -- {nbchanges: 1, version: 02}
+  changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
       c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
-  cache:rev-branch-cache -- {}
+  cache:rev-branch-cache -- {} (mandatory: True)
   none-v2
   
   % test bundle type v2
@@ -106,9 +106,9 @@
   1 changesets found
   HG20\x00\x00 (esc)
   Stream params: {Compression: BZ}
-  changegroup -- {nbchanges: 1, version: 02}
+  changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
       c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
-  cache:rev-branch-cache -- {}
+  cache:rev-branch-cache -- {} (mandatory: True)
   bzip2-v2
   
   % test bundle type v1
@@ -171,9 +171,9 @@
   1 changesets found
   HG20\x00\x00 (esc)
   Stream params: {Compression: ZS}
-  changegroup -- {nbchanges: 1, version: 02}
+  changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
       c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
-  cache:rev-branch-cache -- {}
+  cache:rev-branch-cache -- {} (mandatory: True)
   zstd-v2
   
   % test bundle type zstd-v2
@@ -181,9 +181,9 @@
   1 changesets found
   HG20\x00\x00 (esc)
   Stream params: {Compression: ZS}
-  changegroup -- {nbchanges: 1, version: 02}
+  changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
       c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf
-  cache:rev-branch-cache -- {}
+  cache:rev-branch-cache -- {} (mandatory: True)
   zstd-v2
   
 
--- a/tests/test-bundle2-format.t	Sat May 05 18:03:01 2018 -0500
+++ b/tests/test-bundle2-format.t	Tue May 08 11:39:38 2018 +0200
@@ -993,7 +993,7 @@
 
   $ hg debugbundle ../rev.hg2
   Stream params: {}
-  changegroup -- {}
+  changegroup -- {} (mandatory: False)
       32af7686d403cf45b5d95f2d70cebea587ac806a
       9520eea781bcca16c1e15acc0ba14335a0e8e5ba
       eea13746799a9e0bfd88f29d3c2e9dc9389f524f
@@ -1122,7 +1122,7 @@
   0370: 3b 19 fd af c5 3f f1 60 c3 17                   |;....?.`..|
   $ hg debugbundle ../rev.hg2.bz
   Stream params: {Compression: GZ}
-  changegroup -- {}
+  changegroup -- {} (mandatory: False)
       32af7686d403cf45b5d95f2d70cebea587ac806a
       9520eea781bcca16c1e15acc0ba14335a0e8e5ba
       eea13746799a9e0bfd88f29d3c2e9dc9389f524f
@@ -1209,7 +1209,7 @@
   0430: 2e e4 8a 70 a1 21 46 96 30 7a                   |...p.!F.0z|
   $ hg debugbundle ../rev.hg2.bz
   Stream params: {Compression: BZ}
-  changegroup -- {}
+  changegroup -- {} (mandatory: False)
       32af7686d403cf45b5d95f2d70cebea587ac806a
       9520eea781bcca16c1e15acc0ba14335a0e8e5ba
       eea13746799a9e0bfd88f29d3c2e9dc9389f524f
--- a/tests/test-debugbundle.t	Sat May 05 18:03:01 2018 -0500
+++ b/tests/test-debugbundle.t	Tue May 08 11:39:38 2018 +0200
@@ -31,17 +31,17 @@
 
   $ hg debugbundle bundle2.hg
   Stream params: {}
-  changegroup -- {nbchanges: 2, version: 02}
+  changegroup -- {nbchanges: 2, version: 02} (mandatory: True)
       0e067c57feba1a5694ca4844f05588bb1bf82342
       991a3460af53952d10ec8a295d3d2cc2e5fa9690
-  cache:rev-branch-cache -- {}
+  cache:rev-branch-cache -- {} (mandatory: True)
 
 Quiet output
 
   $ hg debugbundle --quiet bundle2.hg
   Stream params: {}
-  changegroup -- {nbchanges: 2, version: 02}
-  cache:rev-branch-cache -- {}
+  changegroup -- {nbchanges: 2, version: 02} (mandatory: True)
+  cache:rev-branch-cache -- {} (mandatory: True)
 
 Verbose output:
 
@@ -64,7 +64,7 @@
 
   $ hg debugbundle --all bundle2.hg
   Stream params: {}
-  changegroup -- {nbchanges: 2, version: 02}
+  changegroup -- {nbchanges: 2, version: 02} (mandatory: True)
       format: id, p1, p2, cset, delta base, len(delta)
   
       changelog
@@ -80,6 +80,6 @@
   
       c
       b80de5d138758541c5f05265ad144ab9fa86d1db 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 991a3460af53952d10ec8a295d3d2cc2e5fa9690 0000000000000000000000000000000000000000 0
-  cache:rev-branch-cache -- {}
+  cache:rev-branch-cache -- {} (mandatory: True)
 
   $ cd ..
--- a/tests/test-generaldelta.t	Sat May 05 18:03:01 2018 -0500
+++ b/tests/test-generaldelta.t	Tue May 08 11:39:38 2018 +0200
@@ -159,10 +159,10 @@
   saved backup bundle to $TESTTMP/aggressive/.hg/strip-backup/1c5d4dc9a8b8-6c68e60c-backup.hg
   $ hg debugbundle .hg/strip-backup/*
   Stream params: {Compression: BZ}
-  changegroup -- {nbchanges: 1, version: 02}
+  changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
       1c5d4dc9a8b8d6e1750966d343e94db665e7a1e9
-  cache:rev-branch-cache -- {}
-  phase-heads -- {}
+  cache:rev-branch-cache -- {} (mandatory: True)
+  phase-heads -- {} (mandatory: True)
       1c5d4dc9a8b8d6e1750966d343e94db665e7a1e9 draft
 
   $ cd ..
--- a/tests/test-getbundle.t	Sat May 05 18:03:01 2018 -0500
+++ b/tests/test-getbundle.t	Tue May 08 11:39:38 2018 +0200
@@ -170,7 +170,7 @@
   $ hg debuggetbundle repo bundle -t bundle2
   $ hg debugbundle bundle
   Stream params: {}
-  changegroup -- {version: 01}
+  changegroup -- {version: 01} (mandatory: True)
       7704483d56b2a7b5db54dcee7c62378ac629b348
       29a4d1f17bd3f0779ca0525bebb1cfb51067c738
       713346a995c363120712aed1aee7e04afd867638
--- a/tests/test-obsolete-changeset-exchange.t	Sat May 05 18:03:01 2018 -0500
+++ b/tests/test-obsolete-changeset-exchange.t	Tue May 08 11:39:38 2018 +0200
@@ -93,15 +93,15 @@
   1 changesets found
   $ hg debugbundle ../f89bcc95eba5.hg
   Stream params: {Compression: BZ}
-  changegroup -- {nbchanges: 1, version: 02}
+  changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
       f89bcc95eba5174b1ccc3e33a82e84c96e8338ee
-  cache:rev-branch-cache -- {}
+  cache:rev-branch-cache -- {} (mandatory: True)
   $ hg debugbundle ../f89bcc95eba5-obs.hg
   Stream params: {Compression: BZ}
-  changegroup -- {nbchanges: 1, version: 02}
+  changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
       f89bcc95eba5174b1ccc3e33a82e84c96e8338ee
-  cache:rev-branch-cache -- {}
-  obsmarkers -- {}
+  cache:rev-branch-cache -- {} (mandatory: True)
+  obsmarkers -- {} (mandatory: True)
       version: 1 (70 bytes)
       9d73aac1b2ed7d53835eaeec212ed41ea47da53a f89bcc95eba5174b1ccc3e33a82e84c96e8338ee 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
 
--- a/tests/test-obsolete.t	Sat May 05 18:03:01 2018 -0500
+++ b/tests/test-obsolete.t	Tue May 08 11:39:38 2018 +0200
@@ -1452,10 +1452,10 @@
   
   $ hg debugbundle .hg/strip-backup/e008cf283490-*-backup.hg
   Stream params: {Compression: BZ}
-  changegroup -- {nbchanges: 1, version: 02}
+  changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
       e008cf2834908e5d6b0f792a9d4b0e2272260fb8
-  cache:rev-branch-cache -- {}
-  phase-heads -- {}
+  cache:rev-branch-cache -- {} (mandatory: True)
+  phase-heads -- {} (mandatory: True)
       e008cf2834908e5d6b0f792a9d4b0e2272260fb8 draft
 
 #if repobundlerepo
@@ -1495,14 +1495,14 @@
   
   $ hg debugbundle .hg/strip-backup/e016b03fd86f-*-backup.hg
   Stream params: {Compression: BZ}
-  changegroup -- {nbchanges: 2, version: 02}
+  changegroup -- {nbchanges: 2, version: 02} (mandatory: True)
       e016b03fd86fcccc54817d120b90b751aaf367d6
       b0551702f918510f01ae838ab03a463054c67b46
-  cache:rev-branch-cache -- {}
-  obsmarkers -- {}
+  cache:rev-branch-cache -- {} (mandatory: True)
+  obsmarkers -- {} (mandatory: True)
       version: 1 (92 bytes)
       e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
-  phase-heads -- {}
+  phase-heads -- {} (mandatory: True)
       b0551702f918510f01ae838ab03a463054c67b46 draft
 
   $ hg unbundle .hg/strip-backup/e016b03fd86f-*-backup.hg
--- a/tests/test-shelve.t	Sat May 05 18:03:01 2018 -0500
+++ b/tests/test-shelve.t	Tue May 08 11:39:38 2018 +0200
@@ -1122,7 +1122,7 @@
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg debugbundle .hg/shelved/*.hg
   Stream params: {Compression: BZ}
-  changegroup -- {nbchanges: 1, version: 02}
+  changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
       45993d65fe9dc3c6d8764b9c3b07fa831ee7d92d
   $ cd ..
 
--- a/tests/test-stream-bundle-v2.t	Sat May 05 18:03:01 2018 -0500
+++ b/tests/test-stream-bundle-v2.t	Tue May 08 11:39:38 2018 +0200
@@ -46,7 +46,7 @@
   $ hg bundle -a --type="none-v2;stream=v2" bundle.hg
   $ hg debugbundle bundle.hg
   Stream params: {}
-  stream2 -- {bytecount: 1693, filecount: 11, requirements: dotencode%2Cfncache%2Cgeneraldelta%2Crevlogv1%2Cstore}
+  stream2 -- {bytecount: 1693, filecount: 11, requirements: dotencode%2Cfncache%2Cgeneraldelta%2Crevlogv1%2Cstore} (mandatory: True)
   $ hg debugbundle --spec bundle.hg
   none-v2;stream=v2;requirements%3Ddotencode%2Cfncache%2Cgeneraldelta%2Crevlogv1%2Cstore
 
--- a/tests/test-strip.t	Sat May 05 18:03:01 2018 -0500
+++ b/tests/test-strip.t	Tue May 08 11:39:38 2018 +0200
@@ -210,10 +210,10 @@
   
   $ hg debugbundle .hg/strip-backup/*
   Stream params: {Compression: BZ}
-  changegroup -- {nbchanges: 1, version: 02}
+  changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
       264128213d290d868c54642d13aeaa3675551a78
-  cache:rev-branch-cache -- {}
-  phase-heads -- {}
+  cache:rev-branch-cache -- {} (mandatory: True)
+  phase-heads -- {} (mandatory: True)
       264128213d290d868c54642d13aeaa3675551a78 draft
   $ hg unbundle .hg/strip-backup/*
   adding changesets
--- a/tests/test-tags.t	Sat May 05 18:03:01 2018 -0500
+++ b/tests/test-tags.t	Tue May 08 11:39:38 2018 +0200
@@ -727,13 +727,13 @@
   4 changesets found
   $ hg debugbundle ./test-cache-in-bundle-all-rev.hg
   Stream params: {Compression: BZ}
-  changegroup -- {nbchanges: 4, version: 02}
+  changegroup -- {nbchanges: 4, version: 02} (mandatory: True)
       96ee1d7354c4ad7372047672c36a1f561e3a6a4c
       c4dab0c2fd337eb9191f80c3024830a4889a8f34
       f63cc8fe54e4d326f8d692805d70e092f851ddb1
       40f0358cb314c824a5929ee527308d90e023bc10
-  hgtagsfnodes -- {}
-  cache:rev-branch-cache -- {}
+  hgtagsfnodes -- {} (mandatory: True)
+  cache:rev-branch-cache -- {} (mandatory: True)
 
 Check that local clone includes cache data