~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/blackbox.py

  • Committer: Robert Collins
  • Date: 2005-11-07 20:29:51 UTC
  • mfrom: (1457.1.17)
  • Revision ID: robertc@robertcollins.net-20051107202951-6ae936c7a3e57f6f
Branch.commit() has moved to WorkingTree.commit(). (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
311
311
        self.build_tree(['branch1/', 'branch1/file', 'branch2/'])
312
312
        branch = Branch.initialize('branch1')
313
313
        branch.add(['file'])
314
 
        branch.commit('add file')
 
314
        branch.working_tree().commit('add file')
315
315
        copy_branch(branch, 'branch2')
316
316
        print >> open('branch2/file', 'w'), 'new content'
317
317
        branch2 = Branch.open('branch2')
318
 
        branch2.commit('update file')
 
318
        branch2.working_tree().commit('update file')
319
319
        # should open branch1 and diff against branch2, 
320
320
        output = self.run_bzr_captured(['diff', '-r', 'branch:branch2', 
321
321
                                        'branch1'],
684
684
        import bzrlib.gpg
685
685
        oldstrategy = bzrlib.gpg.GPGStrategy
686
686
        branch = Branch.initialize('.')
687
 
        branch.commit("base", allow_pointless=True, rev_id='A')
 
687
        branch.working_tree().commit("base", allow_pointless=True, rev_id='A')
688
688
        try:
689
689
            # monkey patch gpg signing mechanism
690
690
            from bzrlib.testament import Testament
699
699
        import bzrlib.gpg
700
700
        oldstrategy = bzrlib.gpg.GPGStrategy
701
701
        branch = Branch.initialize('.')
702
 
        branch.commit("base", allow_pointless=True, rev_id='A')
703
 
        branch.commit("base", allow_pointless=True, rev_id='B')
704
 
        branch.commit("base", allow_pointless=True, rev_id='C')
 
702
        branch.working_tree().commit("base", allow_pointless=True, rev_id='A')
 
703
        branch.working_tree().commit("base", allow_pointless=True, rev_id='B')
 
704
        branch.working_tree().commit("base", allow_pointless=True, rev_id='C')
705
705
        try:
706
706
            # monkey patch gpg signing mechanism
707
707
            from bzrlib.testament import Testament
1044
1044
    def test_branch(self):
1045
1045
        os.mkdir('from')
1046
1046
        branch = Branch.initialize('from')
1047
 
        branch.commit('empty commit for nonsense', allow_pointless=True)
 
1047
        branch.working_tree().commit('empty commit for nonsense', allow_pointless=True)
1048
1048
        url = self.get_remote_url('from')
1049
1049
        self.run_bzr('branch', url, 'to')
1050
1050
        branch = Branch.open('to')
1054
1054
        self.build_tree(['branch/', 'branch/file'])
1055
1055
        branch = Branch.initialize('branch')
1056
1056
        branch.add(['file'])
1057
 
        branch.commit('add file', rev_id='A')
 
1057
        branch.working_tree().commit('add file', rev_id='A')
1058
1058
        url = self.get_remote_url('branch/file')
1059
1059
        output = self.capture('log %s' % url)
1060
1060
        self.assertEqual(7, len(output.split('\n')))