[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] - Remove 'svn obliterate' related code.

From: Noorul Islam K M <noorul_at_collab.net>
Date: Mon, 11 Apr 2011 13:46:43 +0530

Attached is the patch which removes code related to 'svn obliterate'. I
did not touch notes/obliterate and subversion/po folders. I think that
can be another patch. All tests pass with 'make check'

In the log message I grouped the files for clarity.

Log

[[[

Remove 'svn obliterate' related code.

* subversion/libsvn_ra/ra_loader.h,
  subversion/libsvn_ra/ra_loader.c
  (svn_ra__vtable_t, svn_ra__obliterate_path_rev):
    Remove obliterate related code.

* subversion/libsvn_fs/fs-loader.h,
  subversion/libsvn_fs/fs-loader.c
  (fs_vtable_t, svn_fs__begin_obliteration_txn,
   svn_fs__commit_obliteration_txn): Remove obliterate related code.

* subversion/svn/cl.h,
  subversion/svn/main.c,
  (svn_opt_subcommand_t, svn_cl__cmd_table): Remove obliterate related code.

* subversion/libsvn_ra_local/ra_plugin.c,
  subversion/libsvn_ra_svn/client.c,
  subversion/libsvn_ra_neon/session.c,
  subversion/libsvn_ra_serf/serf.c
  (svn_ra_local__obliterate_path_rev, ra_local_vtable, ra_svn_vtable,
   neon_vtable, serf_vtable): Remove obliterate related code.

* subversion/libsvn_fs_base/tree.h,
  subversion/libsvn_fs_base/tree.c,
  subversion/libsvn_fs_base/reps-strings.h,
  subversion/libsvn_fs_base/reps-strings.c,
  subversion/libsvn_fs_base/dag.h,
  subversion/libsvn_fs_base/dag.c,
  subversion/libsvn_fs_base/revs-txns.c,
  subversion/libsvn_fs_base/revs-txns.h,
  subversion/libsvn_fs_base/fs.c
  (svn_fs_base__commit_obliteration_txn, svn_fs_base__obliterate_rep,
   txn_body_commit_obliteration, txn_body_obliterate_rep,
   svn_fs_base__rep_obliterate, svn_fs_base__dag_commit_obliteration_txn,
   svn_fs_base__dag_obliterate_rep, svn_fs_base__begin_obliteration_txn,
   txn_vtable, txn_body_begin_obliteration_txn, fs_vtable):
    Remove obliterate related code.

* subversion/include/private/svn_client_private.h,
  subversion/include/private/svn_repos_private.h,
  subversion/include/private/svn_ra_private.h,
  subversion/include/private/svn_fs_private.h
  (svn_client__obliterate_path_rev, svn_repos__obliterate_path_rev,
   svn_repos__pre_obliterate_hook, svn_repos__post_obliterate_hook,
   svn_ra__obliterate_path_rev, svn_fs__begin_obliteration_txn,
   svn_fs__commit_obliteration_txn): Remove obliterate related code.

* subversion/libsvn_repos/repos.h,
  subversion/libsvn_repos/repos.c,
  subversion/libsvn_repos/hooks.c
  (svn_repos__hooks_pre_obliterate, svn_repos__hooks_post_obliterate,
    create_hooks, check_hook_result): Remove obliterate related code.

* subversion/libsvn_fs_fs/tree.h,
  subversion/libsvn_fs_fs/tree.c,
  subversion/libsvn_fs_fs/fs_fs.h,
  subversion/libsvn_fs_fs/fs_fs.c,
  subversion/libsvn_fs_fs/fs.c
  (svn_fs_fs__commit_obliteration_txn, svn_fs_fs__commit_obliteration,
   svn_fs_fs__begin_obliteration_txn, txn_vtable,
   svn_fs_fs__create_obliteration_txn, commit_obliteration_body,
   svn_fs_fs__commit_obliteration, svn_fs_fs__begin_obliteration_txn,
   fs_vtable): Remove obliterate related code.

* subversion/svn/obliterate-cmd.c,
  subversion/libsvn_client/obliterate.c,
  subversion/libsvn_repos/obliterate.c,
  subversion/libsvn_fs_base/obliterate.h,
  subversion/libsvn_fs_base/obliterate.c,
  subversion/tests/cmdline/obliterate_tests.py
    Remove obliterate related files.

* subversion/tests/libsvn_fs/fs-test.c,
  subversion/tests/cmdline/svntest/objects.py
  (obliterate_1, test_funcs, SvnRepository.obliterate_node_rev):
    Remove obliterate related test.

Patch by: Noorul Islam K M <noorul{_AT_}collab.net>
]]]

Thanks and Regards
Noorul

Index: subversion/libsvn_ra/ra_loader.c
===================================================================
--- subversion/libsvn_ra/ra_loader.c (revision 1090946)
+++ subversion/libsvn_ra/ra_loader.c (working copy)
@@ -1248,24 +1248,6 @@
   return err;
 }
 
-svn_error_t *
-svn_ra__obliterate_path_rev(svn_ra_session_t *session,
- svn_revnum_t rev,
- const char *path,
- apr_pool_t *pool)
-{
- const char *session_url;
-
- SVN_ERR(svn_ra_get_session_url(session, &session_url, pool));
-
- if (session->vtable->obliterate_path_rev == NULL)
- return svn_error_create(SVN_ERR_RA_NOT_IMPLEMENTED, NULL,
- _("Obliterate is not supported by this "
- "Repository Access method"));
-
- return session->vtable->obliterate_path_rev(session, rev, path, pool);
-}
-
 
 
 svn_error_t *
Index: subversion/libsvn_ra/ra_loader.h
===================================================================
--- subversion/libsvn_ra/ra_loader.h (revision 1090946)
+++ subversion/libsvn_ra/ra_loader.h (working copy)
@@ -262,11 +262,6 @@
                                   svn_revnum_t end_revision,
                                   svn_revnum_t *revision_deleted,
                                   apr_pool_t *pool);
- /* See svn_ra__obliterate_path_rev() for details. */
- svn_error_t *(*obliterate_path_rev)(svn_ra_session_t *session,
- svn_revnum_t revision,
- const char *path,
- apr_pool_t *pool);
 
 } svn_ra__vtable_t;
 
Index: subversion/libsvn_fs/fs-loader.h
===================================================================
--- subversion/libsvn_fs/fs-loader.h (revision 1090946)
+++ subversion/libsvn_fs/fs-loader.h (working copy)
@@ -168,9 +168,6 @@
   svn_error_t *(*begin_txn)(svn_fs_txn_t **txn_p, svn_fs_t *fs,
                             svn_revnum_t rev, apr_uint32_t flags,
                             apr_pool_t *pool);
- svn_error_t *(*begin_obliteration_txn)(svn_fs_txn_t **txn_p, svn_fs_t *fs,
- svn_revnum_t replacing_rev,
- apr_pool_t *pool);
   svn_error_t *(*open_txn)(svn_fs_txn_t **txn, svn_fs_t *fs,
                            const char *name, apr_pool_t *pool);
   svn_error_t *(*purge_txn)(svn_fs_t *fs, const char *txn_id,
@@ -209,8 +206,6 @@
 {
   svn_error_t *(*commit)(const char **conflict_p, svn_revnum_t *new_rev,
                          svn_fs_txn_t *txn, apr_pool_t *pool);
- svn_error_t *(*commit_obliteration)(svn_revnum_t replacing_rev,
- svn_fs_txn_t *txn, apr_pool_t *pool);
   svn_error_t *(*abort)(svn_fs_txn_t *txn, apr_pool_t *pool);
   svn_error_t *(*get_prop)(svn_string_t **value_p, svn_fs_txn_t *txn,
                            const char *propname, apr_pool_t *pool);
Index: subversion/libsvn_fs/fs-loader.c
===================================================================
--- subversion/libsvn_fs/fs-loader.c (revision 1090946)
+++ subversion/libsvn_fs/fs-loader.c (working copy)
@@ -657,15 +657,6 @@
   return svn_error_return(svn_fs_begin_txn2(txn_p, fs, rev, 0, pool));
 }
 
-svn_error_t *
-svn_fs__begin_obliteration_txn(svn_fs_txn_t **txn_p,
- svn_fs_t *fs,
- svn_revnum_t rev,
- apr_pool_t *pool)
-{
- return svn_error_return(fs->vtable->begin_obliteration_txn(txn_p, fs, rev,
- pool));
-}
 
 svn_error_t *
 svn_fs_commit_txn(const char **conflict_p, svn_revnum_t *new_rev,
@@ -699,19 +690,7 @@
   return SVN_NO_ERROR;
 }
 
-svn_error_t *
-svn_fs__commit_obliteration_txn(svn_revnum_t rev, svn_fs_txn_t *txn,
- apr_pool_t *pool)
-{
- /* TODO: ### Perhaps here is a good place to unpack the revision ... */
 
- SVN_ERR(txn->vtable->commit_obliteration(rev, txn, pool));
-
- /* ### ... and here to re-pack it, if it was packed. */
-
- return SVN_NO_ERROR;
-}
-
 svn_error_t *
 svn_fs_abort_txn(svn_fs_txn_t *txn, apr_pool_t *pool)
 {
Index: subversion/libsvn_ra_local/ra_plugin.c
===================================================================
--- subversion/libsvn_ra_local/ra_plugin.c (revision 1090946)
+++ subversion/libsvn_ra_local/ra_plugin.c (working copy)
@@ -1457,28 +1457,6 @@
   return SVN_NO_ERROR;
 }
 
-/* Implements svn_ra__vtable_t.obliterate_path_rev. */
-static svn_error_t *
-svn_ra_local__obliterate_path_rev(svn_ra_session_t *session,
- svn_revnum_t revision,
- const char *path,
- apr_pool_t *pool)
-{
- svn_ra_local__session_baton_t *sess = session->priv;
- const char *abs_path = svn_fspath__join(sess->fs_path->data, path, pool);
-
- /* A username is absolutely required to obliterate anything. */
- SVN_ERR(get_username(session, pool));
-
- SVN_ERR(svn_repos__obliterate_path_rev(sess->repos,
- sess->username,
- revision,
- abs_path,
- pool));
-
- return SVN_NO_ERROR;
-}
-
 /*----------------------------------------------------------------*/
 
 static const svn_version_t *
@@ -1525,8 +1503,7 @@
   svn_ra_local__replay,
   svn_ra_local__has_capability,
   svn_ra_local__replay_range,
- svn_ra_local__get_deleted_rev,
- svn_ra_local__obliterate_path_rev
+ svn_ra_local__get_deleted_rev
 };
 
 
Index: subversion/tests/libsvn_fs/fs-test.c
===================================================================
--- subversion/tests/libsvn_fs/fs-test.c (revision 1090946)
+++ subversion/tests/libsvn_fs/fs-test.c (working copy)
@@ -4799,61 +4799,6 @@
   return SVN_NO_ERROR;
 }
 
-static svn_error_t *
-obliterate_1(const svn_test_opts_t *opts,
- apr_pool_t *pool)
-{
- apr_pool_t *subpool = svn_pool_create(pool);
- svn_fs_t *fs;
- svn_fs_txn_t *txn;
- svn_fs_root_t *txn_root, *root;
- svn_revnum_t youngest_rev = 0;
-
- /* Create the repository. */
- SVN_ERR(svn_test__create_fs(&fs, "test-repo-obliterate-1",
- opts, pool));
-
- /* Revision 1: Create the Greek tree. */
- SVN_ERR(svn_fs_begin_txn(&txn, fs, 0, subpool));
- SVN_ERR(svn_fs_txn_root(&txn_root, txn, subpool));
- SVN_ERR(svn_test__create_greek_tree(txn_root, subpool));
- SVN_ERR(svn_fs_commit_txn(NULL, &youngest_rev, txn, subpool));
- SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(youngest_rev));
- svn_pool_clear(subpool);
-
- /* Revision 2: Modify A/D/H/chi and A/B/E/alpha. */
- SVN_ERR(svn_fs_begin_txn(&txn, fs, youngest_rev, subpool));
- SVN_ERR(svn_fs_txn_root(&txn_root, txn, subpool));
- SVN_ERR(svn_test__set_file_contents(txn_root, "A/D/H/chi", "2", subpool));
- SVN_ERR(svn_test__set_file_contents(txn_root, "A/B/E/alpha", "2", subpool));
- SVN_ERR(svn_fs_commit_txn(NULL, &youngest_rev, txn, subpool));
- SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(youngest_rev));
- svn_pool_clear(subpool);
-
- /* Revision 3: Copy A/D to A/D2, and create A/D2/floop new. */
- SVN_ERR(svn_fs_begin_txn(&txn, fs, youngest_rev, subpool));
- SVN_ERR(svn_fs_txn_root(&txn_root, txn, subpool));
- SVN_ERR(svn_fs_revision_root(&root, fs, youngest_rev, subpool));
- SVN_ERR(svn_fs_copy(root, "A/D", txn_root, "A/D2", subpool));
- SVN_ERR(svn_fs_make_file(txn_root, "A/D2/floop", subpool));
- SVN_ERR(svn_fs_commit_txn(NULL, &youngest_rev, txn, subpool));
- SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(youngest_rev));
- svn_pool_clear(subpool);
-
- /* Test obliteration in that repository. */
-
- /* In revision 3: ... */
- SVN_ERR(svn_fs__begin_obliteration_txn(&txn, fs, 3, subpool));
- SVN_ERR(svn_fs_txn_root(&txn_root, txn, subpool));
- SVN_ERR(svn_fs_revision_root(&root, fs, 3, subpool));
- SVN_ERR(svn_fs_delete(txn_root, "A/D/H/chi", subpool));
- SVN_ERR(svn_fs__commit_obliteration_txn(3, txn, subpool));
- svn_pool_clear(subpool);
-
- return svn_error_create(SVN_ERR_TEST_FAILED, NULL,
- "Feature and test are still under development");
-}
-
 /* ------------------------------------------------------------------------ */
 
 /* The test table. */
