예제 #1
0
 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
예제 #2
0
 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
예제 #3
0
 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
예제 #4
0
 def checkID(ignored):
     self.assertEqual(
         puller_master.lock_ids,
         [get_lock_id_for_branch_id(puller_master.branch_id)])
예제 #5
0
 def checkID(ignored):
     self.assertEqual(
         puller_master.lock_ids,
         [get_lock_id_for_branch_id(puller_master.branch_id)])