def replicatehgrc(ui, repo): """Replicate the hgrc for this repository. When called, the content of the hgrc file for this repository will be sent to the replication service. Downstream mirrors will apply that hgrc. This command should be called when the hgrc of the repository changes. """ if repo.vfs.exists('hgrc'): content = repo.vfs.read('hgrc') else: content = None producer = ui.replicationproducer vcsrproducer.record_hgrc_update(producer, repo.replicationwireprotopath, content, partition=repo.replicationpartition) ui.status(_('recorded hgrc in replication log\n'))
def replicatehgrc(ui, repo): """Replicate the hgrc for this repository. When called, the content of the hgrc file for this repository will be sent to the replication service. Downstream mirrors will apply that hgrc. This command should be called when the hgrc of the repository changes. """ if repo.vfs.exists('hgrc'): content = repo.vfs.read('hgrc') else: content = None with ui.kafkainteraction(): producer = ui.replicationproducer repo.producerlog('HGRC_SENDING') vcsrproducer.record_hgrc_update(producer, repo.replicationwireprotopath, content, partition=repo.replicationpartition) repo.producerlog('HGRC_SENT') ui.status(_('recorded hgrc in replication log\n'))
def replicatehgrc(ui, repo): """Replicate the hgrc for this repository. When called, the content of the hgrc file for this repository will be sent to the replication service. Downstream mirrors will apply that hgrc. This command should be called when the hgrc of the repository changes. """ if repo.vfs.exists("hgrc"): content = repo.vfs.read("hgrc") else: content = None with ui.kafkainteraction(): producer = ui.replicationproducer repo.producerlog("HGRC_SENDING") vcsrproducer.record_hgrc_update( producer, repo.replicationwireprotopath, content, partition=repo.replicationpartition ) repo.producerlog("HGRC_SENT") ui.status(_("recorded hgrc in replication log\n"))