diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py --- a/mercurial/changegroup.py +++ b/mercurial/changegroup.py @@ -697,9 +697,16 @@ def deltagroup(repo, store, nodes, ischa progress = repo.ui.makeprogress(topic, unit=_('chunks'), total=len(nodes)) + configtarget = repo.ui.config('devel', 'bundle.delta') + if configtarget not in ('', 'p1'): + msg = _("""config "devel.bundle.delta" as unknown value: %s""") + repo.ui.warn(msg % configtarget) + deltamode = repository.CG_DELTAMODE_STD if forcedeltaparentprev: deltamode = repository.CG_DELTAMODE_PREV + elif configtarget == 'p1': + deltamode = repository.CG_DELTAMODE_P1 revisions = store.emitrevisions( nodes, diff --git a/mercurial/configitems.py b/mercurial/configitems.py --- a/mercurial/configitems.py +++ b/mercurial/configitems.py @@ -329,6 +329,9 @@ coreconfigitem('devel', 'all-warnings', coreconfigitem('devel', 'bundle2.debug', default=False, ) +coreconfigitem('devel', 'bundle.delta', + default='', +) coreconfigitem('devel', 'cache-vfs', default=None, ) diff --git a/mercurial/repository.py b/mercurial/repository.py --- a/mercurial/repository.py +++ b/mercurial/repository.py @@ -42,6 +42,7 @@ REVISION_FLAGS_KNOWN = ( CG_DELTAMODE_STD = b'default' CG_DELTAMODE_PREV = b'previous' CG_DELTAMODE_FULL = b'fulltext' +CG_DELTAMODE_P1 = b'p1' class ipeerconnection(interfaceutil.Interface): """Represents a "connection" to a repository. diff --git a/mercurial/utils/storageutil.py b/mercurial/utils/storageutil.py --- a/mercurial/utils/storageutil.py +++ b/mercurial/utils/storageutil.py @@ -373,6 +373,9 @@ def emitrevisions(store, nodes, nodesord # We're instructed to send fulltext. Honor that. elif deltamode == repository.CG_DELTAMODE_FULL: baserev = nullrev + # We're instructed to use p1. Honor that + elif deltamode == repository.CG_DELTAMODE_P1: + baserev = p1rev # There is a delta in storage. We try to use that because it # amounts to effectively copying data from storage and is diff --git a/tests/test-bundle.t b/tests/test-bundle.t --- a/tests/test-bundle.t +++ b/tests/test-bundle.t @@ -900,3 +900,8 @@ the warning shouldn't be emitted $ hg update -R ../update2bundled.hg -r 0 0 files updated, 0 files merged, 2 files removed, 0 files unresolved #endif + +Test the option that create slim bundle + + $ hg bundle -a --config devel.bundle.delta=p1 ./slim.hg + 3 changesets found