Mercurial > public > mercurial-scm > hg-stable
diff mercurial/bundle2.py @ 35788:b116a66bcc44
bundle2: move version of stream clone into part name
I don't like having version numbers as part parameters. It means
that parts can theoretically vary wildly in their generation and
processing semantics. I think that a named part should have consistent
behavior over time. In other words, if you need to introduce new
functionality or behavior, that should be expressed by inventing
a new bundle2 part, not adding functionality to an existing part.
This commit applies this advice to the just-introduced stream clone
via bundle2 feature.
The "version" part parameter is removed. The name of the bundle2 part
is now "stream2" instead of "stream" with "version=v2".
Differential Revision: https://phab.mercurial-scm.org/D1927
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 22 Jan 2018 12:19:49 -0800 |
parents | a84dbc87dae9 |
children | c1b9eb15a51c |
line wrap: on
line diff
--- a/mercurial/bundle2.py Mon Jan 22 12:12:29 2018 -0800 +++ b/mercurial/bundle2.py Mon Jan 22 12:19:49 2018 -0800 @@ -2130,12 +2130,9 @@ hookargs[key] = value op.addhookargs(hookargs) -@parthandler('stream', ('requirements', 'filecount', 'bytecount', 'version')) -def handlestreambundle(op, part): +@parthandler('stream2', ('requirements', 'filecount', 'bytecount')) +def handlestreamv2bundle(op, part): - version = part.params['version'] - if version != 'v2': - raise error.Abort(_('unknown stream bundle version %s') % version) requirements = part.params['requirements'].split() filecount = int(part.params['filecount']) bytecount = int(part.params['bytecount'])