/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/blackbox/test_mv.py

[merge] bzr.dev 2240

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006 by Canonical Ltd
 
1
# Copyright (C) 2006 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
18
18
 
19
19
import os
20
20
 
21
 
from bzrlib.tests import TestCaseWithTransport
 
21
from bzrlib import (
 
22
    osutils,
 
23
    workingtree,
 
24
    )
 
25
from bzrlib.tests import (
 
26
    TestCaseWithTransport,
 
27
    TestSkipped,
 
28
    )
22
29
 
23
30
 
24
31
class TestMove(TestCaseWithTransport):
128
135
 
129
136
        self.run_bzr('move', 'a', 'b')
130
137
        self.run_bzr('rename', 'b', 'a')
 
138
 
 
139
    def test_mv_through_symlinks(self):
 
140
        if not osutils.has_symlinks():
 
141
            raise TestSkipped('Symlinks are not supported on this platform')
 
142
        tree = self.make_branch_and_tree('.')
 
143
        self.build_tree(['a/', 'a/b'])
 
144
        os.symlink('a', 'c')
 
145
        os.symlink('.', 'd')
 
146
        tree.add(['a', 'a/b', 'c'], ['a-id', 'b-id', 'c-id'])
 
147
        self.run_bzr('mv', 'c/b', 'b')
 
148
        tree = workingtree.WorkingTree.open('.')
 
149
        self.assertEqual('b-id', tree.path2id('b'))