~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_mv.py

  • Committer: Jelmer Vernooij
  • Date: 2012-02-20 12:19:29 UTC
  • mfrom: (6437.23.11 2.5)
  • mto: (6581.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 6582.
  • Revision ID: jelmer@samba.org-20120220121929-7ni2psvjoatm1yp4
Merge bzr/2.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2006-2012 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
120
120
        tree = self.make_branch_and_tree('.')
121
121
        tree.add(['sub1', 'sub1/sub2', 'sub1/hello.txt'])
122
122
 
123
 
        os.chdir('sub1/sub2')
124
 
        self.run_bzr('mv ../hello.txt .')
125
 
        self.assertPathExists('./hello.txt')
 
123
        self.run_bzr('mv ../hello.txt .', working_dir='sub1/sub2')
 
124
        self.assertPathExists('sub1/sub2/hello.txt')
126
125
 
127
 
        os.chdir('..')
128
 
        self.run_bzr('mv sub2/hello.txt .')
129
 
        os.chdir('..')
 
126
        self.run_bzr('mv sub2/hello.txt .', working_dir='sub1')
130
127
        self.assertMoved('sub1/sub2/hello.txt','sub1/hello.txt')
131
128
 
132
129
    def test_mv_change_case_file(self):
187
184
        self.run_bzr('move a b')
188
185
        self.run_bzr('rename b a')
189
186
 
 
187
    def test_mv_no_root(self):
 
188
        tree = self.make_branch_and_tree('.')
 
189
        self.run_bzr_error(
 
190
            ["bzr: ERROR: can not move root of branch"],
 
191
            'mv . a')
 
192
 
190
193
    def test_mv_through_symlinks(self):
191
194
        self.requireFeature(SymlinkFeature)
192
195
        tree = self.make_branch_and_tree('.')
515
518
        self.build_tree([u"\xA7"])
516
519
        out, err = self.run_bzr_error(["Could not rename", "not versioned"],
517
520
            ["mv", u"\xA7", "b"])
 
521
 
 
522
    def test_mv_removed_non_ascii(self):
 
523
        """Clear error on mv of a removed non-ascii file, see lp:898541"""
 
524
        self.requireFeature(UnicodeFilenameFeature)
 
525
        tree = self.make_branch_and_tree(".")
 
526
        self.build_tree([u"\xA7"])
 
527
        tree.add([u"\xA7"])
 
528
        tree.commit(u"Adding \xA7")
 
529
        os.remove(u"\xA7")
 
530
        out, err = self.run_bzr_error(["Could not rename", "not exist"],
 
531
            ["mv", u"\xA7", "b"])