566
569
if isinstance(source, GitBranch) and lossy:
567
570
raise errors.LossyPushToSameVCS(source.controldir, self)
568
571
source_store = get_object_store(source.repository)
572
fetch_tags = source.get_config_stack().get('branch.fetch_tags')
573
def get_changed_refs(refs):
574
self._refs = remote_refs_dict_to_container(refs)
576
# TODO(jelmer): Unpeel if necessary
577
push_result.new_original_revid = revision_id
579
new_sha = source_store._lookup_revision_sha1(revision_id)
582
new_sha = repo.lookup_bzr_revision_id(revision_id)[0]
583
except errors.NoSuchRevision:
584
raise errors.NoRoundtrippingSupport(
585
source, self.open_branch(name=name, nascent_ok=True))
587
if remote_divergence(ret.get(refname), new_sha,
589
raise DivergedBranches(
590
source, self.open_branch(name, nascent_ok=True))
591
ret[refname] = new_sha
593
for tagname, revid in viewitems(source.tags.get_tag_dict()):
595
new_sha = source_store._lookup_revision_sha1(revid)
598
new_sha = repo.lookup_bzr_revision_id(revid)[0]
599
except errors.NoSuchRevision:
601
ret[tag_name_to_ref(tagname)] = new_sha
569
603
with source_store.lock_read():
570
def get_changed_refs(refs):
571
self._refs = remote_refs_dict_to_container(refs)
573
# TODO(jelmer): Unpeel if necessary
574
push_result.new_original_revid = revision_id
576
new_sha = source_store._lookup_revision_sha1(revision_id)
579
new_sha = repo.lookup_bzr_revision_id(revision_id)[0]
580
except errors.NoSuchRevision:
581
raise errors.NoRoundtrippingSupport(
582
source, self.open_branch(name=name, nascent_ok=True))
584
if remote_divergence(ret.get(refname), new_sha,
586
raise DivergedBranches(
587
source, self.open_branch(name, nascent_ok=True))
588
ret[refname] = new_sha
591
605
generate_pack_data = source_store.generate_lossy_pack_data