Index: subversion/tests/libsvn_fs/fs-test.c =================================================================== --- subversion/tests/libsvn_fs/fs-test.c (revision 1710620) +++ subversion/tests/libsvn_fs/fs-test.c (working copy) @@ -6971,6 +6971,47 @@ freeze_and_commit(const svn_test_opts_t *opts, return SVN_NO_ERROR; } +static svn_error_t * +history_with_empty_delta(const svn_test_opts_t *opts, + apr_pool_t *pool) +{ + svn_fs_t *fs; + svn_revnum_t head_rev = 0; + svn_fs_root_t *root; + svn_fs_txn_t *txn; + svn_fs_history_t *history; + const char *path; + svn_revnum_t revision; + + SVN_ERR(svn_test__create_fs(&fs, "test-history-with-empty-delta", + opts, pool)); + + /* r1: Create the greek tree. */ + SVN_ERR(svn_fs_begin_txn(&txn, fs, head_rev, pool)); + SVN_ERR(svn_fs_txn_root(&root, txn, pool)); + SVN_ERR(svn_test__create_greek_tree(root, pool)); + SVN_ERR(test_commit_txn(&head_rev, txn, NULL, pool)); + + /* r2: Commit an empty delta for /iota. */ + SVN_ERR(svn_fs_begin_txn(&txn, fs, head_rev, pool)); + SVN_ERR(svn_fs_txn_root(&root, txn, pool)); + SVN_ERR(svn_test__set_file_contents(root, "/iota", + "This is the file 'iota'.\n", pool)); + SVN_ERR(test_commit_txn(&head_rev, txn, NULL, pool)); + + /* Get the first real point of interesting history. */ + SVN_ERR(svn_fs_revision_root(&root, fs, head_rev, pool)); + SVN_ERR(svn_fs_node_history2(&history, root, "/iota", pool, pool)); + SVN_ERR(svn_fs_history_prev2(&history, history, FALSE, pool, pool)); + + /* The revision with empty delta is reported as "interesting". */ + SVN_ERR(svn_fs_history_location(&path, &revision, history, pool)); + SVN_TEST_STRING_ASSERT(path, "/iota"); + SVN_TEST_ASSERT(revision == 2); + + return SVN_NO_ERROR; +} + /* ------------------------------------------------------------------------ */ /* The test table. */ @@ -7105,6 +7146,8 @@ static struct svn_test_descriptor_t test_funcs[] = "test svn_fs_check_related for transactions"), SVN_TEST_OPTS_PASS(freeze_and_commit, "freeze and commit"), + SVN_TEST_OPTS_PASS(history_with_empty_delta, + "test node history with empty delta"), SVN_TEST_NULL };