~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_workingtree/test_unversion.py

  • Committer: Andrew Bennetts
  • Date: 2009-07-27 05:35:00 UTC
  • mfrom: (4570 +trunk)
  • mto: (4634.6.29 2.0)
  • mto: This revision was merged to the branch mainline in revision 4680.
  • Revision ID: andrew.bennetts@canonical.com-20090727053500-q76zsn2dx33jhmj5
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
"""Tests of the WorkingTree.unversion API."""
18
18
 
20
20
    errors,
21
21
    osutils,
22
22
    )
23
 
from bzrlib.tests.workingtree_implementations import TestCaseWithWorkingTree
 
23
from bzrlib.tests.per_workingtree import TestCaseWithWorkingTree
24
24
 
25
25
 
26
26
class TestUnversion(TestCaseWithWorkingTree):
37
37
        tree = self.make_branch_and_tree('.')
38
38
        self.assertRaises(errors.NoSuchId, tree.unversion, ['missing-id'])
39
39
 
 
40
    def test_unversion_parent_and_child_renamed_bug_187207(self):
 
41
        # When unversioning dirstate trees show a bug in dealing with
 
42
        # unversioning children of reparented children of unversioned
 
43
        # paths when relocation entries are present and the relocation
 
44
        # points later into the dirstate.
 
45
        tree = self.make_branch_and_tree(['.'])
 
46
        self.build_tree(['del/', 'del/sub/', 'del/sub/b'])
 
47
        tree.add(['del', 'del/sub', 'del/sub/b'], ['del', 'sub', 'b'])
 
48
        tree.commit('setup')
 
49
        tree.rename_one('del/sub', 'sub')
 
50
        self.assertEqual('sub/b', tree.id2path('b'))
 
51
        tree.unversion(['del', 'b'])
 
52
        self.assertRaises(errors.NoSuchId, tree.id2path, 'b')
 
53
 
40
54
    def test_unversion_several_files(self):
41
55
        """After unversioning several files, they should not be versioned."""
42
56
        tree = self.make_branch_and_tree('.')