@SkipUnless(svntest.main.is_fs_type_fsfs)
@Issue(2992)
def fsfs_recover_handle_missing_revs_or_revprops_file(sbox):
    'fsfs recovery checks missing revs / revprops files'
    sbox.build()
    svntest.main.file_append(os.path.join(sbox.wc_dir, 'iota'), 'newer line\n')
    sbox.simple_commit(message='log msg')
    svntest.main.file_append(os.path.join(sbox.wc_dir, 'iota'), 'newest line\n')
    sbox.simple_commit(message='log msg')
    rev_3 = fsfs_file(sbox.repo_dir, 'revs', '3')
    rev_was_3 = (rev_3 + '.was')
    os.rename(rev_3, rev_was_3)
    (exit_code, output, errput) = svntest.main.run_svnadmin('recover', sbox.repo_dir)
    if svntest.verify.verify_outputs("Output of 'svnadmin recover' is unexpected.", None, errput, None, ('.*Expected current rev to be <= %s but found 3' % ((rev_3.endswith('pack') and '[012]') or '2'))):
        raise svntest.Failure
    os.rename(rev_was_3, rev_3)
    revprop_3 = fsfs_file(sbox.repo_dir, 'revprops', '3')
    revprop_was_3 = (revprop_3 + '.was')
    os.rename(revprop_3, revprop_was_3)
    (exit_code, output, errput) = svntest.main.run_svnadmin('recover', sbox.repo_dir)
    if svntest.verify.verify_outputs("Output of 'svnadmin recover' is unexpected.", None, errput, None, '.*Revision 3 has a revs file but no revprops file'):
        raise svntest.Failure
    os.rename(revprop_was_3, revprop_3)
    os.rename(revprop_3, revprop_was_3)
    os.mkdir(revprop_3)
    (exit_code, output, errput) = svntest.main.run_svnadmin('recover', sbox.repo_dir)
    if svntest.verify.verify_outputs("Output of 'svnadmin recover' is unexpected.", None, errput, None, '.*Revision 3 has a non-file where its revprops file should be.*'):
        raise svntest.Failure
    os.rmdir(revprop_3)
    os.rename(revprop_was_3, revprop_3)
fsfs recovery checks missing revs / revprops files
@SkipUnless(svntest.main.is_fs_type_fsfs)
@Issue(2992)
def fsfs_recover_handle_missing_revs_or_revprops_file(sbox):
    
    sbox.build()
    svntest.main.file_append(os.path.join(sbox.wc_dir, 'iota'), 'newer line\n')
    sbox.simple_commit(message='log msg')
    svntest.main.file_append(os.path.join(sbox.wc_dir, 'iota'), 'newest line\n')
    sbox.simple_commit(message='log msg')
    rev_3 = fsfs_file(sbox.repo_dir, 'revs', '3')
    rev_was_3 = (rev_3 + '.was')
    os.rename(rev_3, rev_was_3)
    (exit_code, output, errput) = svntest.main.run_svnadmin('recover', sbox.repo_dir)
    if svntest.verify.verify_outputs("Output of 'svnadmin recover' is unexpected.", None, errput, None, ('.*Expected current rev to be <= %s but found 3' % ((rev_3.endswith('pack') and '[012]') or '2'))):
        raise svntest.Failure
    os.rename(rev_was_3, rev_3)
    revprop_3 = fsfs_file(sbox.repo_dir, 'revprops', '3')
    revprop_was_3 = (revprop_3 + '.was')
    os.rename(revprop_3, revprop_was_3)
    (exit_code, output, errput) = svntest.main.run_svnadmin('recover', sbox.repo_dir)
    if svntest.verify.verify_outputs("Output of 'svnadmin recover' is unexpected.", None, errput, None, '.*Revision 3 has a revs file but no revprops file'):
        raise svntest.Failure
    os.rename(revprop_was_3, revprop_3)
    os.rename(revprop_3, revprop_was_3)
    os.mkdir(revprop_3)
    (exit_code, output, errput) = svntest.main.run_svnadmin('recover', sbox.repo_dir)
    if svntest.verify.verify_outputs("Output of 'svnadmin recover' is unexpected.", None, errput, None, '.*Revision 3 has a non-file where its revprops file should be.*'):
        raise svntest.Failure
    os.rmdir(revprop_3)
    os.rename(revprop_was_3, revprop_3)