/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: Martin Pool
  • Date: 2009-12-14 06:06:59 UTC
  • mfrom: (4889 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4891.
  • Revision ID: mbp@sourcefrog.net-20091214060659-1ucv8hpnky0cbnaj
merge trunk

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 for interface conformance of 'WorkingTree.move'"""
18
18
 
23
23
    osutils,
24
24
    )
25
25
 
26
 
from bzrlib.workingtree_4 import WorkingTreeFormat4
27
 
from bzrlib.tests.workingtree_implementations import TestCaseWithWorkingTree
 
26
from bzrlib.workingtree_4 import DirStateWorkingTreeFormat
 
27
from bzrlib.tests.per_workingtree import TestCaseWithWorkingTree
28
28
 
29
29
 
30
30
class TestMove(TestCaseWithWorkingTree):
43
43
        actual = self.get_tree_layout(tree)
44
44
        self.assertEqual(expected, actual)
45
45
 
 
46
    def test_move_via_rm_and_add(self):
 
47
        """Move by remove and add-with-id"""
 
48
        self.build_tree(['a1', 'b1'])
 
49
        tree = self.make_branch_and_tree('.')
 
50
        tree.add(['a1'], ids=['a1-id'])
 
51
        tree.commit('initial commit')
 
52
        tree.remove('a1', force=True, keep_files=False)
 
53
        tree.add(['b1'], ids=['a1-id'])
 
54
        tree._validate()
 
55
 
46
56
    def test_move_correct_call_named(self):
47
57
        """tree.move has the deprecated parameter 'to_name'.
48
58
        It has been replaced by 'to_dir' for consistency.
99
109
                                tree.move, ['a1'], to_name='sub1',
100
110
                                after=False)
101
111
        except TypeError:
102
 
            # WorkingTreeFormat4 doesn't have to maintain api compatibility
103
 
            # since it was deprecated before the class was introduced.
104
 
            if not isinstance(self.workingtree_format, WorkingTreeFormat4):
 
112
            # WorkingTreeFormat4 and later don't have to maintain api
 
113
            # compatibility since it was deprecated before they were introduced.
 
114
            if not isinstance(self.workingtree_format,
 
115
                DirStateWorkingTreeFormat):
105
116
                raise
106
117
        tree._validate()
107
118