153
153
def test_set_last_revision_info(self):
154
154
c1 = self.remote_real.do_commit(
155
message=b'message 1',
156
committer=b'committer <committer@example.com>',
157
author=b'author <author@example.com>',
158
ref=b'refs/heads/newbranch')
155
message=b'message 1',
156
committer=b'committer <committer@example.com>',
157
author=b'author <author@example.com>',
158
ref=b'refs/heads/newbranch')
159
159
c2 = self.remote_real.do_commit(
160
message=b'message 2',
161
committer=b'committer <committer@example.com>',
162
author=b'author <author@example.com>',
163
ref=b'refs/heads/newbranch')
160
message=b'message 2',
161
committer=b'committer <committer@example.com>',
162
author=b'author <author@example.com>',
163
ref=b'refs/heads/newbranch')
165
165
remote = ControlDir.open(self.remote_url)
166
166
newbranch = remote.open_branch('newbranch')
252
252
default_mapping.revision_id_foreign_to_bzr(c1),
253
253
local_branch.last_revision())
254
254
self.assertEqual(
255
{'blah': default_mapping.revision_id_foreign_to_bzr(c2)},
256
local_branch.tags.get_tag_dict())
255
{'blah': default_mapping.revision_id_foreign_to_bzr(c2)},
256
local_branch.tags.get_tag_dict())
258
258
def test_sprout_with_annotated_tag_unreferenced(self):
259
259
c1 = self.remote_real.do_commit(
261
committer=b'committer <committer@example.com>',
262
author=b'author <author@example.com>')
261
committer=b'committer <committer@example.com>',
262
author=b'author <author@example.com>')
263
263
c2 = self.remote_real.do_commit(
264
message=b'another commit',
265
committer=b'committer <committer@example.com>',
266
author=b'author <author@example.com>')
264
message=b'another commit',
265
committer=b'committer <committer@example.com>',
266
author=b'author <author@example.com>')
267
267
porcelain.tag_create(
270
author=b'author <author@example.com>',
272
tag_time=int(time.time()),
275
message=b"Annotated tag")
270
author=b'author <author@example.com>',
272
tag_time=int(time.time()),
275
message=b"Annotated tag")
277
277
remote = ControlDir.open(self.remote_url)
278
278
self.make_controldir('local', format=self._to_format)
279
279
local = remote.sprout(
281
revision_id=default_mapping.revision_id_foreign_to_bzr(c1))
281
revision_id=default_mapping.revision_id_foreign_to_bzr(c1))
282
282
local_branch = local.open_branch()
283
283
self.assertEqual(
284
default_mapping.revision_id_foreign_to_bzr(c1),
285
local_branch.last_revision())
284
default_mapping.revision_id_foreign_to_bzr(c1),
285
local_branch.last_revision())
286
286
self.assertEqual(
287
{'blah': default_mapping.revision_id_foreign_to_bzr(c1)},
288
local_branch.tags.get_tag_dict())
291
class FetchFromRemoteToBzrTests(FetchFromRemoteTestBase,TestCaseWithTransport):
287
{'blah': default_mapping.revision_id_foreign_to_bzr(c1)},
288
local_branch.tags.get_tag_dict())
291
class FetchFromRemoteToBzrTests(FetchFromRemoteTestBase, TestCaseWithTransport):
293
293
_to_format = '2a'
558
558
def test_get_branch_nick(self):
559
559
c1 = self.remote_real.do_commit(
561
committer=b'committer <committer@example.com>',
562
author=b'author <author@example.com>')
561
committer=b'committer <committer@example.com>',
562
author=b'author <author@example.com>')
563
563
remote = ControlDir.open(self.remote_url)
564
564
self.assertEqual('master', remote.open_branch().nick)