~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

First orphaning implementation (some tests lacking).

* bzrlib/transform.py:
(TreeTransformBase.new_orphan, DiskTreeTransform.new_orphan)
(TransformPreview.new_orphan): Transforming a tree can create
orphans, which may or not be supported. Orphaning an item moves it
into a orphan dir with a regular backup name.
(conflict_pass): Resolve a 'missing parent' conflict by orphaning
all the unversioned files in the said parent directory. If the
directory ends up not being empty the orphaning is cancelled and
the conflict turned into a 'deleting parent' one instead (which is
the "normal" case).

* bzrlib/tests/test_transform.py:
(TestSerializeTransform.test_get_parents_texts): Start adding
specific tests for orphaning.

* bzrlib/tests/test_bzrdir.py:
(ChrootedTests.test_sprout_recursive_treeless): This test now
fails, revealing a latent bug (to be filed).

* bzrlib/osutils.py:
(generate_backup_name): Start abstracting backup names generation.

* bzrlib/bzrdir.py:
(BzrDirMeta1.destroy_workingtree): Remark that we ignore the
conflicts here which mask a latent bug in subtree treeless
support (how's that for a confusing term ?).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1309
1309
        wt = self.open_workingtree(recommend_upgrade=False)
1310
1310
        repository = wt.branch.repository
1311
1311
        empty = repository.revision_tree(_mod_revision.NULL_REVISION)
1312
 
        wt.revert(old_tree=empty)
 
1312
        # We ignore the conflicts returned by wt.revert since we're about to
 
1313
        # delete the wt metadata anyway, all that should be left here are
 
1314
        # detritus.
 
1315
        conflicts = wt.revert(old_tree=empty)
1313
1316
        self.destroy_workingtree_metadata()
1314
1317
 
1315
1318
    def destroy_workingtree_metadata(self):