Merge lp://staging/~vila/bzr/646961-attr-error into lp://staging/bzr/2.2
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Vincent Ladeuil | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 5108 | ||||
Proposed branch: | lp://staging/~vila/bzr/646961-attr-error | ||||
Merge into: | lp://staging/bzr/2.2 | ||||
Diff against target: |
171 lines (+67/-14) 5 files modified
NEWS (+4/-0) bzrlib/conflicts.py (+3/-4) bzrlib/tests/blackbox/test_conflicts.py (+45/-0) bzrlib/tests/test_workingtree.py (+7/-7) bzrlib/transform.py (+8/-3) |
||||
To merge this branch: | bzr merge lp://staging/~vila/bzr/646961-attr-error | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Andrew Bennetts | Needs Fixing | ||
Review via email: mp+39852@code.staging.launchpad.net |
Commit message
Properly refuse to obey --take-this and --take-other for text conflicts.
Description of the change
The root cause of bug #646961 is that --take-this and
--take-other are not implemented for text conflicts (and the
reason for this is that users may be misunderstanding the
feature, see
http://
for details).
This patch fixes the most urgent issue targeted to 2.2 without
adding a new feature (since 2.2 is stable) by fixing several
issues (whack-a-mole entertainment ahead):
- the TextConflict class was inheriting from PathConflict instead
of Conflict. There was a FIXME about that but I didn't realize
at the time that this was inheriting action_take_this and
action_take_other and doing so, pretending to implement
--take-this and --take-other leading to the bug,
- the _duplicate_entries conflict detection was trying to take
deleted files into account which makes no sense since they
don't have a name anymore (while the code path shouldn't have
been triggered, this is worth fixing anyway).
The TextConflict doesn't inherit from PathConflict anymore which
makes the test complete without resolving the conflict at
all. It's unfortunate that we succeed silently here but fixing
that is out of scope as it's related to several other bugs.
The added test will fail when --take-other is implemented.
I have some tweak requests, so:
review needs-fixing
But basically this looks like a good incremental improvement, thanks!
Details follow.
Vincent Ladeuil wrote:
[...]
> The TextConflict doesn't inherit from PathConflict anymore which
> makes the test complete without resolving the conflict at
> all. It's unfortunate that we succeed silently here but fixing
> that is out of scope as it's related to several other bugs.
> The added test will fail when --take-other is implemented.
That's a shame, but at least it's an improvement over crashing.
How hard is it to emit a warning that not all conflicts were resolved?
> -- /code.launchpad .net/~vila/ bzr/646961- attr-error/ +merge/ 39852
> https:/
> Your team bzr-core is requested to review the proposed merge of lp:~vila/bzr/646961-attr-error into lp:bzr/2.2.
> === modified file 'NEWS'
> --- NEWS 2010-10-30 06:59:55 +0000
> +++ NEWS 2010-11-02 14:35:59 +0000
> @@ -19,6 +19,9 @@
> Bug Fixes
> *********
>
> +* ``bzr resolve --take--other <file>`` will not crash anymore if ``<file>`` is
> + involved in a text conflict. (Vincent Ladeuil, #646961)
Typo: should be “--take-other” (three hyphens, not four).
If I understand the cover letter correctly, in this scenario
--take-other still won't resolve the conflict. It might be worth saying
so in the NEWS entry.
[...] with_cleanups( tree, 'THIS') PathConflict) : Conflict) :
> +++ bzrlib/conflicts.py 2010-11-02 14:35:59 +0000
> @@ -600,12 +600,9 @@
> self._resolve_
>
>
> -# FIXME: TextConflict is about a single file-id, there never is a conflict_path
> -# attribute so we shouldn't inherit from PathConflict but simply from Conflict
> -
> # TODO: There should be a base revid attribute to better inform the user about
> # how the conflicts were generated.
> -class TextConflict(
> +class TextConflict(
Sounds good. Does this mean that PathConflict. as_stanza no longer needs this
logic:
if self.conflict_path is not None:
s. add('conflict_ path', self.conflict_path)
?
> === modified file 'bzrlib/ tests/blackbox/ test_conflicts. py' ntlyIgnore( script. TestCaseWithTra nsportAndScript ): 646961( self):
[...]
> +class TestResolveSile
> +
> + def test_bug_
[...]
> + # The following wil fail when --take-other is implemented
> + # for text conflicts
Shouldn't this test be a KnownFailure, then?
-Andrew.