def check_recover_prunes_rep_cache(sbox, enable_rep_sharing):
    "Check 'recover' prunes the rep-cache while enable-rep-sharing is\n     true/false.\n  "
    rep_cache_r1 = read_rep_cache(sbox.repo_dir)
    sbox.simple_append('iota', 'New line.\n')
    sbox.simple_commit()
    rep_cache_r2 = read_rep_cache(sbox.repo_dir)
    if (not (len(rep_cache_r2) == (len(rep_cache_r1) + 1))):
        raise svntest.Failure
    fsfs_conf = svntest.main.get_fsfs_conf_file_path(sbox.repo_dir)
    svntest.main.file_append(fsfs_conf, ('\n[rep-sharing]\nenable-rep-sharing = %s\n' % (('true' if enable_rep_sharing else 'false'),)))
    head_rev_path = fsfs_file(sbox.repo_dir, 'revs', '2')
    os.remove(head_rev_path)
    current_path = os.path.join(sbox.repo_dir, 'db', 'current')
    svntest.main.file_write(current_path, '1\n')
    svntest.actions.run_and_verify_svnadmin(None, [], 'recover', sbox.repo_dir)
    svntest.actions.run_and_verify_svnlook(['1\n'], [], 'youngest', sbox.repo_dir)
    rep_cache_recovered = read_rep_cache(sbox.repo_dir)
    if (not (rep_cache_recovered == rep_cache_r1)):
        raise svntest.Failure
Check 'recover' prunes the rep-cache while enable-rep-sharing is
true/false.
def check_recover_prunes_rep_cache(sbox, enable_rep_sharing):
    "Check 'recover' prunes the rep-cache while enable-rep-sharing is\n     true/false.\n  "
    rep_cache_r1 = read_rep_cache(sbox.repo_dir)
    sbox.simple_append('iota', 'New line.\n')
    sbox.simple_commit()
    rep_cache_r2 = read_rep_cache(sbox.repo_dir)
    if (not (len(rep_cache_r2) == (len(rep_cache_r1) + 1))):
        raise svntest.Failure
    fsfs_conf = svntest.main.get_fsfs_conf_file_path(sbox.repo_dir)
    svntest.main.file_append(fsfs_conf, ('\n[rep-sharing]\nenable-rep-sharing = %s\n' % (('true' if enable_rep_sharing else 'false'),)))
    head_rev_path = fsfs_file(sbox.repo_dir, 'revs', '2')
    os.remove(head_rev_path)
    current_path = os.path.join(sbox.repo_dir, 'db', 'current')
    svntest.main.file_write(current_path, '1\n')
    svntest.actions.run_and_verify_svnadmin(None, [], 'recover', sbox.repo_dir)
    svntest.actions.run_and_verify_svnlook(['1\n'], [], 'youngest', sbox.repo_dir)
    rep_cache_recovered = read_rep_cache(sbox.repo_dir)
    if (not (rep_cache_recovered == rep_cache_r1)):
        raise svntest.Failure