@@ -4933,7 +4878,5 @@
                        "test svn_fs_node_origin_rev"),
     SVN_TEST_OPTS_PASS(small_file_integrity,
                        "create and modify small file"),
- SVN_TEST_OPTS_WIMP(obliterate_1,
- "obliterate 1", "obliterate is in development"),
     SVN_TEST_NULL
   };
Index: subversion/tests/cmdline/obliterate_tests.py
===================================================================
--- subversion/tests/cmdline/obliterate_tests.py (revision 1090946)
+++ subversion/tests/cmdline/obliterate_tests.py (working copy)
@@ -1,225 +0,0 @@
-#!/usr/bin/env python
-#
-# obliterate_tests.py: testing Obliterate
-#
-# Subversion is a tool for revision control.
-# See http://subversion.apache.org for more information.
-#
-# ====================================================================
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-######################################################################
-
-# General modules
-import shutil, sys, re, os
-
-# Our testing module
-import svntest
-from svntest import main, actions, wc, objects
-
-# (abbreviation)
-Item = wc.StateItem
-Skip = svntest.testcase.Skip_deco
-SkipUnless = svntest.testcase.SkipUnless_deco
-XFail = svntest.testcase.XFail_deco
-Issues = svntest.testcase.Issues_deco
-Issue = svntest.testcase.Issue_deco
-Wimp = svntest.testcase.Wimp_deco
-
-
-######################################################################
-# Test utilities
-#
-
-def supports_obliterate():
- if svntest.main.is_ra_type_file() and not svntest.main.is_fs_type_fsfs():
- code, output, error = svntest.main.run_svn(None, "help")
- for line in output:
- if line.find("obliterate") != -1:
- return True
- return False
-
-#obliteration_dirs = ['f-mod', 'f-add', 'f-del', 'f-rpl', 'f-mov']
-obliteration_dirs = ['f-mod']
-
-def create_dd1_scenarios(wc, repo):
- """Create, in the initially empty repository of the SvnWC WC, the
- obliteration test scenarios depicted in each "Example 1" in
- <notes/obliterate/fspec-dd1/dd1-file-ops.svg>."""
-
- # r1: base directories
- for dir in obliteration_dirs:
- wc.svn_mkdir(dir)
- wc.svn_commit()
-
- # r2 to r8 inclusive, just so that the obliteration rev is a round and
- # consistent number (10), no matter what complexity of history we have.
- while repo.head_rev < 8:
- repo.svn_mkdirs('tmp/' + str(repo.head_rev + 1))
- wc.svn_update()
-
- # r9: add the files used in the scenarios
- if 'f-mod' in obliteration_dirs:
- wc.svn_file_create_add('f-mod/F', "Pear\n")
- if 'f-add' in obliteration_dirs:
- pass # nothing needed
- if 'f-del' in obliteration_dirs:
- wc.svn_file_create_add('f-del/F', "Pear\n")
- if 'f-rpl' in obliteration_dirs:
- wc.svn_file_create_add('f-rpl/F', "Pear\n")
- if 'f-mov' in obliteration_dirs:
- wc.svn_file_create_add('f-mov/E', "Pear\n") # 'E' will be moved to 'F'
- wc.svn_commit()
-
- # r10: the rev in which files named 'F' are to be obliterated
- if 'f-mod' in obliteration_dirs:
- wc.file_modify('f-mod/F', 'Apple\n')
- if 'f-add' in obliteration_dirs:
- wc.svn_file_create_add('f-add/F', 'Apple\n')
- if 'f-del' in obliteration_dirs:
- wc.svn_delete('f-del/F')
- if 'f-rpl' in obliteration_dirs:
- wc.svn_delete('f-rpl/F')
- wc.svn_file_create_add('f-rpl/F', 'Apple\n')
- if 'f-mov' in obliteration_dirs:
- wc.svn_move('f-mov/E', 'f-mov/F')
- wc.file_modify('f-mov/F', 'Apple\n')
- wc.svn_commit(log='Rev to be obliterated')
-
- # r11: some more recent history that refers to the revision we changed
- # (We are not ready to test this yet.)
- #for dir in obliteration_dirs:
- # if not dir == 'f-del':
- # wc.file_modify(dir + '/F', 'Orange\n')
- #wc.svn_commit()
-
- return 10
-
-def hook_enable(repo):
- """Make a pre-obliterate hook in REPO (an svntest.objects.SvnRepository)
- that allows the user 'jrandom' to do any obliteration."""
-
- hook_path = os.path.join(repo.repo_absdir, 'hooks', 'pre-obliterate')
- # Embed the text carefully: it might include characters like "%" and "'".
- main.create_python_hook_script(hook_path, 'import sys\n'
- 'repos = sys.argv[1]\n'
- 'user = sys.argv[2]\n'
- 'if user == "jrandom":\n'
- ' sys.exit(0)\n'
- 'sys.exit(1)\n')
-
-######################################################################
-# Tests
-#
-# Each test must return on success or raise on failure.
-
-#----------------------------------------------------------------------
-
-_at_SkipUnless(supports_obliterate)
-def obliterate_1(sbox):
- "test svn obliterate"
-
- # Create empty repos and WC
- actions.guarantee_empty_repository(sbox.repo_dir)
- expected_out = svntest.wc.State(sbox.wc_dir, {})
- expected_disk = svntest.wc.State(sbox.wc_dir, {})
- actions.run_and_verify_checkout(sbox.repo_url, sbox.wc_dir, expected_out,
- expected_disk)
-
- # Create test utility objects
- repo = objects.SvnRepository(sbox.repo_url, sbox.repo_dir)
- wc = objects.SvnWC(sbox.wc_dir, repo)
-
- os.chdir(sbox.wc_dir)
-
- # Create scenarios ready for obliteration
- apple_rev = create_dd1_scenarios(wc, repo)
-
- # Dump the repository state, if possible, for debugging
- try:
- repo.dump('before.dump')
- except:
- pass
-
- hook_enable(repo)
-
- # Obliterate a file in the revision where the file content was 'Apple'
- for dir in obliteration_dirs:
- repo.obliterate_node_rev(dir + '/F', apple_rev)
-
- # Dump the repository state, if possible, for debugging
- try:
- repo.dump('after.dump')
- except:
- pass
-
-_at_SkipUnless(supports_obliterate)
-def pre_obliterate_hook(sbox):
- "test the pre-obliterate hook"
-
- # Create empty repos and WC
- actions.guarantee_empty_repository(sbox.repo_dir)
- expected_out = svntest.wc.State(sbox.wc_dir, {})
- expected_disk = svntest.wc.State(sbox.wc_dir, {})
- actions.run_and_verify_checkout(sbox.repo_url, sbox.wc_dir, expected_out,
- expected_disk)
-
- # Create test utility objects
- repo = objects.SvnRepository(sbox.repo_url, sbox.repo_dir)
- wc = objects.SvnWC(sbox.wc_dir, repo)
-
- os.chdir(sbox.wc_dir)
-
- # Create scenarios ready for obliteration
- apple_rev = create_dd1_scenarios(wc, repo)
- dir = obliteration_dirs[0]
-
- hook_path = os.path.join(repo.repo_absdir, 'hooks', 'pre-obliterate')
-
- # Try an obliterate that should be forbidden as no hook is installed
- exp_err = 'svn: Repository has not been enabled to accept obliteration\n'
- repo.obliterate_node_rev(dir + '/F', apple_rev,
- exp_out=[], exp_err=exp_err, exp_exit=1)
-
- # Try an obliterate that should be forbidden by the hook
- main.create_python_hook_script(hook_path, 'import sys\n'
- 'sys.stderr.write("Pre-oblit, %s, %s" %\n'
- ' (sys.argv[1], sys.argv[2]))\n'
- 'sys.exit(1)\n')
- exp_err = 'svn: Obliteration blocked by pre-obliterate hook (exit code 1) with output:|' + \
- 'Pre-oblit, /.*, jrandom'
- repo.obliterate_node_rev(dir + '/F', apple_rev,
- exp_out=[], exp_err=exp_err, exp_exit=1)
-
- # Try an obliterate that should be allowed by the hook
- hook_enable(repo)
- repo.obliterate_node_rev(dir + '/F', apple_rev)
-
-
-########################################################################
-# Run the tests
-
-
-# list all tests here, starting with None:
-test_list = [ None,
- obliterate_1,
- pre_obliterate_hook,
- ]
-
-if __name__ == '__main__':
- svntest.main.run_tests(test_list)
- # NOTREACHED
Index: subversion/tests/cmdline/svntest/objects.py
===================================================================
--- subversion/tests/cmdline/svntest/objects.py (revision 1090946)
+++ subversion/tests/cmdline/svntest/objects.py (working copy)
@@ -162,15 +162,6 @@
     main.file_write(ldumpfile, ''.join(stderr))
     main.file_append(ldumpfile, ''.join(stdout))
 
