/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_commit.py

  • Committer: Robert Collins
  • Date: 2007-09-27 21:11:38 UTC
  • mfrom: (2871 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2879.
  • Revision ID: robertc@robertcollins.net-20070927211138-ebsu1bo1qz9f1w8n
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import os
21
21
 
22
22
from bzrlib import (
 
23
    osutils,
23
24
    ignores,
24
25
    )
25
26
from bzrlib.bzrdir import BzrDir
154
155
        a_tree.commit(message='Initial message')
155
156
 
156
157
        b_tree = a_tree.branch.create_checkout('b')
157
 
        expected = "%s/" % (os.path.abspath('a'), )
 
158
        expected = "%s/" % (osutils.abspath('a'), )
158
159
        out, err = self.run_bzr('commit -m blah --unchanged', working_dir='b')
159
160
        self.assertEqual(err, 'Committing revision 2 to "%s".\n'
160
161
                         'Committed revision 2.\n' % expected)
212
213
        os.chdir('this')
213
214
        out,err = self.run_bzr('commit -m added')
214
215
        self.assertEqual('', out)
215
 
        expected = '%s/' % (os.getcwd(), )
 
216
        expected = '%s/' % (osutils.getcwd(), )
216
217
        self.assertEqualDiff(
217
218
            'Committing revision 2 to "%s".\n'
218
219
            'modified filetomodify\n'
520
521
        last_rev = tree.branch.repository.get_revision(tree.last_revision())
521
522
        properties = last_rev.properties
522
523
        self.assertEqual('John Doe', properties['author'])
 
524
 
 
525
    def test_partial_commit_with_renames_in_tree(self):
 
526
        # this test illustrates bug #140419
 
527
        t = self.make_branch_and_tree('.')
 
528
        self.build_tree(['dir/', 'dir/a', 'test'])
 
529
        t.add(['dir/', 'dir/a', 'test'])
 
530
        t.commit('initial commit')
 
531
        # important part: file dir/a should change parent
 
532
        # and should appear before old parent
 
533
        # then during partial commit we have error
 
534
        # parent_id {dir-XXX} not in inventory
 
535
        t.rename_one('dir/a', 'a')
 
536
        self.build_tree_contents([('test', 'changes in test')])
 
537
        # partial commit
 
538
        out, err = self.run_bzr('commit test -m "partial commit"')
 
539
        self.assertEquals('', out)
 
540
        self.assertContainsRe(err, r'modified test\nCommitted revision 2.')