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

  • Committer: Martin Pool
  • Date: 2007-08-20 05:53:39 UTC
  • mfrom: (2727 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2730.
  • Revision ID: mbp@sourcefrog.net-20070820055339-uzei7f7i7jo6tugg
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
226
226
        wt.lock_read()
227
227
        try:
228
228
            self.check_inventory_shape(wt.read_working_inventory(),
229
 
                                       ['a', 'a/hello', 'b'])
 
229
                                       ['a/', 'a/hello', 'b/'])
230
230
        finally:
231
231
            wt.unlock()
232
232
 
236
236
        wt.lock_read()
237
237
        try:
238
238
            self.check_inventory_shape(wt.read_working_inventory(),
239
 
                                       ['a', 'a/hello', 'a/b'])
 
239
                                       ['a/', 'a/hello', 'a/b/'])
240
240
            self.check_inventory_shape(b.repository.get_revision_inventory(r3),
241
 
                                       ['a', 'a/hello', 'a/b'])
 
241
                                       ['a/', 'a/hello', 'a/b/'])
242
242
        finally:
243
243
            wt.unlock()
244
244
 
248
248
        wt.lock_read()
249
249
        try:
250
250
            self.check_inventory_shape(wt.read_working_inventory(),
251
 
                                       ['a', 'a/b/hello', 'a/b'])
 
251
                                       ['a/', 'a/b/hello', 'a/b/'])
252
252
        finally:
253
253
            wt.unlock()
254
254
 
695
695
        self.assertEqual(['bar', 'baz'], err.files)
696
696
        self.assertEqual('Selected-file commit of merges is not supported'
697
697
                         ' yet: files bar, baz', str(err))
 
698
 
 
699
    def test_commit_no_author(self):
 
700
        """The default kwarg author in MutableTree.commit should not add
 
701
        the 'author' revision property.
 
702
        """
 
703
        tree = self.make_branch_and_tree('foo')
 
704
        rev_id = tree.commit('commit 1')
 
705
        rev = tree.branch.repository.get_revision(rev_id)
 
706
        self.assertFalse('author' in rev.properties)
 
707
 
 
708
    def test_commit_author(self):
 
709
        """Passing a non-empty author kwarg to MutableTree.commit should add
 
710
        the 'author' revision property.
 
711
        """
 
712
        tree = self.make_branch_and_tree('foo')
 
713
        rev_id = tree.commit('commit 1', author='John Doe <jdoe@example.com>')
 
714
        rev = tree.branch.repository.get_revision(rev_id)
 
715
        self.assertEqual('John Doe <jdoe@example.com>',
 
716
                         rev.properties['author'])