-
- def obliterate_node_rev(self, path, rev,
- exp_out=None, exp_err=[], exp_exit=0):
- """Obliterate the single node-rev PATH in revision REV. Check the
- expected stdout, stderr and exit code (EXP_OUT, EXP_ERR, EXP_EXIT)."""
- arg = self.repo_url + '/' + path + '@' + str(rev)
- actions.run_and_verify_svn2(None, exp_out, exp_err, exp_exit,
- 'obliterate', arg)
-
   def svn_mkdirs(self, *dirs):
     """Run 'svn mkdir' on the repository. DIRS is a list of directories to
     make, and each directory is a path relative to the repository root,
Index: subversion/libsvn_ra_svn/client.c
===================================================================
--- subversion/libsvn_ra_svn/client.c (revision 1090946)
+++ subversion/libsvn_ra_svn/client.c (working copy)
@@ -2547,8 +2547,7 @@
   ra_svn_replay,
   ra_svn_has_capability,
   ra_svn_replay_range,
- ra_svn_get_deleted_rev,
- NULL /* ra_svn_obliterate_path_rev */
+ ra_svn_get_deleted_rev
 };
 
 svn_error_t *
Index: subversion/svn/cl.h
===================================================================
--- subversion/svn/cl.h (revision 1090946)
+++ subversion/svn/cl.h (working copy)
@@ -263,7 +263,6 @@
   svn_cl__mergeinfo,
   svn_cl__mkdir,
   svn_cl__move,
- svn_cl__obliterate,
   svn_cl__patch,
   svn_cl__propdel,
   svn_cl__propedit,
Index: subversion/svn/main.c
===================================================================
--- subversion/svn/main.c (revision 1090946)
+++ subversion/svn/main.c (working copy)
@@ -976,13 +976,6 @@
      " All the SRCs must be of the same type.\n"),
     {'r', 'q', opt_force, opt_parents, SVN_CL__LOG_MSG_OPTIONS} },
 
-#ifdef SVN_WITH_EXPERIMENTAL_OBLITERATE
- { "obliterate", svn_cl__obliterate, {0}, N_
- ("Permanently delete a specific node-revision from the repository.\n"
- "usage: obliterate URL_at_REV\n"),
- {0} },
-#endif
-
   { "patch", svn_cl__patch, {0}, N_
     ("Apply a patch to a working copy.\n"
      "usage: patch PATCHFILE [WCPATH]\n"
Index: subversion/svn/obliterate-cmd.c
===================================================================
--- subversion/svn/obliterate-cmd.c (revision 1090946)
+++ subversion/svn/obliterate-cmd.c (working copy)
@@ -1,134 +0,0 @@
-/*
- * obliterate-cmd.c -- Subversion command to permanently delete history.
- *
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- */
-
-/* ==================================================================== */
-
-
-
-/*** Includes. ***/
-
-#include "svn_pools.h"
-#include "svn_path.h"
-#include "svn_client.h"
-#include "svn_error_codes.h"
-#include "svn_error.h"
-#include "cl.h"
-#include "svn_private_config.h"
-
-#include "private/svn_client_private.h"
-
-
-/*** Code. ***/
-
-
-struct notify_baton
-{
- svn_boolean_t had_print_error; /* Used to not keep printing error messages
- when we've already had one print error. */
-};
-
-/* Implements 'svn_wc_notify_func2_t'. */
-static void
-notify(void *baton, const svn_wc_notify_t *n, apr_pool_t *pool)
-{
- struct notify_baton *nb = baton;
- svn_error_t *err;
-
- switch (n->action)
- {
- case svn_wc_notify_delete:
- if ((err = svn_cmdline_printf(pool, _("Obliterate %8ld %s\n"),
- n->revision, n->url)))
- goto print_error;
- break;
-
- default:
- SVN_ERR_MALFUNCTION_NO_RETURN();
- }
-
- if ((err = svn_cmdline_fflush(stdout)))
- goto print_error;
-
- return;
-
- print_error:
- /* If we had no errors before, print this error to stderr. Else, don't print
- anything. The user already knows there were some output errors,
- so there is no point in flooding her with an error per notification. */
- if (!nb->had_print_error)
- {
- nb->had_print_error = TRUE;
-
- /* Issue #3014:
- * Don't print anything on broken pipes. The pipe was likely
- * closed by the process at the other end. We expect that
- * process to perform error reporting as necessary.
- *
- * ### This assumes that there is only one error in a chain for
- * ### SVN_ERR_IO_PIPE_WRITE_ERROR. See svn_cmdline_fputs(). */
- if (err->apr_err != SVN_ERR_IO_PIPE_WRITE_ERROR)
- svn_handle_error2(err, stderr, FALSE, "svn: ");
- }
- svn_error_clear(err);
-}
-
-/* This implements the `svn_opt_subcommand_t' interface. */
-svn_error_t *
-svn_cl__obliterate(apr_getopt_t *os,
- void *baton,
- apr_pool_t *pool)
-{
- svn_cl__opt_state_t *opt_state = ((svn_cl__cmd_baton_t *) baton)->opt_state;
- svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;
- apr_array_header_t *targets;
- struct notify_baton nb = { FALSE };
- svn_opt_revision_t rev;
- svn_revnum_t revnum;
- const char *url;
- const char *path;
-
- SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
- opt_state->targets,
- ctx, pool));
-
- ctx->notify_func2 = notify;
- ctx->notify_baton2 = &nb;
-
- /* Parse the argument into TRUEPATH and REVNUM. */
- if (targets->nelts != 1)
- return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("Wrong number of arguments"));
- path = APR_ARRAY_IDX(targets, 0, const char *);
- SVN_ERR(svn_opt_parse_path(&rev, &url, path, pool));
- if (rev.kind != svn_opt_revision_number)
- return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("Target must specify the revision as a number"));
- if (! svn_path_is_url(url))
- return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("Target must specify a URL"));
- revnum = rev.value.number;
-
- SVN_ERR(svn_client__obliterate_path_rev(url, revnum, ctx, pool));
-
- return SVN_NO_ERROR;
-}
Index: subversion/libsvn_fs_base/tree.c
===================================================================
--- subversion/libsvn_fs_base/tree.c (revision 1090946)
+++ subversion/libsvn_fs_base/tree.c (working copy)
@@ -2773,48 +2773,6 @@
   return SVN_NO_ERROR;
 }
 
-
-/* Commit BATON->txn as a replacement for the existing transaction in
- * revision BATON->new_rev. BATON is of type (struct commit_args *).
- *
- * If the commit succeeds, ARGS->txn is destroyed.
- */
-static svn_error_t *
-txn_body_commit_obliteration(void *baton, trail_t *trail)
-{
- struct commit_args *args = baton;
-
- return svn_fs_base__dag_commit_obliteration_txn(args->new_rev, args->txn,
- trail, trail->pool);
-}
-
-
-/* ### Under development */
-svn_error_t *
-svn_fs_base__commit_obliteration_txn(svn_revnum_t replacing_rev,
- svn_fs_txn_t *txn,
- apr_pool_t *pool)
-{
- struct commit_args commit_args;
-
- /* Commit the replacement transaction. */
- /* We do not need a re-try loop like the (catch up to head, try to
- * commit) loop that svn_fs_base__commit_txn() uses, because the only
- * concurrent changes that can affect this old revision are other
- * obliterates, and they are presently ...
- * ### what - not handled, not supported, mutually exclusive? */
- commit_args.new_rev = replacing_rev;
- commit_args.txn = txn;
- SVN_ERR(svn_fs_base__retry_txn(txn->fs, txn_body_commit_obliteration,
- &commit_args, FALSE, pool));
-
- /* Remove the old txn and any unreferenced data attached to it. */
- /* ### ... */
-
- return SVN_NO_ERROR;
-}
-
-
 /* Note: it is acceptable for this function to call back into
    public FS API interfaces because it does not itself use trails. */
 static svn_error_t *
@@ -2940,95 +2898,6 @@
   return deltify_mutable(fs, root, "/", NULL, svn_node_dir, txn_id, pool);
 }
 
-
-struct txn_obliterate_rep_args
-{
- const svn_fs_id_t *id;
- svn_boolean_t has_pred;
- const svn_fs_id_t *pred_id;
-};
-
-static svn_error_t *
-txn_body_obliterate_rep(void *baton, trail_t *trail)
-{
- struct txn_obliterate_rep_args *args = baton;
- dag_node_t *node, *pred_node;
-
- SVN_ERR(svn_fs_base__dag_get_node(&node, trail->fs, args->id,
- trail, trail->pool));
- if (args->has_pred)
- {
- SVN_ERR(svn_fs_base__dag_get_node(&pred_node, trail->fs, args->pred_id,
- trail, trail->pool));
- }
- else
- {
- pred_node = NULL;
- }
-
- SVN_ERR(svn_fs_base__dag_obliterate_rep(node, pred_node, trail, trail->pool));
-
- return SVN_NO_ERROR;
-}
-
-svn_error_t *
-svn_fs_base__obliterate_rep(svn_fs_t *fs,
- const char *path,
- svn_revnum_t revision,
- apr_pool_t *pool)
-{
- svn_fs_root_t *root;
- const char *txn_id;
- struct rev_get_txn_id_args get_txn_args;
- const svn_fs_id_t *id;
- svn_node_kind_t kind;
- struct txn_pred_count_args pred_count_args;
- struct txn_obliterate_rep_args oblit_args;
-
- SVN_ERR(svn_fs_base__revision_root(&root, fs, revision, pool));
- get_txn_args.txn_id = &txn_id;
- get_txn_args.revision = revision;
- SVN_ERR(svn_fs_base__retry_txn(fs, txn_body_rev_get_txn_id, &get_txn_args,
- FALSE, pool));
-
- SVN_ERR(base_node_id(&id, root, path, pool));
- if (strcmp(svn_fs_base__id_txn_id(id), txn_id))
- return svn_error_createf(SVN_ERR_FS_NOT_MUTABLE, NULL,
- _("Unexpected immutable node at '%s'"), path);
-
- SVN_ERR(base_check_path(&kind, root, path, pool));
- if (kind != svn_node_file)
- return svn_error_createf(SVN_ERR_FS_NOT_FILE, NULL,
- _("Cannot obliterate '%s' as it is not a file"),
- path);
-
- pred_count_args.id = id;
- SVN_ERR(svn_fs_base__retry_txn(fs, txn_body_pred_count, &pred_count_args,
- FALSE, pool));
-
- if (pred_count_args.pred_count > 0)
- {
- struct txn_pred_id_args pred_id_args;
-
- pred_id_args.id = id;
- pred_id_args.pool = pool;
- SVN_ERR(svn_fs_base__retry_txn(fs, txn_body_pred_id, &pred_id_args,
- FALSE, pool));
-
- oblit_args.has_pred = TRUE;
- oblit_args.pred_id = pred_id_args.pred_id;
- }
- else
- {
- oblit_args.has_pred = FALSE;
- }
- oblit_args.id = id;
-
- return svn_fs_base__retry_txn(fs, txn_body_obliterate_rep, &oblit_args,
- TRUE, pool);
-}
-
-
 
 /* Modifying directories */
 
Index: subversion/libsvn_fs_base/obliterate.h
===================================================================
--- subversion/libsvn_fs_base/obliterate.h (revision 1090946)
+++ subversion/libsvn_fs_base/obliterate.h (working copy)
@@ -1,72 +0,0 @@
-/* obliterate.h : operations related to obliteration
- *
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- */
-
-#ifndef SVN_LIBSVN_FS_OBLITERATE_H
-#define SVN_LIBSVN_FS_OBLITERATE_H
-
-#include <apr_pools.h>
-
-#include "svn_fs.h"
-#include "trail.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-
-/* Create a new representation that is a duplicate of the one keyed by KEY,
- * but make the duplicate refer to NEW_TXN_ID.
- * Set *NEW_KEY to the key of the new representation, allocated in
- * TRAIL->pool.
- * Work within TRAIL.
- */
-svn_error_t *
-svn_fs_base__rep_dup(const char **new_key,
- const char *new_txn_id,
- const char *key,
- trail_t *trail,
- apr_pool_t *scratch_pool);
-
-/* If the node_rev identified by OLD_ID was not created in transaction
- * OLD_TXN_ID, then set *NEW_ID to a copy of OLD_ID, allocated in
- * TRAIL->pool, and return. Otherwise:
- *
- * Make a deep copy of node OLD_ID, with any references to OLD_TXN_ID
- * replaced by NEW_TXN_ID (### and more differences?) The new node-rev-id is
- * OLD_ID except with the txn-id field changed to NEW_TXN_ID.
- * Set *NEW_ID to the new node-rev-id, allocated in TRAIL->pool.
- * Work within TRAIL.
- */
-svn_error_t *
-svn_fs_base__node_rev_dup(const svn_fs_id_t **new_id,
- const svn_fs_id_t *old_id,
- const char *new_txn_id,
- const char *old_txn_id,
- trail_t *trail,
- apr_pool_t *scratch_pool);
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* SVN_LIBSVN_FS_OBLITERATE_H */
Index: subversion/libsvn_fs_base/reps-strings.c
===================================================================
--- subversion/libsvn_fs_base/reps-strings.c (revision 1090946)
+++ subversion/libsvn_fs_base/reps-strings.c (working copy)
@@ -1609,132 +1609,3 @@
 
   return SVN_NO_ERROR;
 }
-
-svn_error_t *svn_fs_base__rep_obliterate(svn_fs_t *fs,
- const char *key,
- const char *pred_key,
- trail_t *trail,
- apr_pool_t *pool)
-{
- const char *new_str = NULL;
- representation_t *empty;
- svn_stream_t *new_stream;
- struct write_svndiff_strings_baton new_baton;
- svn_stream_t *pred_stream1, *pred_stream2;
- svn_txdelta_stream_t *txdelta_stream;
- base_fs_data_t *bfd = fs->fsap_data;
- svn_txdelta_window_handler_t new_handler;
- void *new_handler_baton;
- apr_pool_t *wpool;
- apr_array_header_t *windows;
- window_write_t *ww;
- svn_txdelta_window_t *window;
- svn_filesize_t tview_off = 0;
- svn_filesize_t diffsize = 0;
- const unsigned char *digest;
- representation_t *pred_rep;
- representation_t new_rep;
- rep_delta_chunk_t *chunk;
- apr_array_header_t *chunks;
- int i;
-
- if (!pred_key)
- {
- /* No predecessor so just write a new empty rep */
- SVN_ERR(svn_fs_bdb__string_append(fs, &new_str, 0, NULL, trail, pool));
- empty = make_fulltext_rep(new_str, NULL,
- svn_checksum_empty_checksum(svn_checksum_md5,
- pool),
- svn_checksum_empty_checksum(svn_checksum_sha1,
- pool),
- pool);
- SVN_ERR(svn_fs_bdb__write_rep(fs, key, empty, trail, pool));
-
- return SVN_NO_ERROR;
- }
-
- if (!strcmp(key, pred_key))
- return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
- _("Attempt to obliterate '%s' using itself "),
- key);
-
- new_baton.fs = fs;
- new_baton.trail = trail;
- new_baton.header_read = FALSE;
- new_stream = svn_stream_create(&new_baton, pool);
- svn_stream_set_write(new_stream, write_svndiff_strings);
-
- /* ### Is there a simpler way to write a no-change delta? */
- SVN_ERR(svn_fs_base__rep_contents_read_stream(&pred_stream1, fs, pred_key,
- TRUE, trail, pool));
- SVN_ERR(svn_fs_base__rep_contents_read_stream(&pred_stream2, fs, pred_key,
- TRUE, trail, pool));
- svn_txdelta(&txdelta_stream, pred_stream1, pred_stream2, pool);
-
- if (bfd->format >= SVN_FS_BASE__MIN_SVNDIFF1_FORMAT)
- svn_txdelta_to_svndiff2(&new_handler, &new_handler_baton,
- new_stream, 1, pool);
- else
- svn_txdelta_to_svndiff2(&new_handler, &new_handler_baton,
- new_stream, 0, pool);
-
- wpool = svn_pool_create(pool);
- windows = apr_array_make(pool, 1, sizeof(ww));
- do
- {
- new_baton.size = 0;
- new_baton.key = NULL;
- svn_pool_clear(wpool);
-
- SVN_ERR(svn_txdelta_next_window(&window, txdelta_stream, wpool));
- SVN_ERR(new_handler(window, new_handler_baton));
- if (window)
- {
- ww = apr_pcalloc(pool, sizeof(*ww));
- ww->key = new_baton.key;
- ww->svndiff_len = new_baton.size;
- ww->text_off = tview_off;
- ww->text_len = window->tview_len;
- APR_ARRAY_PUSH(windows, window_write_t *) = ww;
- tview_off += window->tview_len;
- diffsize += ww->svndiff_len;
- }
- } while (window);
-
- svn_pool_destroy(wpool);
-
- digest = svn_txdelta_md5_digest(txdelta_stream);
- if (!digest)
- return svn_error_createf(SVN_ERR_DELTA_MD5_CHECKSUM_ABSENT, NULL,
- _("Failed to calculate MD5 digest for '%s'"),
- pred_key);
- /* ### Check the digest against something? pred_rep->md5_checksum? */
-
- SVN_ERR(svn_fs_bdb__read_rep(&pred_rep, fs, pred_key, trail, pool));
- new_rep.md5_checksum = svn_checksum_dup(pred_rep->md5_checksum, pool);
- new_rep.sha1_checksum = svn_checksum_dup(pred_rep->sha1_checksum, pool);
- new_rep.kind = rep_kind_delta;
- new_rep.txn_id = NULL;
-
- chunks = apr_array_make(pool, windows->nelts, sizeof(chunk));
-
- for (i = 0; i < windows->nelts; i++)
- {
- ww = APR_ARRAY_IDX(windows, i, window_write_t *);
-
- chunk = apr_palloc(pool, sizeof(*chunk));
- chunk->offset = ww->text_off;
-
- chunk->version = new_baton.version;
- chunk->string_key = ww->key;
- chunk->size = ww->text_len;
- chunk->rep_key = pred_key;
-
- APR_ARRAY_PUSH(chunks, rep_delta_chunk_t *) = chunk;
- }
-
- new_rep.contents.delta.chunks = chunks;
- SVN_ERR(svn_fs_bdb__write_rep(fs, key, &new_rep, trail, pool));
-
- return SVN_NO_ERROR;
-}
Index: subversion/libsvn_fs_base/dag.h
===================================================================
--- subversion/libsvn_fs_base/dag.h (revision 1090946)
+++ subversion/libsvn_fs_base/dag.h (working copy)
@@ -281,17 +281,6 @@
                                          trail_t *trail,
                                          apr_pool_t *pool);
 
-
-/* Replace the transaction in revision REPLACING_REV with the uncommitted
- * transaction TXN, and promote TXN to a committed transaction. See also
- * svn_fs_base__dag_commit_txn(). */
-svn_error_t *
-svn_fs_base__dag_commit_obliteration_txn(svn_revnum_t replacing_rev,
- svn_fs_txn_t *txn,
- trail_t *trail,
- apr_pool_t *scratch_pool);
-
-
 
 /* Directories. */
 
@@ -558,16 +547,6 @@
                                       trail_t *trail,
                                       apr_pool_t *pool);
 
-/* Obliterate NODE's data by constructing a new representation that
- consists of a no-change delta from PRED_NODE, and changing NODE to
- use that new rep, and leaving the old rep alone in case it is used
- by other nodes. If PRED_NODE is null
- then construct a representation with an empty fulltext instead. */
-svn_error_t *svn_fs_base__dag_obliterate_rep(dag_node_t *node,
- dag_node_t *pred_node,
- trail_t *trail,
- apr_pool_t *pool);
-
 /* Index NODE's backing data representations by their checksum. Do
    this as part of TRAIL. Use POOL for allocations. */
 svn_error_t *svn_fs_base__dag_index_checksums(dag_node_t *node,
Index: subversion/libsvn_fs_base/tree.h
===================================================================
--- subversion/libsvn_fs_base/tree.h (revision 1090946)
+++ subversion/libsvn_fs_base/tree.h (working copy)
@@ -44,10 +44,6 @@
                                      svn_revnum_t *new_rev, svn_fs_txn_t *txn,
                                      apr_pool_t *pool);
 
-svn_error_t *svn_fs_base__commit_obliteration_txn(svn_revnum_t replacing_rev,
- svn_fs_txn_t *txn,
- apr_pool_t *pool);
-
 svn_error_t *svn_fs_base__txn_root(svn_fs_root_t **root_p, svn_fs_txn_t *txn,
                                    apr_pool_t *pool);
 
@@ -103,14 +99,7 @@
                                 apr_pool_t *result_pool,
                                 apr_pool_t *scratch_pool);
 
-/* ### Experimental obliterate-like-deltify - see implementation. */
-svn_error_t *
-svn_fs_base__obliterate_rep(svn_fs_t *fs,
- const char *path,
- svn_revnum_t revision,
- apr_pool_t *pool);
 
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
Index: subversion/libsvn_fs_base/reps-strings.h
===================================================================
--- subversion/libsvn_fs_base/reps-strings.h (revision 1090946)
+++ subversion/libsvn_fs_base/reps-strings.h (working copy)
@@ -168,20 +168,7 @@
                                       trail_t *trail,
                                       apr_pool_t *pool);
 
-/* Obliterate KEY's data by creating a new rep that consists of a
- no-change delta from PRED_KEY's data. If PRED_KEY is null then
- construct an empty fulltext instead of a delta. KEY's old data
- remains in the database in case some other key's data is derived
- from it. */
-/* ### TODO: clarify. What kind of objects are KEY and PRED_KEY, and what
- does it do with the new rep? */
-svn_error_t *svn_fs_base__rep_obliterate(svn_fs_t *fs,
- const char *key,
- const char *pred_key,
- trail_t *trail,
- apr_pool_t *pool);
 
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
Index: subversion/libsvn_fs_base/fs.c
===================================================================
--- subversion/libsvn_fs_base/fs.c (revision 1090946)
+++ subversion/libsvn_fs_base/fs.c (working copy)
@@ -486,7 +486,6 @@
   svn_fs_base__set_uuid,
   svn_fs_base__revision_root,
   svn_fs_base__begin_txn,
- svn_fs_base__begin_obliteration_txn,
   svn_fs_base__open_txn,
   svn_fs_base__purge_txn,
   svn_fs_base__list_transactions,
Index: subversion/libsvn_fs_base/revs-txns.c
===================================================================
--- subversion/libsvn_fs_base/revs-txns.c (revision 1090946)
+++ subversion/libsvn_fs_base/revs-txns.c (working copy)
@@ -40,7 +40,6 @@
 #include "revs-txns.h"
 #include "key-gen.h"
 #include "id.h"
-#include "obliterate.h"
 #include "bdb/rev-table.h"
 #include "bdb/txn-table.h"
 #include "bdb/copies-table.h"
@@ -683,7 +682,6 @@
 
 static txn_vtable_t txn_vtable = {
   svn_fs_base__commit_txn,
- svn_fs_base__commit_obliteration_txn,
   svn_fs_base__abort_txn,
   svn_fs_base__txn_prop,
   svn_fs_base__txn_proplist,
@@ -759,126 +757,6 @@
   return SVN_NO_ERROR;
 }
 
-/* Create a new transaction that is a mutable duplicate of the committed
- * transaction in a particular revision, and able to become a replacement
- * for the transaction in that revision. The duplicate transaction has a new
- * txn-id and is a deep copy of the old one. All references to the txn-id
- * within the copied parts of it are updated.
- *
- * The resulting transaction should be committed by
- * svn_fs_base__commit_obliteration_txn(), not by a normal commit.
- *
- * BATON is of type (struct begin_txn_args *).
- * BATON->base_rev is the revision on which the existing revision
- * is based, i.e. one less than the number of the revision to be replaced.
- * BATON->flags must be 0: specifically, the CHECK_OOD and CHECK_LOCKS
- * flags are not supported.
- *
- * Set BATON->txn_p to point to the new transaction object, allocated in
- * TRAIL->pool.
- */
-static svn_error_t *
-txn_body_begin_obliteration_txn(void *baton, trail_t *trail)
-{
- struct begin_txn_args *args = baton;
- int replacing_rev = args->base_rev + 1;
- const svn_fs_id_t *base_root_id;
- const char *old_txn_id, *new_txn_id;
- transaction_t *old_txn, *new_txn;
-
- /* Obliteration doesn't support these flags */
- SVN_ERR_ASSERT(! (args->flags & SVN_FS_TXN_CHECK_OOD));
- SVN_ERR_ASSERT(! (args->flags & SVN_FS_TXN_CHECK_LOCKS));
-
- /*
- * This is like a combination of "dup the txn" and "make the txn mutable".
- * "Dup the txn" means making a deep copy, but with a new txn id.
- * "Make mutable" is like the opposite of finalizing a txn.
- *
- * To dup the txn in r50:
- * * dup TRANSACTIONS<t50> to TRANSACTIONS<t50'>
- * * dup all referenced NODES<*.*.t50> (not old nodes that are referenced)
- * * dup all referenced REPRESENTATIONS<*> to REPRESENTATIONS<*'>
- * * create new STRINGS<*> where necessary (###?)
- * * dup all CHANGES<t50> to CHANGES<t50'>
- * * update COPIES<cpy_id> (We need to keep the copy IDs the same, but will
- * need to modify the copy src_txn fields.)
- * * update NODE-ORIGINS<node_id>
- *
- * At commit time:
- * * update CHECKSUM-REPS<csum>
- */
-
- /* Implementation:
- * - create a new txn (to get a new txn-id)
- * - read the new txn
- * - modify the new txn locally, duplicating parts of the old txn
- * - write the modified new txn
- * - return a reference to the new txn
- */
-
- /* Create a new txn whose 'root' and 'base root' node-rev ids both point
- * to the previous revision, like txn_body_begin_txn() does. */
- SVN_ERR(svn_fs_base__rev_get_root(&base_root_id, trail->fs,
- args->base_rev, trail, trail->pool));
- SVN_ERR(svn_fs_bdb__create_txn(&new_txn_id, trail->fs, base_root_id,
- trail, trail->pool));
-
- /* Read the old and new txns */
- SVN_ERR(svn_fs_base__rev_get_txn_id(&old_txn_id, trail->fs, replacing_rev,
- trail, trail->pool));
- SVN_ERR(svn_fs_bdb__get_txn(&old_txn, trail->fs, old_txn_id, trail,
- trail->pool));
- SVN_ERR(svn_fs_bdb__get_txn(&new_txn, trail->fs, new_txn_id, trail,
- trail->pool));
-
- /* Populate NEW_TXN with a duplicate of the contents of OLD_TXN. */
-
- SVN_ERR_ASSERT(new_txn->kind == transaction_kind_normal);
-
- /* Dup the old txn's root node-rev (recursively). */
- SVN_ERR(svn_fs_base__node_rev_dup(&new_txn->root_id, old_txn->root_id,
- new_txn_id, old_txn_id, trail,
- trail->pool));
-
- /* Dup txn->proplist */
- new_txn->proplist = old_txn->proplist;
-
- /* Prepare to update the "copies" table.
- *
- * As part of obliteration, we need to update all of the "copies" table
- * rows that are referenced by this txn, to refer to the new txn's
- * node-rev ids instead. At txn begin time, just keep the references to
- * the old rows. At commit time, we will update those rows to refer to
- * this txn's node-rev ids.
- *
- * We cannot simply create new "copies" table rows now and make the old
- * ones obsolete at commit time, because the rows are keyed by copy-id,
- * and we don't want to change the copy_ids because they pervade node-ids
- * throughout history.
- *
- * ### What actually uses the "copies" table? Does anything use it during
- * txn construction? Does it need to be keyed by copy-id or could we
- * change the schema to use arbitrary keys? */
- if (old_txn->copies)
- {
- new_txn->copies = apr_array_copy(trail->pool, old_txn->copies);
- }
-
- /* Dup the "changes" that are keyed by the txn_id. */
- SVN_ERR(changes_dup(new_txn_id, old_txn_id, trail, trail->pool));
-
- /* Save the modified transaction */
- SVN_ERR(svn_fs_bdb__put_txn(trail->fs, new_txn, new_txn_id, trail,
- trail->pool));
-
- /* Make and return an in-memory txn object referring to the new txn */
- *args->txn_p = make_txn(trail->fs, new_txn_id, args->base_rev,
- trail->pool);
- return SVN_NO_ERROR;
-}
-
-
 /* Note: it is acceptable for this function to call back into
    public FS API interfaces because it does not itself use trails. */
 svn_error_t *
@@ -913,39 +791,6 @@
 }
 
 
-/* Create a new transaction in FS that is a mutable clone of the transaction
- * in revision REPLACING_REV and is intended to replace it. Set *TXN_P to
- * point to the new transaction.
- *
- * This is like svn_fs_base__begin_txn() except that it populates the new txn
- * with a mutable clone of revision REPLACING_REV, and it does not support the
- * CHECK_OOD and CHECK_LOCKS flags, and it does not change the date stamp. */
-svn_error_t *
-svn_fs_base__begin_obliteration_txn(svn_fs_txn_t **txn_p,
- svn_fs_t *fs,
- svn_revnum_t replacing_rev,
- apr_pool_t *pool)
-{
- svn_fs_txn_t *txn;
- struct begin_txn_args args;
-
- SVN_ERR(svn_fs__check_fs(fs, TRUE));
-
- /* Make a mutable duplicate of replacing_rev's txn. */
- /* ### Does all of the duplication need to be done inside the retry_txn?
- * It is currently inside. */
- args.txn_p = &txn;
- args.base_rev = replacing_rev - 1;
- args.flags = 0;
- SVN_ERR(svn_fs_base__retry_txn(fs, txn_body_begin_obliteration_txn, &args,
- FALSE, pool));
-
- *txn_p = txn;
-
- return SVN_NO_ERROR;
-}
-
-
 struct open_txn_args
 {
   svn_fs_txn_t **txn_p;
Index: subversion/libsvn_fs_base/revs-txns.h
===================================================================
--- subversion/libsvn_fs_base/revs-txns.h (revision 1090946)
+++ subversion/libsvn_fs_base/revs-txns.h (working copy)
@@ -189,14 +189,6 @@
                                     svn_revnum_t rev, apr_uint32_t flags,
                                     apr_pool_t *pool);
 
-/* Begin a new transaction in filesystem FS, to replace an existing
- revision REPLACING_REV. The new transaction is returned in *TXN_P.
- Allocate the new transaction structure from POOL. */
-svn_error_t *svn_fs_base__begin_obliteration_txn(svn_fs_txn_t **txn_p,
- svn_fs_t *fs,
- svn_revnum_t replacing_rev,
- apr_pool_t *pool);
-
 svn_error_t *svn_fs_base__open_txn(svn_fs_txn_t **txn, svn_fs_t *fs,
                                    const char *name, apr_pool_t *pool);
 
Index: subversion/libsvn_fs_base/obliterate.c
===================================================================
--- subversion/libsvn_fs_base/obliterate.c (revision 1090946)
+++ subversion/libsvn_fs_base/obliterate.c (working copy)
@@ -1,202 +0,0 @@
-/* obliterate.c : operations related to obliteration
- *
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- */
-
-#include <string.h>
-
-#include <apr_tables.h>
-#include <apr_pools.h>
-
-#include "svn_fs.h"
-#include "svn_pools.h"
-
-#include "obliterate.h"
-#include "fs.h"
-#include "dag.h"
-#include "trail.h"
-#include "id.h"
-#include "bdb/nodes-table.h"
-#include "bdb/reps-table.h"
-#include "bdb/strings-table.h"
-#include "../libsvn_fs/fs-loader.h"
-
-#include "svn_private_config.h"
-
-
-
-/* Implementation:
- * - read the existing rep
- * - modify any members that need to change: just the txn_id
- * - duplicate any members that need a deep copy
- * - write out the local rep as a new rep
- * - return the new rep's key (allocated in trail->pool)
- */
-svn_error_t *
-svn_fs_base__rep_dup(const char **new_key,
- const char *new_txn_id,
- const char *key,
- trail_t *trail,
- apr_pool_t *scratch_pool)
-{
- representation_t *rep;
-
- SVN_ERR(svn_fs_bdb__read_rep(&rep, trail->fs, key, trail, scratch_pool));
-
- rep->txn_id = new_txn_id;
-
- /* Dup the strings and any recursively used representations */
- if (rep->kind == rep_kind_fulltext)
- {
- SVN_ERR(svn_fs_bdb__string_copy(trail->fs,
- &rep->contents.fulltext.string_key,
- rep->contents.fulltext.string_key,
- trail, scratch_pool));
- }
- else /* rep_kind_delta */
- {
- apr_array_header_t *chunks = rep->contents.delta.chunks;
- apr_pool_t *iterpool = svn_pool_create(scratch_pool);
- int i;
-
- /* Make a deep copy of the rep's delta information. For each "chunk" (aka
- * "window") in the parent rep, duplicate the chunk's delta string and
- * the chunk's rep. */
- for (i = 0; i < chunks->nelts; i++)
- {
- rep_delta_chunk_t *w = APR_ARRAY_IDX(chunks, i, rep_delta_chunk_t *);
-
- svn_pool_clear(iterpool);
-
- /* Pool usage: We must allocate these two new keys in a pool that
- * lives at least as long as 'rep'. ..._string_copy allocates in its
- * last arg; ...rep_dup() allocates in its 'trail' arg. */
- SVN_ERR(svn_fs_bdb__string_copy(trail->fs,
- &w->string_key, w->string_key,
- trail, scratch_pool));
- SVN_ERR(svn_fs_base__rep_dup(&w->rep_key, new_txn_id, w->rep_key,
- trail, iterpool));
- /* ### w->offset = calc_offset(w->rep_key); ??? */
- }
- svn_pool_destroy(iterpool);
- }
-
- SVN_ERR(svn_fs_bdb__write_new_rep(new_key, trail->fs, rep, trail, trail->pool));
- return SVN_NO_ERROR;
-}
-
-/*
- * ### Use svn_fs_base__dag_copy() instead?
- * ### Do we need to recurse in order to look for embedded references to
- * OLD_TXN_ID even if the current node-rev was not created in txn
- * OLD_TXN_ID?
- */
-svn_error_t *
-svn_fs_base__node_rev_dup(const svn_fs_id_t **new_id,
- const svn_fs_id_t *old_id,
- const char *new_txn_id,
- const char *old_txn_id,
- trail_t *trail,
- apr_pool_t *scratch_pool)
-{
- node_revision_t *noderev;
-
- /* We only want to dup a node-rev if it "belongs to" (was created in) the
- * txn we are replacing. If not, simply return the id. */
- if (strcmp(svn_fs_base__id_txn_id(old_id), old_txn_id) != 0)
- {
- *new_id = svn_fs_base__id_copy(old_id, trail->pool);
- return SVN_NO_ERROR;
- }
-
- /* Set ID2 to ID except with txn_id NEW_TXN_ID */
- *new_id = svn_fs_base__id_create(svn_fs_base__id_node_id(old_id),
- svn_fs_base__id_copy_id(old_id), new_txn_id,
- trail->pool);
-
- /* Dup the representation of its text or entries, and recurse to dup the
- * node-revs of any children. */
- SVN_ERR(svn_fs_bdb__get_node_revision(&noderev, trail->fs, old_id, trail,
- scratch_pool));
- if (noderev->kind == svn_node_dir)
- {
- dag_node_t *parent_dag_node;
- apr_hash_t *entries;
- apr_hash_index_t *hi;
-
- /* Store the new parent node-rev so we can use dag functions on it */
- SVN_ERR(svn_fs_bdb__put_node_revision(trail->fs, *new_id, noderev, trail,
- scratch_pool));
-
- SVN_ERR(svn_fs_base__dag_get_node(&parent_dag_node, trail->fs,
- *new_id, trail, trail->pool));
-
- /* Get the children */
- SVN_ERR(svn_fs_base__dag_dir_entries(&entries, parent_dag_node, trail,
- scratch_pool));
- /* Caution: 'kind' of each child in 'entries' is 'svn_node_unknown'. */
-
- /* Dup the children (recursing) */
- if (entries)
- {
- apr_pool_t *iterpool = svn_pool_create(scratch_pool);
-
- for (hi = apr_hash_first(scratch_pool, entries); hi;
- hi = apr_hash_next(hi))
- {
- const char *child_name = svn__apr_hash_index_key(hi);
- svn_fs_dirent_t *child_entry = svn__apr_hash_index_val(hi);
- const svn_fs_id_t *new_child_id;
-
- svn_pool_clear(iterpool);
-
- /* Pool usage: We are modifying stuff in 'parent_dag_node',
- * writing it to the DB immediately. None of these allocations
- * need to persist outside this loop. */
-
- /* Make a deep copy of the child node-rev. */
- SVN_ERR(svn_fs_base__node_rev_dup(&new_child_id, child_entry->id,
- new_txn_id, old_txn_id, trail,
- iterpool));
-
- /* Make the (new) parent node's rep refer to this new child. */
- SVN_ERR(svn_fs_base__dag_set_entry(parent_dag_node, child_name,
- new_child_id, new_txn_id,
- trail, iterpool));
- /* ### Use instead: svn_fs_base__dag_clone_child() ? */
- }
- svn_pool_destroy(iterpool);
- }
- }
- else if (noderev->kind == svn_node_file)
- {
- if (noderev->data_key)
- SVN_ERR(svn_fs_base__rep_dup(&noderev->data_key, new_txn_id,
- noderev->data_key, trail, scratch_pool));
-
- SVN_ERR(svn_fs_bdb__put_node_revision(trail->fs, *new_id, noderev, trail,
- scratch_pool));
- }
- else
- SVN_ERR_MALFUNCTION();
-
- return SVN_NO_ERROR;
-}
-
Index: subversion/libsvn_fs_base/dag.c
===================================================================
--- subversion/libsvn_fs_base/dag.c (revision 1090946)
+++ subversion/libsvn_fs_base/dag.c (working copy)
@@ -1524,34 +1524,6 @@
   return SVN_NO_ERROR;
 }
 
-
-svn_error_t *
-svn_fs_base__dag_obliterate_rep(dag_node_t *node,
- dag_node_t *pred_node,
- trail_t *trail,
- apr_pool_t *pool)
-{
- node_revision_t *node_rev, *pred_node_rev;
- svn_fs_t *fs = svn_fs_base__dag_get_fs(node);
- const char *pred_key;
-
- SVN_ERR(svn_fs_bdb__get_node_revision(&node_rev, fs, node->id, trail, pool));
- if (pred_node)
- {
- SVN_ERR(svn_fs_bdb__get_node_revision(&pred_node_rev, fs, pred_node->id,
- trail, pool));
- pred_key = pred_node_rev->data_key;
- }
- else
- {
- pred_key = NULL;
- }
-
- return svn_fs_base__rep_obliterate(trail->fs, node_rev->data_key, pred_key,
- trail, pool);
-}
-
-
 /* Maybe store a `checksum-reps' index record for the representation whose
    key is REP. (If there's already a rep for this checksum, we don't
    bother overwriting it.) */
@@ -1782,58 +1754,6 @@
   return SVN_NO_ERROR;
 }
 
-svn_error_t *
-svn_fs_base__dag_commit_obliteration_txn(svn_revnum_t replacing_rev,
- svn_fs_txn_t *txn,
- trail_t *trail,
- apr_pool_t *scratch_pool)
-{
- transaction_t *txn_obj;
- revision_t revision;
- const char *old_txn_id;
-
- /* Find the old txn. */
- SVN_ERR(svn_fs_base__rev_get_txn_id(&old_txn_id, trail->fs, replacing_rev,
- trail, scratch_pool));
-
- /* Read the new txn so we can access its "copies" list */
- SVN_ERR(svn_fs_bdb__get_txn(&txn_obj, trail->fs, txn->id, trail,
- scratch_pool));
-
- /* Finish updating the "copies" table, which was started in
- * svn_fs_base__begin_obliteration_txn(). Change the keys of all the
- * "copies" table rows that we created back to their original keys.
- *
- * This assumes that the old 'replacing_rev' transaction is now obsolete,
- * so that the old "copies" table rows are no longer referenced.
- *
- * ### TODO: See txn_body_begin_obliteration_txn().
- * ### TODO: Guarantee the old txn is obsolete.
- */
- if (txn_obj->copies)
- SVN_ERR(copies_update(txn->id, old_txn_id, txn_obj->copies, trail,
- scratch_pool));
-
- /* Write back the new txn in case we changed its "copies" list */
- SVN_ERR(svn_fs_bdb__put_txn(trail->fs, txn_obj, txn->id, trail,
- scratch_pool));
-
- /* Replace the revision entry in the `revisions' table. */
- revision.txn_id = txn->id;
- SVN_ERR(svn_fs_bdb__put_rev(&replacing_rev, txn->fs, &revision, trail,
- scratch_pool));
-
- /* Promote the unfinished transaction to a committed one. */
- SVN_ERR(svn_fs_base__txn_make_committed(txn->fs, txn->id, replacing_rev,
- trail, scratch_pool));
-
- /* Update the "node-origins" table. */
- SVN_ERR(node_origins_update(txn->id, old_txn_id, trail, scratch_pool));
-
- return SVN_NO_ERROR;
-}
-
-
 
 /*** Comparison. ***/
 
Index: subversion/include/private/svn_client_private.h
===================================================================
--- subversion/include/private/svn_client_private.h (revision 1090946)
+++ subversion/include/private/svn_client_private.h (working copy)
@@ -37,19 +37,6 @@
 #endif /* __cplusplus */
 
 
-/** Obliterate the node at URL @a url in revision @a rev.
- *
- * Use the authentication baton stored in @a ctx for authentication.
- *
- * @since New in 1.7.
- */
-svn_error_t *
-svn_client__obliterate_path_rev(const char *url,
- svn_revnum_t rev,
- svn_client_ctx_t *ctx,
- apr_pool_t *pool);
-
-
 /** Return @c SVN_ERR_ILLEGAL_TARGET if TARGETS contains a mixture of
  * URLs and paths; otherwise return SVN_NO_ERROR.
  *
Index: subversion/include/private/svn_repos_private.h
===================================================================
--- subversion/include/private/svn_repos_private.h (revision 1090946)
+++ subversion/include/private/svn_repos_private.h (working copy)
@@ -37,57 +37,6 @@
 #endif /* __cplusplus */
 
 
-/**
- * Permanently delete @a path at revision @a revision in @a fs.
- *
- * Do not change the content of any other node in the repository, even other
- * nodes that were copied from this one. The only other change in the
- * repository is to "copied from" pointers that were pointing to the
- * now-deleted node. These are removed or made to point to a previous
- * version of the now-deleted node.
- * (### TODO: details.)
- *
- * @a path is relative to the repository root and must start with "/".
- *
- * If administratively forbidden, return @c SVN_ERR_RA_NOT_AUTHORIZED. If not
- * implemented by the RA layer or by the server, return
- * @c SVN_ERR_RA_NOT_IMPLEMENTED.
- *
- * @note This functionality is not implemented in pre-1.7 servers and may not
- * be implemented in all 1.7 and later servers.
- *
- * @note TODO: Maybe create svn_repos_fs_begin_obliteration_txn() and
- * svn_repos_fs_commit_obliteration_txn() to enable an obliteration txn to be
- * constructed at a higher level.
- *
- * @since New in 1.7.
- */
-svn_error_t *
-svn_repos__obliterate_path_rev(svn_repos_t *repos,
- const char *username,
- svn_revnum_t revision,
- const char *path,
- apr_pool_t *pool);
-
-/** Return the path to @a repos's pre-obliterate hook, allocated in
- * @a pool.
- *
- * @since New in 1.7.
- */
-const char *
-svn_repos__pre_obliterate_hook(svn_repos_t *repos,
- apr_pool_t *pool);
-
-/** Return the path to @a repos's post-obliterate hook, allocated in
- * @a pool.
- *
- * @since New in 1.7.
- */
-const char *
-svn_repos__post_obliterate_hook(svn_repos_t *repos,
- apr_pool_t *pool);
-
-
 /** Validate that property @a name is valid for use in a Subversion
  * repository; return @c SVN_ERR_REPOS_BAD_ARGS if it isn't. For some
  * "svn:" properties, also validate the @a value, and return
Index: subversion/include/private/svn_ra_private.h
===================================================================
--- subversion/include/private/svn_ra_private.h (revision 1090946)
+++ subversion/include/private/svn_ra_private.h (working copy)
@@ -45,29 +45,6 @@
                                         const char *path_or_url,
                                         apr_pool_t *pool);
 
-/** Permanently delete @a path (relative to the URL of @a session) in revision
- * @a rev.
- *
- * Do not change the content of other node in the repository, even other nodes
- * that were copied from this one. The only other change in the repository is
- * to "copied from" pointers that were pointing to the now-deleted node. These
- * are removed or made to point to a previous version of the now-deleted node.
- * (### TODO: details.)
- *
- * If administratively forbidden, return @c SVN_ERR_RA_NOT_AUTHORIZED. If not
- * implemented by the server, return @c SVN_ERR_RA_NOT_IMPLEMENTED.
- *
- * @note This functionality is not implemented in pre-1.7 servers and may not
- * be implemented in all 1.7 and later servers.
- *
- * @since New in 1.7.
- */
-svn_error_t *
-svn_ra__obliterate_path_rev(svn_ra_session_t *session,
- svn_revnum_t rev,
- const char *path,
- apr_pool_t *pool);
-
 
 /*** Operational Locks ***/
 
Index: subversion/include/private/svn_fs_private.h
===================================================================
--- subversion/include/private/svn_fs_private.h (revision 1090946)
+++ subversion/include/private/svn_fs_private.h (working copy)
@@ -58,39 +58,6 @@
 apr_hash_t *
 svn_fs__access_get_lock_tokens(svn_fs_access_t *access_ctx);
 
-
-/**
- * Same as svn_fs_begin_txn2(), except it begins an obliteration-txn
- * that can be used to replace revision @a rev. @a rev must be a valid
- * revision number at the time of this call. This transaction cannot be
- * committed with a normal commit but only with
- * svn_fs__commit_obliteration_txn().
- *
- * @note You usually don't want to call this directly.
- * Instead, call svn_repos__obliterate_path_rev(), which honors the
- * repository's hook configurations.
- *
- * @since New in 1.7.
- */
-svn_error_t *
-svn_fs__begin_obliteration_txn(svn_fs_txn_t **txn_p,
- svn_fs_t *fs,
- svn_revnum_t rev,
- apr_pool_t *pool);
-
-
-/** Commit the obliteration-txn @a txn. Similar to svn_fs_commit_txn() but
- * replaces the revision @a rev, which must be the same revision as was
- * specified when the transaction was begun. No conflict is possible.
- *
- * @since New in 1.7.
- */
-svn_error_t *
-svn_fs__commit_obliteration_txn(svn_revnum_t rev,
- svn_fs_txn_t *txn,
- apr_pool_t *pool);
-
-
 /* Access the process-global (singleton) membuffer cache. The first call
  * will automatically allocate the cache using the current cache config.
  * NULL will be returned if the desired cache size is 0.
Index: subversion/libsvn_client/obliterate.c
===================================================================
--- subversion/libsvn_client/obliterate.c (revision 1090946)
+++ subversion/libsvn_client/obliterate.c (working copy)
@@ -1,58 +0,0 @@
-/*
- * obliterate.c: removing nodes (or changes) from history
- *
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- */
-
-
-#include "private/svn_client_private.h"
-#include "private/svn_ra_private.h"
-#include "svn_client.h"
-
-
-
-svn_error_t *
-svn_client__obliterate_path_rev(const char *url,
- svn_revnum_t rev,
- svn_client_ctx_t *ctx,
- apr_pool_t *pool)
-{
- svn_ra_session_t *ra_session;
- const char *path;
-
- /* Open a simple RA session for the URL (not connected to a WC). */
- SVN_ERR(svn_client_open_ra_session(&ra_session, url, ctx, pool));
-
- path = ""; /* relative to URL of session */
-
- SVN_ERR(svn_ra__obliterate_path_rev(ra_session, rev, path, pool));
-
- if (ctx->notify_func2)
- {
- svn_wc_notify_t *notify
- = svn_wc_create_notify_url(url, svn_wc_notify_delete, pool);
- /* ### Should be svn_wc_notify_obliterate not svn_wc_notify_delete. */
- notify->revision = rev;
-
- (*ctx->notify_func2)(ctx->notify_baton2, notify, pool);
- }
-
- return SVN_NO_ERROR;
-}
Index: subversion/libsvn_ra_neon/session.c
===================================================================
--- subversion/libsvn_ra_neon/session.c (revision 1090946)
+++ subversion/libsvn_ra_neon/session.c (working copy)
@@ -1231,8 +1231,7 @@
   svn_ra_neon__replay,
   svn_ra_neon__has_capability,
   svn_ra_neon__replay_range,
- svn_ra_neon__get_deleted_rev,
- NULL /* svn_ra_neon__obliterate_path_rev */
+ svn_ra_neon__get_deleted_rev
 };
 
 svn_error_t *
Index: subversion/libsvn_ra_serf/serf.c
===================================================================
--- subversion/libsvn_ra_serf/serf.c (revision 1090946)
+++ subversion/libsvn_ra_serf/serf.c (working copy)
@@ -1063,8 +1063,7 @@
   svn_ra_serf__replay,
   svn_ra_serf__has_capability,
   svn_ra_serf__replay_range,
- svn_ra_serf__get_deleted_rev,
- NULL /* svn_ra_serf__obliterate_path_rev */
+ svn_ra_serf__get_deleted_rev
 };
 
 svn_error_t *
Index: subversion/libsvn_repos/hooks.c
===================================================================
--- subversion/libsvn_repos/hooks.c (revision 1090946)
+++ subversion/libsvn_repos/hooks.c (working copy)
@@ -126,8 +126,6 @@
         action = _("Commit");
       else if (strcmp(name, "pre-revprop-change") == 0)
         action = _("Revprop change");
- else if (strcmp(name, "pre-obliterate") == 0)
- action = _("Obliteration");
       else if (strcmp(name, "pre-lock") == 0)
         action = _("Lock");
       else if (strcmp(name, "pre-unlock") == 0)
@@ -587,92 +585,6 @@
 
 
 svn_error_t *
-svn_repos__hooks_pre_obliterate(svn_repos_t *repos,
- svn_revnum_t rev,
- const char *author,
- const svn_string_t *obliteration_set,
- apr_pool_t *pool)
-{
- const char *hook = svn_repos__pre_obliterate_hook(repos, pool);
- svn_boolean_t broken_link;
-
- if ((hook = check_hook_cmd(hook, &broken_link, pool)) && broken_link)
- {
- return hook_symlink_error(hook);
- }
- else if (hook)
- {
- const char *args[4];
- apr_file_t *stdin_handle = NULL;
-
- /* Pass the Obliteration Set as stdin to hook */
- SVN_ERR(create_temp_file(&stdin_handle, obliteration_set, pool));
-
- args[0] = hook;
- args[1] = svn_dirent_local_style(svn_repos_path(repos, pool), pool);
- args[2] = author ? author : "";
- args[3] = NULL;
-
- SVN_ERR(run_hook_cmd(NULL, SVN_REPOS__HOOK_PRE_OBLITERATE, hook, args,
- stdin_handle, pool));
-
- SVN_ERR(svn_io_file_close(stdin_handle, pool));
- }
- else
- {
- /* If the pre- hook doesn't exist at all, then default to
- MASSIVE PARANOIA. Obliteration is a lossy
- operation; so unless the repository admininstrator has
- *deliberately* created the pre-hook, disallow all changes. */
- return
- svn_error_create
- (SVN_ERR_REPOS_DISABLED_FEATURE, NULL,
- _("Repository has not been enabled to accept obliteration"));
- }
-
- return SVN_NO_ERROR;
-}
-
-
-svn_error_t *
-svn_repos__hooks_post_obliterate(svn_repos_t *repos,
- svn_revnum_t rev,
- const char *author,
- const svn_string_t *obliteration_set,
- apr_pool_t *pool)
-{
- const char *hook = svn_repos_post_revprop_change_hook(repos, pool);
- svn_boolean_t broken_link;
-
- if ((hook = check_hook_cmd(hook, &broken_link, pool)) && broken_link)
- {
- return hook_symlink_error(hook);
- }
- else if (hook)
- {
- const char *args[4];
- apr_file_t *stdin_handle = NULL;
-
- /* Pass the Obliteration Set as stdin to hook */
- SVN_ERR(create_temp_file(&stdin_handle, obliteration_set, pool));
-
- args[0] = hook;
- args[1] = svn_dirent_local_style(svn_repos_path(repos, pool), pool);
- args[2] = author ? author : "";
- args[3] = NULL;
-
- SVN_ERR(run_hook_cmd(NULL, SVN_REPOS__HOOK_POST_REVPROP_CHANGE, hook,
- args, stdin_handle, pool));
-
- SVN_ERR(svn_io_file_close(stdin_handle, pool));
- }
-
- return SVN_NO_ERROR;
-}
-
-
-
-svn_error_t *
 svn_repos__hooks_pre_lock(svn_repos_t *repos,
                           const char **token,
                           const char *path,
Index: subversion/libsvn_repos/repos.c
===================================================================
--- subversion/libsvn_repos/repos.c (revision 1090946)
+++ subversion/libsvn_repos/repos.c (working copy)
@@ -163,22 +163,6 @@
 }
 
 
-const char *
-svn_repos__pre_obliterate_hook(svn_repos_t *repos, apr_pool_t *pool)
-{
- return svn_dirent_join(repos->hook_path, SVN_REPOS__HOOK_PRE_OBLITERATE,
- pool);
-}
-
-
-const char *
-svn_repos__post_obliterate_hook(svn_repos_t *repos, apr_pool_t *pool)
-{
- return svn_dirent_join(repos->hook_path, SVN_REPOS__HOOK_POST_OBLITERATE,
- pool);
-}
-
-
 static svn_error_t *
 create_repos_dir(const char *path, apr_pool_t *pool)
 {
@@ -546,82 +530,6 @@
   } /* end pre-revprop-change hook */
 
 
-#ifdef SVN_WITH_EXPERIMENTAL_OBLITERATE
- /* Pre-obliterate hook. */
- {
- this_path = apr_psprintf(pool, "%s%s",
- svn_repos__pre_obliterate_hook(repos, pool),
- SVN_REPOS__HOOK_DESC_EXT);
-
-#define SCRIPT_NAME SVN_REPOS__HOOK_PRE_OBLITERATE
-
- contents =
-"#!/bin/sh" NL
-"" NL
-"# PRE-OBLITERATE HOOK" NL
-"#" NL
-"# The pre-obliterate hook is invoked before an obliteration. Subversion" NL
-"# runs this hook by invoking a program (script, executable, binary, etc.)" NL
-"# named '"SCRIPT_NAME"' (for which this file is a template), with the" NL
-"# following ordered arguments and input:" NL
-"#" NL
-"# [1] REPOS-PATH (the path to this repository)" NL
-"# [2] USER (the username of the person trying to obliterate)" NL
-"#" NL
-"# [STDIN] OBLITERATION-SET (a list of PATH_at_REV, one per line)" NL
-"#" NL
-"# If the hook program exits with success, the obliteration happens; but" NL
-"# if it exits with failure (non-zero), the obliteration doesn't happen." NL
-"# The hook program can use the 'svnlook' utility to examine the" NL
-"# existing history of the repository." NL
-"#" NL
-"# NOTE: Unlike most other hooks, this hook MUST exist for obliteration" NL
-"# to be enabled. If the hook does not exist, Subversion" NL
-"# will behave as if the hook were present, but failed. The reason" NL
-"# for this is that obliteration is irreversible: the old data is gone" NL
-"# forever." NL
-"#" NL
-"# WARNING: We recommend not enabling the hook until:" NL
-"# - it is needed;" NL
-"# - there is a good repository back-up and restore procedure operating;" NL
-"# - the user name(s) to be allowed obliteration privileges are" NL
-"# authenticated user names with strong passwords;" NL
-"# - the hook script has been tested." NL
-"#" NL
-"# On a Unix system, the normal procedure is to have '"SCRIPT_NAME"'" NL
-"# invoke other programs to do the real work, though it may do the" NL
-"# work itself too." NL
-"#" NL
-"# Note that '"SCRIPT_NAME"' must be executable by the user(s) who will" NL
-"# invoke it (typically the user httpd runs as), and that user must" NL
-"# have filesystem-level permission to access the repository." NL
-"#" NL
-"# On a Windows system, you should name the hook program" NL
-"# '"SCRIPT_NAME".bat' or '"SCRIPT_NAME".exe'," NL
-"# but the basic idea is the same." NL
-"#" NL
-HOOKS_ENVIRONMENT_TEXT
-"#" NL
-"# Here is an example hook script, for a Unix /bin/sh interpreter." NL
-PREWRITTEN_HOOKS_TEXT
-"" NL
-"" NL
-"REPOS=\"$1\"" NL
-"USER=\"$2\"" NL
-"" NL
-"if [ \"$USER\" = \"the-admin\" ]; then exit 0; fi" NL
-"" NL
-"echo \"Obliteration is not enabled for normal users\" >&2" NL
-"exit 1" NL;
-
-#undef SCRIPT_NAME
-
- SVN_ERR_W(svn_io_file_create(this_path, contents, pool),
- _("Creating pre-obliterate hook"));
- } /* end pre-obliterate hook */
-#endif
-
-
   /* Pre-lock hook. */
   {
     this_path = apr_psprintf(pool, "%s%s",
@@ -1039,66 +947,6 @@
               _("Creating post-revprop-change hook"));
   } /* end post-revprop-change hook */
 
-#ifdef SVN_WITH_EXPERIMENTAL_OBLITERATE
- /* Post-obliterate hook. */
- {
- this_path = apr_psprintf(pool, "%s%s",
- svn_repos__post_obliterate_hook(repos, pool),
- SVN_REPOS__HOOK_DESC_EXT);
-
-#define SCRIPT_NAME SVN_REPOS__HOOK_POST_OBLITERATE
-
- contents =
-"#!/bin/sh" NL
-"" NL
-"# POST-OBLITERATE HOOK" NL
-"#" NL
-"# The post-obliterate hook is invoked after an obliteration." NL
-"# Subversion runs this hook by invoking a program (script, executable," NL
-"# binary, etc.) named '"SCRIPT_NAME"' (for which this file is a template)," NL
-"# with the following ordered arguments:" NL
-"#" NL
-"# [1] REPOS-PATH (the path to this repository)" NL
-"# [2] USER (the username of the person trying to obliterate)" NL
-"#" NL
-"# [STDIN] OBLITERATION-SET (a list of PATH_at_REV, one per line)" NL
-"#" NL
-"# Because the obliteration has already completed and cannot be undone," NL
-"# the exit code of the hook program is ignored. The hook program" NL
-"# can use the 'svnlook' utility to help it examine the" NL
-"# new history of the repository." NL
-"#" NL
-"# On a Unix system, the normal procedure is to have '"SCRIPT_NAME"'" NL
-"# invoke other programs to do the real work, though it may do the" NL
-"# work itself too." NL
-"#" NL
-"# Note that '"SCRIPT_NAME"' must be executable by the user(s) who will" NL
-"# invoke it (typically the user httpd runs as), and that user must" NL
-"# have filesystem-level permission to access the repository." NL
-"#" NL
-"# On a Windows system, you should name the hook program" NL
-"# '"SCRIPT_NAME".bat' or '"SCRIPT_NAME".exe'," NL
-"# but the basic idea is the same." NL
-"#" NL
-HOOKS_ENVIRONMENT_TEXT
-"# " NL
-"# Here is an example hook script, for a Unix /bin/sh interpreter." NL
-PREWRITTEN_HOOKS_TEXT
-"" NL
-"" NL
-"REPOS=\"$1\"" NL
-"USER=\"$2\"" NL
-"" NL
-"# Send out an email notification" NL
-"mailer.py obliterate \"$REPOS\" \"$USER\" /path/to/mailer.conf" NL;
-
-#undef SCRIPT_NAME
-
- SVN_ERR_W(svn_io_file_create(this_path, contents, pool),
- _("Creating post-obliterate hook"));
- } /* end post-obliterate hook */
-#endif
-
   return SVN_NO_ERROR;
 }
 
Index: subversion/libsvn_repos/obliterate.c
===================================================================
--- subversion/libsvn_repos/obliterate.c (revision 1090946)
+++ subversion/libsvn_repos/obliterate.c (working copy)
@@ -1,84 +0,0 @@
-/*
- * obliterate.c: permanently delete history from the repository
- *
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- */
-
-
-#include "svn_error.h"
-#include "svn_error_codes.h"
-#include "svn_fs.h"
-#include "svn_repos.h"
-#include "svn_dirent_uri.h"
-
-#include "repos.h"
-#include "private/svn_repos_private.h"
-#include "private/svn_fs_private.h"
-#include "svn_private_config.h"
-
-
-
-svn_error_t *
-svn_repos__obliterate_path_rev(svn_repos_t *repos,
- const char *username,
- svn_revnum_t revision,
- const char *path,
- apr_pool_t *pool)
-{
- svn_fs_t *fs = svn_repos_fs(repos);
- svn_fs_root_t *rev_root, *txn_root;
- svn_fs_txn_t *txn;
- const svn_fs_id_t *node_id;
- svn_string_t *obliteration_set;
-
- SVN_ERR_ASSERT(path[0] == '/' && svn_relpath_is_canonical(path + 1, pool));
-
- /* Sanity check: ensure the path exists in fs at the revision.
- * ### TODO: May want to allow non-existent node as a no-op.
- * ### This is an error for now to help catch wrong-node-reached bugs. */
- SVN_ERR(svn_fs_revision_root(&rev_root, fs, revision, pool));
- SVN_ERR(svn_fs_node_id(&node_id, rev_root, path, pool));
-
- /* Run the pre-obliterate hook. Fail if it doesn't exist or if it rejects
- * access. */
- obliteration_set = svn_string_createf(pool, "%s@%ld\n", path, revision);
- SVN_ERR(svn_repos__hooks_pre_obliterate(repos, revision, username,
- obliteration_set, pool));
-
- /* Check the node kind of PATH in our transaction. */
- /* SVN_ERR(svn_fs_check_path(&kind, rev_root, path, pool));
- * if (kind == svn_node_none) ... */
-
- /* ### authz checks: see commit.c:delete_entry() */
-
- /* Begin a new transaction, based on the revision we want to modify. */
- SVN_ERR(svn_fs__begin_obliteration_txn(&txn, fs, revision, pool));
- SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
-
- /* Make the required changes in this txn */
- SVN_ERR(svn_fs_delete(txn_root, path, pool));
-
- /* Commit the new transaction in place of the old revision */
- SVN_ERR(svn_fs__commit_obliteration_txn(revision, txn, pool));
-
- return SVN_NO_ERROR;
-}
-
-
Index: subversion/libsvn_repos/repos.h
===================================================================
--- subversion/libsvn_repos/repos.h (revision 1090946)
+++ subversion/libsvn_repos/repos.h (working copy)
@@ -76,8 +76,6 @@
 #define SVN_REPOS__HOOK_WRITE_SENTINEL "write-sentinels"
 #define SVN_REPOS__HOOK_PRE_REVPROP_CHANGE "pre-revprop-change"
 #define SVN_REPOS__HOOK_POST_REVPROP_CHANGE "post-revprop-change"
-#define SVN_REPOS__HOOK_PRE_OBLITERATE "pre-obliterate"
-#define SVN_REPOS__HOOK_POST_OBLITERATE "post-obliterate"
 #define SVN_REPOS__HOOK_PRE_LOCK "pre-lock"
 #define SVN_REPOS__HOOK_POST_LOCK "post-lock"
 #define SVN_REPOS__HOOK_PRE_UNLOCK "pre-unlock"
@@ -224,43 +222,6 @@
                                      char action,
                                      apr_pool_t *pool);
 
-/* Run the pre-obliterate hook for REPOS. Use POOL for any
- temporary allocations. If the hook fails, return
- SVN_ERR_REPOS_HOOK_FAILURE.
-
- REV is the revision whose property is being changed.
- AUTHOR is the authenticated name of the user changing the prop.
- OBLITERATION_SET is a string listing all the PATH_at_REV pairs, with
- a newline after each.
-
- The pre-revprop-change hook will have the new property value
- written to its stdin. If the property is being deleted, no data
- will be written. */
-svn_error_t *
-svn_repos__hooks_pre_obliterate(svn_repos_t *repos,
- svn_revnum_t rev,
- const char *author,
- const svn_string_t *obliteration_set,
- apr_pool_t *pool);
-
-/* Run the pre-obliterate hook for REPOS. Use POOL for any
- temporary allocations. If the hook fails, return
- SVN_ERR_REPOS_HOOK_FAILURE.
-
- REV is the revision whose property was changed.
- AUTHOR is the authenticated name of the user who changed the prop.
- OBLITERATION_SET is a string listing all the PATH_at_REV pairs, with
- a newline after each.
-
- The old value will be passed to the post-revprop hook on stdin. If
- the property is being created, no data will be written. */
-svn_error_t *
-svn_repos__hooks_post_obliterate(svn_repos_t *repos,
- svn_revnum_t rev,
- const char *author,
- const svn_string_t *obliteration_set,
- apr_pool_t *pool);
-
 /* Run the pre-lock hook for REPOS. Use POOL for any temporary
    allocations. If the hook fails, return SVN_ERR_REPOS_HOOK_FAILURE.
 
Index: subversion/libsvn_fs_fs/tree.c
===================================================================
--- subversion/libsvn_fs_fs/tree.c (revision 1090946)
+++ subversion/libsvn_fs_fs/tree.c (working copy)
@@ -1733,25 +1733,6 @@
 }
 
 
-svn_error_t *
-svn_fs_fs__commit_obliteration_txn(svn_revnum_t replacing_rev,
- svn_fs_txn_t *txn,
- apr_pool_t *pool)
-{
- svn_error_t *err = SVN_NO_ERROR;
- svn_fs_t *fs = txn->fs;
-
- /* Try to commit. */
- err = svn_fs_fs__commit_obliteration(replacing_rev, fs, txn, pool);
- if (err && (err->apr_err == SVN_ERR_FS_TXN_OUT_OF_DATE))
- {
- /* ### ? */
- }
-
- return svn_error_return(err);
-}
-
-
 /* Merge changes between two nodes into a third node. Given nodes
    SOURCE_PATH under SOURCE_ROOT, TARGET_PATH under TARGET_ROOT and
    ANCESTOR_PATH under ANCESTOR_ROOT, modify target to contain all the
Index: subversion/libsvn_fs_fs/fs_fs.c
===================================================================
--- subversion/libsvn_fs_fs/fs_fs.c (revision 1090946)
+++ subversion/libsvn_fs_fs/fs_fs.c (working copy)
@@ -131,7 +131,6 @@
 /* The vtable associated with an open transaction object. */
 static txn_vtable_t txn_vtable = {
   svn_fs_fs__commit_txn,
- svn_fs_fs__commit_obliteration_txn,
   svn_fs_fs__abort_txn,
   svn_fs_fs__txn_prop,
   svn_fs_fs__txn_proplist,
@@ -4919,65 +4918,6 @@
                             pool);
 }
 
-/* Create and set *TXN_P to a new transaction in FS that is a mutable clone
- * of revision REPLACING_REV and is intended to replace it.
- *
- * Ways to implement it:
- * 1. Call svn_fs_fs__create_txn(based_on_rev),
- * then adjust txn's content to match replacing_rev's content. (Can't
- * simply apply the same changes; have to make it a clone so all copy
- * id's etc. are identical.)
- * 2. Construct a txn the way __create_txn() would, but clone the root node
- * of REPLACING_REV rather than making a versioned copy of it.
- */
-static svn_error_t *
-svn_fs_fs__create_obliteration_txn(svn_fs_txn_t **txn_p,
- svn_fs_t *fs,
- svn_revnum_t replacing_rev,
- apr_pool_t *pool)
-{
- fs_fs_data_t *ffd = fs->fsap_data;
- svn_fs_txn_t *txn;
- svn_fs_id_t *old_root_id;
- svn_revnum_t based_on_rev = replacing_rev - 1;
-
- txn = apr_pcalloc(pool, sizeof(*txn));
-
- /* Get the txn_id. */
- SVN_ERR_ASSERT(ffd->format >= SVN_FS_FS__MIN_TXN_CURRENT_FORMAT);
- SVN_ERR(create_txn_dir(&txn->id, fs, based_on_rev, pool));
-
- txn->fs = fs;
- txn->base_rev = based_on_rev;
-
- txn->vtable = &txn_vtable;
- *txn_p = txn;
-
- /* Find the root of the replaced ("old") revision. */
- SVN_ERR(svn_fs_fs__rev_get_root(&old_root_id, fs, replacing_rev, pool));
-
- /* Create a new root node for this transaction, based on replacing-rev. */
- /* ### Not like this... This makes the new txn's root node be a "new
- * version" of the old one's root node. I need it to be a "clone" instead. */
- SVN_ERR(create_new_txn_noderev_from_rev(fs, txn->id, old_root_id, pool));
-
- /* Create an empty rev file. */
- SVN_ERR(svn_io_file_create(path_txn_proto_rev(fs, txn->id, pool), "",
- pool));
-
- /* Create an empty rev-lock file. */
- SVN_ERR(svn_io_file_create(path_txn_proto_rev_lock(fs, txn->id, pool), "",
- pool));
-
- /* Create an empty changes file. */
- SVN_ERR(svn_io_file_create(path_txn_changes(fs, txn->id, pool), "",
- pool));
-
- /* Create the next-ids file. */
- return svn_io_file_create(path_txn_next_ids(fs, txn->id, pool), "0 0\n",
- pool);
-}
-
 /* Store the property list for transaction TXN_ID in PROPLIST.
    Perform temporary allocations in POOL. */
 static svn_error_t *
@@ -6475,102 +6415,6 @@
   return SVN_NO_ERROR;
 }
 
-/* The work-horse for svn_fs_fs__commit_obliteration, called with the FS write lock.
- This implements the svn_fs_fs__with_write_lock() 'body' callback
- type. BATON is a 'struct commit_baton *'. */
-static svn_error_t *
-commit_obliteration_body(void *baton, apr_pool_t *pool)
-{
- struct commit_baton *cb = baton;
- fs_fs_data_t *ffd = cb->fs->fsap_data;
- const char *old_rev_filename, *rev_filename, *proto_filename;
- const char *revprop_filename, *final_revprop;
- const svn_fs_id_t *root_id, *new_root_id;
- const char *start_node_id = NULL, *start_copy_id = NULL;
- svn_revnum_t rev = *cb->new_rev_p;
- svn_revnum_t old_rev = rev, new_rev = rev; /* ### relics of normal commit */
- apr_file_t *proto_file;
- void *proto_file_lockcookie;
- apr_off_t initial_offset, changed_path_offset;
- char *buf;
-
- /* ### Someday support obliterating packed revisions. Maybe. */
- if (is_packed_rev(cb->fs, rev))
- return svn_error_create(SVN_ERR_FS_GENERAL, NULL,
- _("Obliteration of already-packed revision "
- "is not supported"));
-
- /* Get the next node_id and copy_id to use. */
- if (ffd->format < SVN_FS_FS__MIN_NO_GLOBAL_IDS_FORMAT)
- /* ### But not like this, perhaps, for obliterate? Or, if so, then we
- * should increment and write back this info in the 'current' file as
- * the non-oblit commit does. */
- SVN_ERR(get_next_revision_ids(&start_node_id, &start_copy_id, cb->fs,
- pool));
-
- /* Get a write handle on the proto revision file. */
- SVN_ERR(get_writable_proto_rev(&proto_file, &proto_file_lockcookie,
- cb->fs, cb->txn->id, pool));
- SVN_ERR(get_file_offset(&initial_offset, proto_file, pool));
-
- /* Write out all the node-revisions and directory contents. */
- root_id = svn_fs_fs__id_txn_create("0", "0", cb->txn->id, pool);
- SVN_ERR(write_final_rev(&new_root_id, proto_file, new_rev, cb->fs, root_id,
- start_node_id, start_copy_id, initial_offset,
- cb->reps_to_cache, cb->reps_pool,
- pool));
-
- /* Write the changed-path information. */
- SVN_ERR(write_final_changed_path_info(&changed_path_offset, proto_file,
- cb->fs, cb->txn->id, pool));
-
- /* Write the final line. */
- buf = apr_psprintf(pool, "\n%" APR_OFF_T_FMT " %" APR_OFF_T_FMT "\n",
- svn_fs_fs__id_offset(new_root_id),
- changed_path_offset);
- SVN_ERR(svn_io_file_write_full(proto_file, buf, strlen(buf), NULL,
- pool));
- SVN_ERR(svn_io_file_flush_to_disk(proto_file, pool));
- SVN_ERR(svn_io_file_close(proto_file, pool));
-
- /* We don't unlock the prototype revision file immediately to avoid a
- race with another caller writing to the prototype revision file
- before we commit it. */
-
- /* Move the finished rev file into place. */
- if (is_packed_rev(cb->fs, rev))
- {
- /* ### complexity */
- SVN_ERR_MALFUNCTION();
- }
- else
- {
- SVN_ERR(svn_fs_fs__path_rev_absolute(&old_rev_filename,
- cb->fs, old_rev, pool));
- rev_filename = path_rev(cb->fs, new_rev, pool);
- proto_filename = path_txn_proto_rev(cb->fs, cb->txn->id, pool);
- SVN_ERR(move_into_place(proto_filename, rev_filename, old_rev_filename,
- pool));
- }
-
- /* Now that we've moved the prototype revision file out of the way,
- we can unlock it (since further attempts to write to the file
- will fail as it no longer exists). We must do this so that we can
- remove the transaction directory later. */
- SVN_ERR(unlock_proto_rev(cb->fs, cb->txn->id, proto_file_lockcookie, pool));
-
- /* Move the revprops file into place. */
- revprop_filename = path_txn_props(cb->fs, cb->txn->id, pool);
- final_revprop = path_revprops(cb->fs, new_rev, pool);
- SVN_ERR(move_into_place(revprop_filename, final_revprop, old_rev_filename,
- pool));
-
- /* Remove this transaction directory. */
- SVN_ERR(svn_fs_fs__purge_txn(cb->fs, cb->txn->id, pool));
-
- return SVN_NO_ERROR;
-}
-
 /* Add the representations in REPS_TO_CACHE (an array of representation_t *)
  * to the rep-cache database of FS. */
 static svn_error_t *
@@ -6648,49 +6492,7 @@
   return SVN_NO_ERROR;
 }
 
-svn_error_t *
-svn_fs_fs__commit_obliteration(svn_revnum_t rev,
- svn_fs_t *fs,
- svn_fs_txn_t *txn,
- apr_pool_t *pool)
-{
- struct commit_baton cb;
- fs_fs_data_t *ffd = fs->fsap_data;
 
- /* Analogous to svn_fs_fs__commit(). */
- cb.new_rev_p = &rev;
- cb.fs = fs;
- cb.txn = txn;
-
- if (ffd->rep_sharing_allowed)
- {
- cb.reps_to_cache = apr_array_make(pool, 5, sizeof(representation_t *));
- cb.reps_pool = pool;
- }
- else
- {
- cb.reps_to_cache = NULL;
- cb.reps_pool = NULL;
- }
-
- /* Commit the obliteration revision */
- SVN_ERR(svn_fs_fs__with_write_lock(fs, commit_obliteration_body, &cb, pool));
-
- /* TODO: Update the rep cache: in particular, delete invalid entries, and
- * ensure we will re-validate entries that may already be in pending txns. */
- if (ffd->rep_sharing_allowed)
- {
- /* ###
- * SVN_ERR(svn_fs_fs__open_rep_cache(fs, pool));
- * SVN_ERR(svn_sqlite__with_transaction(ffd->rep_cache_db,
- * commit_sqlite_txn_callback,
- * &cb, pool));
- */
- }
-
- return SVN_NO_ERROR;
-}
-
 svn_error_t *
 svn_fs_fs__reserve_copy_id(const char **copy_id_p,
                            svn_fs_t *fs,
@@ -7738,29 +7540,6 @@
   return svn_fs_fs__change_txn_props(*txn_p, props, pool);
 }
 
-svn_error_t *
-svn_fs_fs__begin_obliteration_txn(svn_fs_txn_t **txn_p,
- svn_fs_t *fs,
- svn_revnum_t replacing_rev,
- apr_pool_t *pool)
-{
- apr_array_header_t *props = apr_array_make(pool, 0, sizeof(svn_prop_t));
-
- SVN_ERR(svn_fs__check_fs(fs, TRUE));
-
- SVN_ERR(svn_fs_fs__create_obliteration_txn(txn_p, fs, replacing_rev, pool));
-
- /* ### Not sure if we need to do anything to this txn such as
- * - setting temporary txn props (as done in svn_fs_fs__begin_txn())
- * - recording its intended revision number so we can check it later */
-
- /* ### This "change txn props" call is just because if the txn props file
- * doesn't exist, a call to svn_fs_fs__txn_proplist() later fails. */
- SVN_ERR(svn_fs_fs__change_txn_props(*txn_p, props, pool));
-
- return SVN_NO_ERROR;
-}
-
 
 /****** Packing FSFS shards *********/
 
Index: subversion/libsvn_fs_fs/tree.h
===================================================================
--- subversion/libsvn_fs_fs/tree.h (revision 1090946)
+++ subversion/libsvn_fs_fs/tree.h (working copy)
@@ -47,12 +47,6 @@
                                    svn_revnum_t *new_rev, svn_fs_txn_t *txn,
                                    apr_pool_t *pool);
 
-/* Commit the transaction TXN as a replacement for revision REPLACING_REV.
- Perform temporary allocations in POOL. */
-svn_error_t *svn_fs_fs__commit_obliteration_txn(svn_revnum_t replacing_rev,
- svn_fs_txn_t *txn,
- apr_pool_t *pool);
-
 /* Set ROOT_P to the root directory of transaction TXN. Allocate the
    structure in POOL. */
 svn_error_t *svn_fs_fs__txn_root(svn_fs_root_t **root_p, svn_fs_txn_t *txn,
Index: subversion/libsvn_fs_fs/fs_fs.h
===================================================================
--- subversion/libsvn_fs_fs/fs_fs.h (revision 1090946)
+++ subversion/libsvn_fs_fs/fs_fs.h (working copy)
@@ -316,15 +316,6 @@
                                svn_fs_txn_t *txn,
                                apr_pool_t *pool);
 
-/* Commit the obliteration transaction TXN in filesystem FS for
- revision number REV. If the transaction is out of date (### meaning what?), return
- the error SVN_ERR_FS_TXN_OUT_OF_DATE. Use POOL for temporary
- allocations. */
-svn_error_t *svn_fs_fs__commit_obliteration(svn_revnum_t rev,
- svn_fs_t *fs,
- svn_fs_txn_t *txn,
- apr_pool_t *pool);
-
 /* Return the next available copy_id in *COPY_ID for the transaction
    TXN_ID in filesystem FS. Allocate space in POOL. */
 svn_error_t *svn_fs_fs__reserve_copy_id(const char **copy_id,
@@ -475,16 +466,6 @@
                                   svn_revnum_t rev, apr_uint32_t flags,
                                   apr_pool_t *pool);
 
-/* Begin a new transaction in filesystem FS, intended to replace the
- existing revision REPLACING_REV. The new transaction will be based on
- revision (REPLACING_REV - 1) but will have content identical to revision
- REPLACING_REV. Set *TXN_P to the new transaction structure, allocated
- in POOL. */
-svn_error_t *svn_fs_fs__begin_obliteration_txn(svn_fs_txn_t **txn_p,
- svn_fs_t *fs,
- svn_revnum_t replacing_rev,
- apr_pool_t *pool);
-
 /* Find the value of the property named PROPNAME in transaction TXN.
    Return the contents in *VALUE_P. The contents will be allocated
    from POOL. */
Index: subversion/libsvn_fs_fs/fs.c
===================================================================
--- subversion/libsvn_fs_fs/fs.c (revision 1090946)
+++ subversion/libsvn_fs_fs/fs.c (working copy)
@@ -149,7 +149,6 @@
   svn_fs_fs__set_uuid,
   svn_fs_fs__revision_root,
   svn_fs_fs__begin_txn,
- svn_fs_fs__begin_obliteration_txn,
   svn_fs_fs__open_txn,
   svn_fs_fs__purge_txn,
   svn_fs_fs__list_transactions,
Received on 2011-04-11 10:17:49 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.