def confirm_action(self, prompt, confirmation_id, args): """If we're asked to break a lock like a stale lock of ours, say yes. """ assert confirmation_id == 'bzrlib.lockdir.break', \ "Didn't expect confirmation id %r" % (confirmation_id,) branch_id = self.puller_worker_protocol.branch_id prompt = prompt % args if get_lock_id_for_branch_id(branch_id) in prompt: return True else: return False
def mirror(self): """Spawn a worker process to mirror a branch.""" deferred = defer.Deferred() protocol = self.protocol_class(deferred, self) interpreter = '%s/bin/py' % config.root command = [ interpreter, self.path_to_script, self.source_url, self.destination_url, str(self.branch_id), str(self.unique_name), self.branch_type_name, self.default_stacked_on_url] self.logger.debug("executing %s", command) env = os.environ.copy() env['BZR_EMAIL'] = get_lock_id_for_branch_id(self.branch_id) reactor.spawnProcess(protocol, interpreter, command, env=env) return deferred
def mirror(self): """Spawn a worker process to mirror a branch.""" deferred = defer.Deferred() protocol = self.protocol_class(deferred, self) interpreter = '%s/bin/py' % config.root command = [ interpreter, self.path_to_script, self.source_url, self.destination_url, str(self.branch_id), str(self.unique_name), self.branch_type_name, self.default_stacked_on_url ] self.logger.debug("executing %s", command) env = os.environ.copy() env['BZR_EMAIL'] = get_lock_id_for_branch_id(self.branch_id) reactor.spawnProcess(protocol, interpreter, command, env=env) return deferred
def checkID(ignored): self.assertEqual( puller_master.lock_ids, [get_lock_id_for_branch_id(puller_master.branch_id)])