/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 breezy/git/tests/test_remote.py

  • Committer: Jelmer Vernooij
  • Date: 2018-11-16 10:50:21 UTC
  • mfrom: (7164 work)
  • mto: This revision was merged to the branch mainline in revision 7165.
  • Revision ID: jelmer@jelmer.uk-20181116105021-xl419v2rh4aus1au
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
140
140
        self.assertTrue(self.format.supports_tags())
141
141
 
142
142
 
 
143
class TestRemoteGitBranch(TestCaseWithTransport):
 
144
 
 
145
    def setUp(self):
 
146
        TestCaseWithTransport.setUp(self)
 
147
        self.remote_real = GitRepo.init('remote', mkdir=True)
 
148
        self.remote_url = 'git://%s/' % os.path.abspath(self.remote_real.path)
 
149
        self.permit_url(self.remote_url)
 
150
 
 
151
    def test_set_last_revision_info(self):
 
152
        c1 = self.remote_real.do_commit(
 
153
                message=b'message 1',
 
154
                committer=b'committer <committer@example.com>',
 
155
                author=b'author <author@example.com>',
 
156
                ref=b'refs/heads/newbranch')
 
157
        c2 = self.remote_real.do_commit(
 
158
                message=b'message 2',
 
159
                committer=b'committer <committer@example.com>',
 
160
                author=b'author <author@example.com>',
 
161
                ref=b'refs/heads/newbranch')
 
162
 
 
163
        remote = ControlDir.open(self.remote_url)
 
164
        newbranch = remote.open_branch('newbranch')
 
165
        self.assertEqual(newbranch.lookup_foreign_revision_id(c2),
 
166
                         newbranch.last_revision())
 
167
        newbranch.set_last_revision_info(
 
168
            1, newbranch.lookup_foreign_revision_id(c1))
 
169
        self.assertEqual(c1, self.remote_real.refs[b'refs/heads/newbranch'])
 
170
        self.assertEqual(newbranch.last_revision(),
 
171
                         newbranch.lookup_foreign_revision_id(c1))
 
172
 
 
173
 
143
174
class FetchFromRemoteTestBase(object):
144
175
 
145
176
    _test_needs_features = [ExecutableFeature('git')]