bzrdir.destroy_workingtree ignores conflicts (which means that subtree support is broken for treeless branches)

Bug #634470 reported by Vincent Ladeuil
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned

Bug Description

The implementation of bzrdir.BzrDirMeta1.destroy_workingtree is:

        wt = self.open_workingtree(recommend_upgrade=False)
        repository = wt.branch.repository
        empty = repository.revision_tree(_mod_revision.NULL_REVISION)
        wt.revert(old_tree=empty)
        self.destroy_workingtree_metadata()

That is, it calls wt.revert() and happily ignores any resulting
conflicts (returned by revert). This is not totally wrong since
we're about to delete the wt metadata anyway and all that should
be left here are detritus.

I encounter this while working on bug #323111 where
bzrlib.tests.test_bzrdir.ChrootedTests.test_sprout_recursive_treeless
started to fail.

Specifically, the ignored conflict is:
   [DeletingParent('Not deleting', u'subtree', None)]
subtree being a tree reference.

So indeed in this case, we leave some detritus: 'subtree' and 'subtree/.bzr'.
Orphaning 'subtree' in this case means really get rid of the 'subtree/.bzr' dir.

The test now fails when it tries to sprout() because 'subtree/.bzr' is not there anymore.
Which means that is was passing before because detritus where lying around.

I will turn it into an expected failure into my merge proposal and refer to this bug.

Vincent Ladeuil (vila)
summary: - bzrdir.destroy_workingtree ignores conflicts
+ bzrdir.destroy_workingtree ignores conflicts (which means that subtree
+ support is broken for treeless branches)
Changed in bzr:
status: New → Confirmed
importance: Undecided → Medium
Jelmer Vernooij (jelmer)
tags: added: workingtree
Jelmer Vernooij (jelmer)
tags: added: subtrees
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.