diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py index 33b7283a38284e65e9ec78dc73566ba919267186_bWVyY3VyaWFsL2RlYnVnY29tbWFuZHMucHk=..23734c0e361fa19c1c580672f0f06d9117e367e6_bWVyY3VyaWFsL2RlYnVnY29tbWFuZHMucHk= 100644 --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -47,6 +47,7 @@ lock as lockmod, merge as mergemod, obsolete, + phases, policy, pvec, pycompat, @@ -421,6 +422,12 @@ Stream bundles are special bundles that are essentially archives of revlog files. They are commonly used for cloning very quickly. """ + # TODO we may want to turn this into an abort when this functionality + # is moved into `hg bundle`. + if phases.hassecret(repo): + ui.warn(_('(warning: stream clone bundle will contain secret ' + 'revisions)\n')) + requirements, gen = streamclone.generatebundlev1(repo) changegroup.writechunks(ui, gen, fname) diff --git a/tests/test-bundle.t b/tests/test-bundle.t index 33b7283a38284e65e9ec78dc73566ba919267186_dGVzdHMvdGVzdC1idW5kbGUudA==..23734c0e361fa19c1c580672f0f06d9117e367e6_dGVzdHMvdGVzdC1idW5kbGUudA== 100644 --- a/tests/test-bundle.t +++ b/tests/test-bundle.t @@ -302,6 +302,20 @@ $ hg debugbundle --spec packednongd.hg none-packed1;requirements%3Drevlogv1 +Warning emitted when packed bundles contain secret changesets + + $ hg init testsecret + $ cd testsecret + $ touch foo + $ hg -q commit -A -m initial + $ hg phase --force --secret -r . + $ cd .. + + $ hg -R testsecret debugcreatestreamclonebundle packedsecret.hg + (warning: stream clone bundle will contain secret revisions) + writing 301 bytes for 3 files + bundle requirements: generaldelta, revlogv1 + Unpacking packed1 bundles with "hg unbundle" isn't allowed $ hg init packed