~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_branch.py

  • Committer: Robert Collins
  • Date: 2005-11-28 05:13:41 UTC
  • mfrom: (1185.33.54 merge-recovered)
  • Revision ID: robertc@robertcollins.net-20051128051341-059936f2f29a12c8
Merge from Martin. Adjust check to work with HTTP again.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
import bzrlib.errors as errors
23
23
from bzrlib.errors import NoSuchRevision, UnlistableBranch, NotBranchError
24
24
import bzrlib.gpg
25
 
from bzrlib.selftest import TestCase, TestCaseInTempDir
26
 
from bzrlib.selftest.HTTPTestUtil import TestCaseWithWebserver
 
25
from bzrlib.tests import TestCase, TestCaseInTempDir
 
26
from bzrlib.tests.HTTPTestUtil import TestCaseWithWebserver
27
27
from bzrlib.trace import mutter
28
28
import bzrlib.transactions as transactions
29
29
from bzrlib.revision import NULL_REVISION
50
50
        b1 = Branch.initialize('b1')
51
51
        b2 = Branch.initialize('b2')
52
52
        file(os.sep.join(['b1', 'foo']), 'w').write('hello')
53
 
        b1.add(['foo'], ['foo-id'])
 
53
        b1.working_tree().add(['foo'], ['foo-id'])
54
54
        b1.working_tree().commit('lala!', rev_id='revision-1', allow_pointless=False)
55
55
 
56
56
        mutter('start fetch')
77
77
        os.mkdir('a')
78
78
        br_a = Branch.initialize("a")
79
79
        file('a/b', 'wb').write('b')
80
 
        br_a.add('b')
 
80
        br_a.working_tree().add('b')
81
81
        commit(br_a, "silly commit", rev_id='A')
82
82
        os.mkdir('b')
83
83
        br_b = Branch.initialize("b")
116
116
        """Copy only part of the history of a branch."""
117
117
        self.build_tree(['a/', 'a/one'])
118
118
        br_a = Branch.initialize('a')
119
 
        br_a.add(['one'])
 
119
        br_a.working_tree().add(['one'])
120
120
        br_a.working_tree().commit('commit one', rev_id='u@d-1')
121
121
        self.build_tree(['a/two'])
122
 
        br_a.add(['two'])
 
122
        br_a.working_tree().add(['two'])
123
123
        br_a.working_tree().commit('commit two', rev_id='u@d-2')
124
124
        br_b = copy_branch(br_a, 'b', revision='u@d-1')
125
125
        self.assertEqual(br_b.last_revision(), 'u@d-1')
237
237
#         >>> from bzrlib.commit import commit
238
238
#         >>> bzrlib.trace.silent = True
239
239
#         >>> br1 = ScratchBranch(files=['foo', 'bar'])
240
 
#         >>> br1.add('foo')
241
 
#         >>> br1.add('bar')
 
240
#         >>> br1.working_tree().add('foo')
 
241
#         >>> br1.working_tree().add('bar')
242
242
#         >>> commit(br1, "lala!", rev_id="REVISION-ID-1", verbose=False)
243
243
#         >>> br2 = ScratchBranch()
244
244
#         >>> br2.update_revisions(br1)