def test_get_real_branch_path(self):
     """Correctly calculates the on-disk location of a branch."""
     path = get_real_branch_path(0x00abcdef)
     self.assertTrue(
         path.startswith(config.codehosting.mirrored_branches_root))
     tail = path[len(config.codehosting.mirrored_branches_root):]
     self.assertEqual('/00/ab/cd/ef', tail)
 def test_get_real_branch_path(self):
     """Correctly calculates the on-disk location of a branch."""
     path = get_real_branch_path(0x00abcdef)
     self.assertTrue(path.startswith(
         config.codehosting.mirrored_branches_root))
     tail = path[len(config.codehosting.mirrored_branches_root):]
     self.assertEqual('/00/ab/cd/ef', tail)
 def run(self):
     branch_path = get_real_branch_path(self.branch_id)
     if os.path.exists(branch_path):
         shutil.rmtree(branch_path)
Beispiel #4
0
 def run(self):
     branch_path = get_real_branch_path(self.branch_id)
     if os.path.exists(branch_path):
         shutil.rmtree(branch_path)
Beispiel #5
0
 def swap_in(self):
     """Swap the upgraded branch into place."""
     real_location = get_real_branch_path(self.branch.id)
     backup_dir = os.path.join(self.target_subdir, 'backup.bzr')
     os.rename(real_location, backup_dir)
     os.rename(self.target_subdir, real_location)
Beispiel #6
0
 def swap_in(self):
     """Swap the upgraded branch into place."""
     real_location = get_real_branch_path(self.branch.id)
     backup_dir = os.path.join(self.target_subdir, 'backup.bzr')
     os.rename(real_location, backup_dir)
     os.rename(self.target_subdir, real_location)