[PATCH 4 of 4 V2] changegroup: add a option to create bundle with full snapshot only

Boris Feld boris.feld at octobus.net
Thu Oct 18 06:56:15 EDT 2018


# HG changeset patch
# User Boris Feld <boris.feld at octobus.net>
# Date 1539858666 -7200
#      Thu Oct 18 12:31:06 2018 +0200
# Node ID 4c805ec9e478424e631ed8bb7ba6fd65714cfd15
# Parent  2a54c05a0e8901bb171721024843531f95382616
# EXP-Topic slim-bundle
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 4c805ec9e478
changegroup: add a option to create bundle with full snapshot only

This is easy to implement now and can be useful for benchmarking.

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -698,7 +698,7 @@ def deltagroup(repo, store, nodes, ischa
                                         total=len(nodes))
 
     configtarget = repo.ui.config('devel', 'bundle.delta')
-    if configtarget not in ('', 'p1'):
+    if configtarget not in ('', 'p1', 'full'):
         msg = _("""config "devel.bundle.delta" as unknown value: %s""")
         repo.ui.warn(msg % configtarget)
 
@@ -707,6 +707,8 @@ def deltagroup(repo, store, nodes, ischa
         deltamode = repository.CG_DELTAMODE_PREV
     elif configtarget == 'p1':
         deltamode = repository.CG_DELTAMODE_P1
+    elif configtarget == 'full':
+        deltamode = repository.CG_DELTAMODE_FULL
 
     revisions = store.emitrevisions(
         nodes,
diff --git a/tests/test-bundle.t b/tests/test-bundle.t
--- a/tests/test-bundle.t
+++ b/tests/test-bundle.t
@@ -905,3 +905,7 @@ Test the option that create slim bundle
 
   $ hg bundle -a --config devel.bundle.delta=p1 ./slim.hg
   3 changesets found
+
+Test the option that create and no-delta's bundle
+  $ hg bundle -a --config devel.bundle.delta=full ./full.hg
+  3 changesets found


More information about the Mercurial-devel mailing list