D1951: bundle: condition the changegroup part when creating a new bundle

2018-03-19 Thread lothiraldan (Boris Feld)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG66c0ff381cfc: bundle: condition the changegroup part when 
creating a new bundle (authored by lothiraldan, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D1951?vs=5150=7129#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1951?vs=5150=7129

REVISION DETAIL
  https://phab.mercurial-scm.org/D1951

AFFECTED FILES
  mercurial/bundle2.py
  mercurial/commands.py

CHANGE DETAILS

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1263,7 +1263,7 @@
 compopts['level'] = complevel
 
 
-contentopts = {'cg.version': cgversion}
+contentopts = {'cg.version': cgversion, 'changegroup': True}
 if repo.ui.configbool('experimental', 'evolution.bundle-obsmarker'):
 contentopts['obsolescence'] = True
 if repo.ui.configbool('experimental', 'bundle-phases'):
diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -1577,19 +1577,21 @@
 # different right now. So we keep them separated for now for the sake of
 # simplicity.
 
-# we always want a changegroup in such bundle
-cgversion = opts.get('cg.version')
-if cgversion is None:
-cgversion = changegroup.safeversion(repo)
-cg = changegroup.makechangegroup(repo, outgoing, cgversion, source)
-part = bundler.newpart('changegroup', data=cg.getchunks())
-part.addparam('version', cg.version)
-if 'clcount' in cg.extras:
-part.addparam('nbchanges', '%d' % cg.extras['clcount'],
-  mandatory=False)
-if opts.get('phases') and repo.revs('%ln and secret()',
-outgoing.missingheads):
-part.addparam('targetphase', '%d' % phases.secret, mandatory=False)
+# we might not always want a changegroup in such bundle, for example in
+# stream bundles
+if opts.get('changegroup', True):
+cgversion = opts.get('cg.version')
+if cgversion is None:
+cgversion = changegroup.safeversion(repo)
+cg = changegroup.makechangegroup(repo, outgoing, cgversion, source)
+part = bundler.newpart('changegroup', data=cg.getchunks())
+part.addparam('version', cg.version)
+if 'clcount' in cg.extras:
+part.addparam('nbchanges', '%d' % cg.extras['clcount'],
+  mandatory=False)
+if opts.get('phases') and repo.revs('%ln and secret()',
+outgoing.missingheads):
+part.addparam('targetphase', '%d' % phases.secret, mandatory=False)
 
 addparttagsfnodescache(repo, bundler, outgoing)
 addpartrevbranchcache(repo, bundler, outgoing)



To: lothiraldan, #hg-reviewers, indygreg
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D1951: bundle: condition the changegroup part when creating a new bundle

2018-02-02 Thread lothiraldan (Boris Feld)
lothiraldan updated this revision to Diff 5150.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1951?vs=5023=5150

REVISION DETAIL
  https://phab.mercurial-scm.org/D1951

AFFECTED FILES
  mercurial/bundle2.py
  mercurial/commands.py

CHANGE DETAILS

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1257,7 +1257,7 @@
 compopts['level'] = complevel
 
 
-contentopts = {'cg.version': cgversion}
+contentopts = {'cg.version': cgversion, 'changegroup': True}
 if repo.ui.configbool('experimental', 'evolution.bundle-obsmarker'):
 contentopts['obsolescence'] = True
 if repo.ui.configbool('experimental', 'bundle-phases'):
diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -1574,19 +1574,21 @@
 # different right now. So we keep them separated for now for the sake of
 # simplicity.
 
-# we always want a changegroup in such bundle
-cgversion = opts.get('cg.version')
-if cgversion is None:
-cgversion = changegroup.safeversion(repo)
-cg = changegroup.makechangegroup(repo, outgoing, cgversion, source)
-part = bundler.newpart('changegroup', data=cg.getchunks())
-part.addparam('version', cg.version)
-if 'clcount' in cg.extras:
-part.addparam('nbchanges', '%d' % cg.extras['clcount'],
-  mandatory=False)
-if opts.get('phases') and repo.revs('%ln and secret()',
-outgoing.missingheads):
-part.addparam('targetphase', '%d' % phases.secret, mandatory=False)
+# we might not always want a changegroup in such bundle, for example in
+# stream bundles
+if opts.get('changegroup', True):
+cgversion = opts.get('cg.version')
+if cgversion is None:
+cgversion = changegroup.safeversion(repo)
+cg = changegroup.makechangegroup(repo, outgoing, cgversion, source)
+part = bundler.newpart('changegroup', data=cg.getchunks())
+part.addparam('version', cg.version)
+if 'clcount' in cg.extras:
+part.addparam('nbchanges', '%d' % cg.extras['clcount'],
+  mandatory=False)
+if opts.get('phases') and repo.revs('%ln and secret()',
+outgoing.missingheads):
+part.addparam('targetphase', '%d' % phases.secret, mandatory=False)
 
 addparttagsfnodescache(repo, bundler, outgoing)
 



To: lothiraldan, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D1951: bundle: condition the changegroup part when creating a new bundle

2018-01-31 Thread lothiraldan (Boris Feld)
lothiraldan created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We will generate stream bundle in the next changesets which doesn't need the
  changegroup part.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1951

AFFECTED FILES
  mercurial/bundle2.py
  mercurial/commands.py

CHANGE DETAILS

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1257,7 +1257,7 @@
 compopts['level'] = complevel
 
 
-contentopts = {'cg.version': cgversion}
+contentopts = {'cg.version': cgversion, 'changegroup': True}
 if repo.ui.configbool('experimental', 'evolution.bundle-obsmarker'):
 contentopts['obsolescence'] = True
 if repo.ui.configbool('experimental', 'bundle-phases'):
diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -1574,19 +1574,21 @@
 # different right now. So we keep them separated for now for the sake of
 # simplicity.
 
-# we always want a changegroup in such bundle
-cgversion = opts.get('cg.version')
-if cgversion is None:
-cgversion = changegroup.safeversion(repo)
-cg = changegroup.makechangegroup(repo, outgoing, cgversion, source)
-part = bundler.newpart('changegroup', data=cg.getchunks())
-part.addparam('version', cg.version)
-if 'clcount' in cg.extras:
-part.addparam('nbchanges', '%d' % cg.extras['clcount'],
-  mandatory=False)
-if opts.get('phases') and repo.revs('%ln and secret()',
-outgoing.missingheads):
-part.addparam('targetphase', '%d' % phases.secret, mandatory=False)
+# we might not always want a changegroup in such bundle, for example in
+# stream bundles
+if opts.get('changegroup', True):
+cgversion = opts.get('cg.version')
+if cgversion is None:
+cgversion = changegroup.safeversion(repo)
+cg = changegroup.makechangegroup(repo, outgoing, cgversion, source)
+part = bundler.newpart('changegroup', data=cg.getchunks())
+part.addparam('version', cg.version)
+if 'clcount' in cg.extras:
+part.addparam('nbchanges', '%d' % cg.extras['clcount'],
+  mandatory=False)
+if opts.get('phases') and repo.revs('%ln and secret()',
+outgoing.missingheads):
+part.addparam('targetphase', '%d' % phases.secret, mandatory=False)
 
 addparttagsfnodescache(repo, bundler, outgoing)
 



To: lothiraldan, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel