예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
 def run(self):
     branch_path = get_real_branch_path(self.branch_id)
     if os.path.exists(branch_path):
         shutil.rmtree(branch_path)
예제 #4
0
 def run(self):
     branch_path = get_real_branch_path(self.branch_id)
     if os.path.exists(branch_path):
         shutil.rmtree(branch_path)
예제 #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)
예제 #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)