Merge lp:~jelmer/bzr/overwrite-tags into lp:bzr/2.5
| Status: | Rejected | ||||
|---|---|---|---|---|---|
| Rejected by: | Jelmer Vernooij on 2012-04-16 | ||||
| Proposed branch: | lp:~jelmer/bzr/overwrite-tags | ||||
| Merge into: | lp:bzr/2.5 | ||||
| Diff against target: |
202 lines (+80/-10) 6 files modified
bzrlib/branch.py (+20/-5) bzrlib/builtins.py (+22/-3) bzrlib/push.py (+2/-2) bzrlib/tests/blackbox/test_pull.py (+17/-0) bzrlib/tests/blackbox/test_push.py (+16/-0) doc/en/release-notes/bzr-2.5.txt (+3/-0) |
||||
| To merge this branch: | bzr merge lp:~jelmer/bzr/overwrite-tags | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Jelmer Vernooij (community) | Disapprove on 2012-04-16 | ||
| Vincent Ladeuil | 2012-02-02 | Approve on 2012-04-13 | |
|
Review via email:
|
|||
Description of the Change
Add --overwrite-tags argument to "bzr push" and "bzr pull".
I'm not entirely sure about the API change. I don't really want to end up with overwrite-history, overwrite-tags, overwrite-
| Vincent Ladeuil (vila) wrote : | # |
Having slept on the topic, I had some more ideas.
My main objection here is that we break the API at the command-line level
which is bad for plugins overriding pull or push.
A less important objection is that the way we override the meaning of
--overwrite is a bit hackish and hard to document for plugins as well as
users.
A deeper one is that this smells like a work-around waiting for a more
robust story for tag handling which need to be versioned.
I can think of two ways to address these issues:
1) Create a specific Overwrite optparse option that will accept being used
as either: '--overwrite' or '--overwrite tags'. Internally we can still
consider that overwrite=False means nothing is overwritten and is a list of
components to overwrite otherwise. Since we used 'if overwrite' in the code
and 'overwrite=False' in signatures this should work.
This works less well as the command-line level as we need to make sure we
correctly interpret '--overwrite <url>' by leaving <url> alone (restricting
to 'tags' or ':tags', the latter avoiding ambiguities.
Not super user-friendly but workable.
2) We don't introduce an '--overwrite-tags' cmdline option but instead add
config options: 'pull.overwrite' and 'push.overwrite' defaulting to
'history,tags' (or 'revisions' instead of 'history' ?).
In this case, neither the cmdline interface is changed nor any internal
APIs, the interpretation of 'overwrite' is just delayed.
This seems less intrusive, will provide some help via 'bzr help
pull.overwrite' and is fully backward compatible.
This can then be used as 'bzr pull --overwrite -Opull.
This proposal then becomes a bugfix that can very well land in 2.5.
Thoughts ?
| Jelmer Vernooij (jelmer) wrote : | # |
Am 03/02/12 09:55, schrieb Vincent Ladeuil:
> Having slept on the topic, I had some more ideas.
>
> My main objection here is that we break the API at the command-line level
> which is bad for plugins overriding pull or push.
Why is this a problem while if we're going to do another beta release?
AFAIK I'm the only person who works on plugins that override pull or
push, and I'm happy to do new releases of them before 2.5.0.
> A less important objection is that the way we override the meaning of
> --overwrite is a bit hackish and hard to document for plugins as well as
> users.
>
> A deeper one is that this smells like a work-around waiting for a more
> robust story for tag handling which need to be versioned.
>
> I can think of two ways to address these issues:
>
> 1) Create a specific Overwrite optparse option that will accept being used
> as either: '--overwrite' or '--overwrite tags'. Internally we can still
> consider that overwrite=False means nothing is overwritten and is a list of
> components to overwrite otherwise. Since we used 'if overwrite' in the code
> and 'overwrite=False' in signatures this should work.
>
> This works less well as the command-line level as we need to make sure we
> correctly interpret '--overwrite <url>' by leaving <url> alone (restricting
> to 'tags' or ':tags', the latter avoiding ambiguities.
>
> Not super user-friendly but workable.
Is it really a problem if we add an option (--overwrite-tags) that is
specific to formats with non-versioned tags? In the future it will just
become irrelevant for some formats, but it will stay useful for older
formats and some foreign formats anyway. Changing optparse seems much
more intrusive than just adding another option, and it's less well
discoverable.
> 2) We don't introduce an '--overwrite-tags' cmdline option but instead add
> config options: 'pull.overwrite' and 'push.overwrite' defaulting to
> 'history,tags' (or 'revisions' instead of 'history' ?).
>
> In this case, neither the cmdline interface is changed nor any internal
> APIs, the interpretation of 'overwrite' is just delayed.
>
> This seems less intrusive, will provide some help via 'bzr help
> pull.overwrite' and is fully backward compatible.
>
> This can then be used as 'bzr pull --overwrite -Opull.
>
> This proposal then becomes a bugfix that can very well land in 2.5.
I don't see how this helps - it is still a contract change. This still
requires the foreign plugins to be updated, because they have to add
support for this option. Without support for that option in the foreign
plugins they will always just overwrite history and tags, which is just
as bad.
Cheers,
Jelmer
| Vincent Ladeuil (vila) wrote : | # |
> Am 03/02/12 09:55, schrieb Vincent Ladeuil:
> > Having slept on the topic, I had some more ideas.
> >
> > My main objection here is that we break the API at the command-line level
> > which is bad for plugins overriding pull or push.
> Why is this a problem while if we're going to do another beta release?
> AFAIK I'm the only person who works on plugins that override pull or
> push, and I'm happy to do new releases of them before 2.5.0.
I don't think bzr-pipeline is impacted but what about bzr-loom ?
> > Not super user-friendly but workable.
> Is it really a problem if we add an option (--overwrite-tags) that is
> specific to formats with non-versioned tags? In the future it will just
> become irrelevant for some formats, but it will stay useful for older
> formats and some foreign formats anyway. Changing optparse seems much
> more intrusive than just adding another option, and it's less well
> discoverable.
I'm not talking about chnaging optparse, I'm talking of introducing a
specific option.
> > 2) We don't introduce an '--overwrite-tags' cmdline option but instead add
> > config options: 'pull.overwrite' and 'push.overwrite' defaulting to
> > 'history,tags' (or 'revisions' instead of 'history' ?).
> >
> > In this case, neither the cmdline interface is changed nor any internal
> > APIs, the interpretation of 'overwrite' is just delayed.
> >
> > This seems less intrusive, will provide some help via 'bzr help
> > pull.overwrite' and is fully backward compatible.
> >
> > This can then be used as 'bzr pull --overwrite -Opull.
> >
> > This proposal then becomes a bugfix that can very well land in 2.5.
> I don't see how this helps - it is still a contract change.
A less intrusive one, that's the point. If the options are used with older
bzr, nothing happens.
> This still requires the foreign plugins to be updated, because they have
> to add support for this option.
How is your proposal different in this respect ?
These options also don't require updating the plugins unless they override
bzr internals. If they do they need to be updated whatever solution is used.
| Jelmer Vernooij (jelmer) wrote : | # |
On 02/03/2012 02:10 PM, Vincent Ladeuil wrote:
>> Am 03/02/12 09:55, schrieb Vincent Ladeuil:
>>> Having slept on the topic, I had some more ideas.
>>>
>>> My main objection here is that we break the API at the command-line level
>>> which is bad for plugins overriding pull or push.
>> Why is this a problem while if we're going to do another beta release?
>> AFAIK I'm the only person who works on plugins that override pull or
>> push, and I'm happy to do new releases of them before 2.5.0.
>
> I don't think bzr-pipeline is impacted but what about bzr-loom ?
bzr-loom isn't impacted either as far as I can tell - it just passes
'overwrite' along as argument to the underlying Branch implementation.
>
>>> Not super user-friendly but workable.
>> Is it really a problem if we add an option (--overwrite-tags) that is
>> specific to formats with non-versioned tags? In the future it will just
>> become irrelevant for some formats, but it will stay useful for older
>> formats and some foreign formats anyway. Changing optparse seems much
>> more intrusive than just adding another option, and it's less well
>> discoverable.
>
> I'm not talking about chnaging optparse, I'm talking of introducing a
> specific option.
Still, it's changing an existing option and adding a bunch of logic to
deal with possible arguments to options. I don't see how that's better
than adding a new (more discoverable) option.
>
>>> 2) We don't introduce an '--overwrite-tags' cmdline option but
instead add
>>> config options: 'pull.overwrite' and 'push.overwrite' defaulting to
>>> 'history,tags' (or 'revisions' instead of 'history' ?).
>>>
>>> In this case, neither the cmdline interface is changed nor any internal
>>> APIs, the interpretation of 'overwrite' is just delayed.
>>>
>>> This seems less intrusive, will provide some help via 'bzr help
>>> pull.overwrite' and is fully backward compatible.
>>>
>>> This can then be used as 'bzr pull --overwrite -Opull.
>>>
>>> This proposal then becomes a bugfix that can very well land in 2.5.
>
>> I don't see how this helps - it is still a contract change.
>
> A less intrusive one, that's the point. If the options are used with older
> bzr, nothing happens.
Something does happen, because history will be overwritten *too* (since
the underlying implementation doesn't look at pull.overwrite), not just
the tags. The same is the case with my change.
Also, isn't -O new in 2.5 anyway ?
>
>> This still requires the foreign plugins to be updated, because they have
>> to add support for this option.
>
> How is your proposal different in this respect ?
It isn't different in this respect, but neither does the alternative
provide any benefits in this regard.
> These options also don't require updating the plugins unless they override
> bzr internals. If they do they need to be updated whatever solution is
used.
Why do any plugins other than bzr-{svn,git,hg} have to be updated in the
case of my MP?
Cheers,
Jelmer
| Jelmer Vernooij (jelmer) wrote : | # |
Any chance of this in 2.5.1 perhaps?
| Vincent Ladeuil (vila) wrote : | # |
Since versioned tags won't come soon, it makes sense to address the gap *now*, in 2.5, please land.
- 6167. By Jelmer Vernooij on 2012-04-16
-
Merge bzr.dev.
| Jelmer Vernooij (jelmer) wrote : | # |
This can't land on 2.5 anymore since it's a fairly major API change that will break bzr-git, bzr-svn and bzr-hg.:-(
Unmerged revisions
- 6167. By Jelmer Vernooij on 2012-04-16
-
Merge bzr.dev.
- 6166. By Jelmer Vernooij on 2012-02-02
-
Merge 2.5.
- 6165. By Jelmer Vernooij on 2012-01-30
-
Fix conflict resolution.
- 6164. By Jelmer Vernooij on 2012-01-30
-
Merge 2.5 branch.
- 6163. By Jelmer Vernooij on 2011-11-04
-
Add --overwrite-tags flag.
- 6162. By Jelmer Vernooij on 2011-09-22
-
Add --overwrite-tags arguments to push and pull.
- 6161. By Jelmer Vernooij on 2011-09-22
-
Add some tests for 'bzr pull --overwrite-tags'.
- 6160. By Jelmer Vernooij on 2011-09-22
-
Add some tests for 'bzr push --overwrite-tags'.

I'm not sure we're closing all holes here but until we have proper versioning for tags this seems like a valuable step.
Aren't we breaking plugins that redefine push/pull here ? (from irc discussion, yes :-/)
I think we need to think a bit more about it and re-targeting bzr.dev sounds more appropriate ?