@SkipUnless(svntest.main.is_fs_type_fsfs)
@SkipUnless(svntest.main.fs_has_pack)
def hotcopy_incremental_packed(sbox):
    "'svnadmin hotcopy --incremental' with packing"
    sbox.build()
    patch_format(sbox.repo_dir, shard_size=2)
    (backup_dir, backup_url) = sbox.add_repo_path('backup')
    os.mkdir(backup_dir)
    cwd = os.getcwd()
    if (not (svntest.main.is_fs_type_fsfs and svntest.main.options.fsfs_packing and (svntest.main.options.fsfs_sharding == 2))):
        svntest.actions.run_and_verify_svnadmin(['Packing revisions in shard 0...done.\n'], [], 'pack', os.path.join(cwd, sbox.repo_dir))
    for i in [1, 2, 3, 4, 5]:
        os.chdir(backup_dir)
        svntest.actions.run_and_verify_svnadmin(None, [], 'hotcopy', '--incremental', os.path.join(cwd, sbox.repo_dir), '.')
        os.chdir(cwd)
        check_hotcopy_fsfs(sbox.repo_dir, backup_dir)
        if (i < 5):
            sbox.simple_mkdir(('newdir-%i' % i))
            sbox.simple_commit()
            if (svntest.main.is_fs_type_fsfs and (not svntest.main.options.fsfs_packing) and (not (i % 2))):
                expected_output = [('Packing revisions in shard %d...done.\n' % (i / 2))]
            else:
                expected_output = []
            svntest.actions.run_and_verify_svnadmin(expected_output, [], 'pack', os.path.join(cwd, sbox.repo_dir))
'svnadmin hotcopy --incremental' with packing
@SkipUnless(svntest.main.is_fs_type_fsfs)
@SkipUnless(svntest.main.fs_has_pack)
def hotcopy_incremental_packed(sbox):
    
    sbox.build()
    patch_format(sbox.repo_dir, shard_size=2)
    (backup_dir, backup_url) = sbox.add_repo_path('backup')
    os.mkdir(backup_dir)
    cwd = os.getcwd()
    if (not (svntest.main.is_fs_type_fsfs and svntest.main.options.fsfs_packing and (svntest.main.options.fsfs_sharding == 2))):
        svntest.actions.run_and_verify_svnadmin(['Packing revisions in shard 0...done.\n'], [], 'pack', os.path.join(cwd, sbox.repo_dir))
    for i in [1, 2, 3, 4, 5]:
        os.chdir(backup_dir)
        svntest.actions.run_and_verify_svnadmin(None, [], 'hotcopy', '--incremental', os.path.join(cwd, sbox.repo_dir), '.')
        os.chdir(cwd)
        check_hotcopy_fsfs(sbox.repo_dir, backup_dir)
        if (i < 5):
            sbox.simple_mkdir(('newdir-%i' % i))
            sbox.simple_commit()
            if (svntest.main.is_fs_type_fsfs and (not svntest.main.options.fsfs_packing) and (not (i % 2))):
                expected_output = [('Packing revisions in shard %d...done.\n' % (i / 2))]
            else:
                expected_output = []
            svntest.actions.run_and_verify_svnadmin(expected_output, [], 'pack', os.path.join(cwd, sbox.repo_dir))