You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/12/11 01:16:08 UTC
svn commit: r1044548 [39/39] - in /subversion/branches/ignore-mergeinfo: ./
build/ build/ac-macros/ build/generator/ build/generator/templates/
build/win32/ contrib/client-side/ contrib/hook-scripts/
contrib/server-side/ notes/api-errata/ notes/api-err...
Modified: subversion/branches/ignore-mergeinfo/subversion/tests/libsvn_wc/pristine-store-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/tests/libsvn_wc/pristine-store-test.c?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/tests/libsvn_wc/pristine-store-test.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/tests/libsvn_wc/pristine-store-test.c Sat Dec 11 00:15:55 2010
@@ -40,6 +40,8 @@
#include "svn_wc.h"
#include "svn_client.h"
+#include "utils.h"
+
#include "../../libsvn_wc/wc.h"
#include "../../libsvn_wc/wc_db.h"
#include "../../libsvn_wc/wc-queries.h"
@@ -48,18 +50,9 @@
#include "private/svn_wc_private.h"
#include "../svn_test.h"
-#include "../svn_test_fs.h"
-
-#define REPOSITORIES_WORK_DIR "svn-test-work/repositories"
-#define WCS_WORK_DIR "svn-test-work/working-copies"
-/* Create an empty repository and WC for the test TEST_NAME, and open a WC
- * DB context. Set *REPOS_URL to the URL of the new repository, *WC_ABSPATH
- * to the root path of the new WC, and *DB to a new DB context.
- *
- * Create the repository and WC in subdirectories called repos/TEST_NAME and
- * wcs/TEST_NAME respectively, within the current working directory. */
+/* Create repos and WC, and also set *DB to a new DB context. */
static svn_error_t *
create_repos_and_wc(const char **repos_url,
const char **wc_abspath,
@@ -68,41 +61,8 @@ create_repos_and_wc(const char **repos_u
const svn_test_opts_t *opts,
apr_pool_t *pool)
{
- const char *repos_path = svn_relpath_join(REPOSITORIES_WORK_DIR, test_name,
- pool);
- const char *wc_path = svn_relpath_join(WCS_WORK_DIR, test_name, pool);
-
- /* Remove the repo and WC dirs if they already exist, to ensure the test
- * will run even if a previous failed attempt was not cleaned up. */
- SVN_ERR(svn_io_remove_dir2(repos_path, TRUE, NULL, NULL, pool));
- SVN_ERR(svn_io_remove_dir2(wc_path, TRUE, NULL, NULL, pool));
-
- /* Create the parent dirs of the repo and WC if necessary. */
- SVN_ERR(svn_io_make_dir_recursively(REPOSITORIES_WORK_DIR, pool));
- SVN_ERR(svn_io_make_dir_recursively(WCS_WORK_DIR, pool));
-
- /* Create a repos and set *REPOS_URL to its path. */
- {
- svn_repos_t *repos;
-
- SVN_ERR(svn_test__create_repos(&repos, repos_path, opts, pool));
- SVN_ERR(svn_uri_get_file_url_from_dirent(repos_url, repos_path, pool));
- }
-
- /* Create a WC */
- {
- svn_client_ctx_t *ctx;
- svn_opt_revision_t head_rev = { svn_opt_revision_head, {0} };
-
- SVN_ERR(svn_client_create_context(&ctx, pool));
- /* SVN_ERR(svn_config_get_config(&ctx->config, config_dir, pool)); */
- SVN_ERR(svn_dirent_get_absolute(wc_abspath, wc_path, pool));
- SVN_ERR(svn_client_checkout3(NULL, *repos_url, *wc_abspath,
- &head_rev, &head_rev, svn_depth_infinity,
- FALSE /* ignore_externals */,
- FALSE /* allow_unver_obstructions */,
- ctx, pool));
- }
+ SVN_ERR(svn_test__create_repos_and_wc(repos_url, wc_abspath, test_name,
+ opts, pool));
/* Open a DB context */
SVN_ERR(svn_wc__db_open(db, svn_wc__db_openmode_readonly, NULL,
@@ -256,9 +216,7 @@ pristine_get_translated(const svn_test_o
SVN_ERR(svn_wc__db_wclock_obtain(wc_ctx->db, dirname, 0, FALSE, pool));
- SVN_ERR(svn_wc_add4(wc_ctx, versioned_abspath, svn_depth_empty,
- NULL, SVN_INVALID_REVNUM, NULL, NULL, NULL, NULL,
- pool));
+ SVN_ERR(svn_wc_add_from_disk(wc_ctx, versioned_abspath, NULL, NULL, pool));
SVN_ERR(svn_wc_prop_set4(wc_ctx, versioned_abspath,
"svn:keywords", svn_string_create("Rev", pool),
FALSE, NULL, NULL, pool));
Modified: subversion/branches/ignore-mergeinfo/subversion/tests/libsvn_wc/tree-conflict-data-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/tests/libsvn_wc/tree-conflict-data-test.c?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/tests/libsvn_wc/tree-conflict-data-test.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/tests/libsvn_wc/tree-conflict-data-test.c Sat Dec 11 00:15:55 2010
@@ -53,15 +53,14 @@ fail(apr_pool_t *pool, const char *fmt,
static svn_error_t *
test_read_tree_conflict(apr_pool_t *pool)
{
- svn_wc_conflict_description2_t *conflict;
- apr_hash_t *conflicts;
+ const svn_wc_conflict_description2_t *conflict;
svn_wc_conflict_description2_t *exp_conflict;
const char *tree_conflict_data;
- apr_hash_index_t *hi;
const char *local_abspath;
+ const svn_skel_t *skel;
- tree_conflict_data = "((conflict Foo.c file update deleted edited "
- "(version 0 2 -1 0 0 ) (version 0 2 -1 0 0 )))";
+ tree_conflict_data = "(conflict Foo.c file update deleted edited "
+ "(version 0 2 -1 0 0 ) (version 0 2 -1 0 0 ))";
SVN_ERR(svn_dirent_get_absolute(&local_abspath, "Foo.c", pool));
exp_conflict = svn_wc_conflict_description_create_tree2(
@@ -70,11 +69,8 @@ test_read_tree_conflict(apr_pool_t *pool
exp_conflict->action = svn_wc_conflict_action_delete;
exp_conflict->reason = svn_wc_conflict_reason_edited;
- SVN_ERR(svn_wc__read_tree_conflicts(&conflicts, tree_conflict_data, "",
- pool));
-
- hi = apr_hash_first(pool, conflicts);
- conflict = svn__apr_hash_index_val(hi);
+ skel = svn_skel__parse(tree_conflict_data, strlen(tree_conflict_data), pool);
+ SVN_ERR(svn_wc__deserialize_conflict(&conflict, skel, "", pool, pool));
if ((conflict->node_kind != exp_conflict->node_kind) ||
(conflict->action != exp_conflict->action) ||
@@ -87,120 +83,13 @@ test_read_tree_conflict(apr_pool_t *pool
}
static svn_error_t *
-test_read_2_tree_conflicts(apr_pool_t *pool)
-{
- const char *tree_conflict_data;
- svn_wc_conflict_description2_t *conflict1, *conflict2;
- apr_hash_t *conflicts;
- svn_wc_conflict_description2_t *exp_conflict1, *exp_conflict2;
- apr_hash_index_t *hi;
- const char *local_abspath;
-
- tree_conflict_data =
- "((conflict Foo.c file update deleted edited "
- "(version 0 2 -1 0 0 ) (version 0 2 -1 0 0 )) "
- "(conflict Bar.h file update edited deleted "
- "(version 0 2 -1 0 0 ) (version 0 2 -1 0 0 )))";
-
- SVN_ERR(svn_dirent_get_absolute(&local_abspath, "Foo.c", pool));
- exp_conflict1 = svn_wc_conflict_description_create_tree2(
- local_abspath, svn_node_file, svn_wc_operation_update,
- NULL, NULL, pool);
- exp_conflict1->action = svn_wc_conflict_action_delete;
- exp_conflict1->reason = svn_wc_conflict_reason_edited;
-
- SVN_ERR(svn_dirent_get_absolute(&local_abspath, "Bar.h", pool));
- exp_conflict2 = svn_wc_conflict_description_create_tree2(
- local_abspath, svn_node_file, svn_wc_operation_update,
- NULL, NULL, pool);
- exp_conflict2->action = svn_wc_conflict_action_edit;
- exp_conflict2->reason = svn_wc_conflict_reason_deleted;
-
- SVN_ERR(svn_wc__read_tree_conflicts(&conflicts, tree_conflict_data, "",
- pool));
-
- hi = apr_hash_first(pool, conflicts);
- conflict1 = svn__apr_hash_index_val(hi);
- if ((conflict1->node_kind != exp_conflict1->node_kind) ||
- (conflict1->action != exp_conflict1->action) ||
- (conflict1->reason != exp_conflict1->reason) ||
- (conflict1->operation != exp_conflict1->operation) ||
- (strcmp(conflict1->local_abspath, exp_conflict1->local_abspath) != 0))
- return fail(pool, "Tree conflict struct #1 has bad data");
-
- hi = apr_hash_next(hi);
- conflict2 = svn__apr_hash_index_val(hi);
- if ((conflict2->node_kind != exp_conflict2->node_kind) ||
- (conflict2->action != exp_conflict2->action) ||
- (conflict2->reason != exp_conflict2->reason) ||
- (conflict2->operation != exp_conflict2->operation) ||
- (strcmp(conflict2->local_abspath, exp_conflict2->local_abspath) != 0))
- return fail(pool, "Tree conflict struct #2 has bad data");
-
- return SVN_NO_ERROR;
-}
-
-/* This needs to be adjusted in case the constants for the
- * delimiters change... */
-static const char* broken_tree_conflict_test_data[] = {
- /* Missing descriptions */
- "|Bar.h:file:update:edited:deleted::::::::",
- "Foo.c:file:update:deleted:edited::::::::|",
- "|||||||",
- "",
- /* Missing fields */
- "Foo.c:fileupdate:deleted:edited::::::::",
- "Foo.c",
- "::::",
- ":::",
- "Foo.c:::::::::::::;",
- /* Bad separators */
- "Foo.c:file:update:deleted:edited::::::::$Bar.h:file:update:edited:deleted::::::::",
- "Foo.c|file|update|deleted|edited:::::::::Bar.h|file|update|edited|deleted::::::::",
- /* Missing separators */
- "Foo.c:file:update:deleted:edited::::::::Bar.h:file:update:edited:deleted::::::::",
- "Foo.c:fileupdate:deleted:edited::::::::",
- /* Unescaped separators */
- "F|oo.c:file:update:deleted:edited::::::::",
- "F:oo.c:file:update:deleted:edited::::::::",
- /* Unescaped escape */
- "Foo.c\\:file:update:deleted:edited::::::::",
- "Foo.c\\",
- /* Illegally escaped char */
- "\\Foo.c:file:update:deleted:edited::::::::",
- NULL
-};
-
-static svn_error_t *
-test_read_invalid_tree_conflicts(apr_pool_t *pool)
-{
- int i;
- const char *tree_conflict_data;
- apr_hash_t *conflicts;
- svn_error_t *err;
-
- for (i = 0; broken_tree_conflict_test_data[i] != NULL; i++)
- {
- tree_conflict_data = broken_tree_conflict_test_data[i];
- err = svn_wc__read_tree_conflicts(&conflicts, tree_conflict_data, "",
- pool);
- if (err == SVN_NO_ERROR)
- return fail(pool,
- "Error in broken tree conflict data was not detected:\n"
- " %s", tree_conflict_data);
- svn_error_clear(err);
- }
- return SVN_NO_ERROR;
-}
-
-static svn_error_t *
test_write_tree_conflict(apr_pool_t *pool)
{
svn_wc_conflict_description2_t *conflict;
const char *tree_conflict_data;
- apr_hash_t *conflicts;
const char *expected;
const char *local_abspath;
+ svn_skel_t *skel;
SVN_ERR(svn_dirent_get_absolute(&local_abspath, "Foo.c", pool));
@@ -210,14 +99,11 @@ test_write_tree_conflict(apr_pool_t *poo
conflict->action = svn_wc_conflict_action_delete;
conflict->reason = svn_wc_conflict_reason_edited;
- conflicts = apr_hash_make(pool);
- apr_hash_set(conflicts, conflict->local_abspath, APR_HASH_KEY_STRING,
- conflict);
-
- expected = "((conflict Foo.c file update deleted edited "
- "(version 0 2 -1 0 0 ) (version 0 2 -1 0 0 )))";
+ SVN_ERR(svn_wc__serialize_conflict(&skel, conflict, pool, pool));
+ tree_conflict_data = svn_skel__unparse(skel, pool)->data;
- SVN_ERR(svn_wc__write_tree_conflicts(&tree_conflict_data, conflicts, pool));
+ expected = "(conflict Foo.c file update deleted edited "
+ "(version 0 2 -1 0 0 ) (version 0 2 -1 0 0 ))";
if (strcmp(expected, tree_conflict_data) != 0)
return fail(pool, "Unexpected text from tree conflict\n"
@@ -227,60 +113,6 @@ test_write_tree_conflict(apr_pool_t *poo
return SVN_NO_ERROR;
}
-static svn_error_t *
-test_write_2_tree_conflicts(apr_pool_t *pool)
-{
- svn_wc_conflict_description2_t *conflict1, *conflict2;
- apr_hash_t *conflicts;
- const char *tree_conflict_data;
- const char *expected1;
- const char *expected2;
- const char *local_abspath;
-
- SVN_ERR(svn_dirent_get_absolute(&local_abspath, "Foo.c", pool));
- conflict1 = svn_wc_conflict_description_create_tree2(
- local_abspath, svn_node_file, svn_wc_operation_update,
- NULL, NULL, pool);
- conflict1->action = svn_wc_conflict_action_delete;
- conflict1->reason = svn_wc_conflict_reason_edited;
-
- SVN_ERR(svn_dirent_get_absolute(&local_abspath, "Bar.h", pool));
- conflict2 = svn_wc_conflict_description_create_tree2(
- local_abspath, svn_node_file, svn_wc_operation_update,
- NULL, NULL, pool);
- conflict2->action = svn_wc_conflict_action_edit;
- conflict2->reason = svn_wc_conflict_reason_deleted;
-
- conflicts = apr_hash_make(pool);
- apr_hash_set(conflicts, conflict1->local_abspath, APR_HASH_KEY_STRING,
- conflict1);
- apr_hash_set(conflicts, conflict2->local_abspath, APR_HASH_KEY_STRING,
- conflict2);
-
- /* We don't know the order the hash will spit out the data, so just test
- for both possibilities. */
- expected1 = "((conflict Foo.c file update deleted edited "
- "(version 0 2 -1 0 0 ) (version 0 2 -1 0 0 )) "
- "(conflict Bar.h file update edited deleted "
- "(version 0 2 -1 0 0 ) (version 0 2 -1 0 0 )))";
- expected2 = "((conflict Bar.h file update edited deleted "
- "(version 0 2 -1 0 0 ) (version 0 2 -1 0 0 )) "
- "(conflict Foo.c file update deleted edited "
- "(version 0 2 -1 0 0 ) (version 0 2 -1 0 0 )))";
-
- SVN_ERR(svn_wc__write_tree_conflicts(&tree_conflict_data, conflicts, pool));
-
- if (strcmp(expected1, tree_conflict_data) != 0
- && strcmp(expected2, tree_conflict_data) != 0)
- return fail(pool, "Unexpected text from tree conflict\n"
- " Expected: %s\n"
- " OR %s\n"
- " Actual: %s\n", expected1, expected2,
- tree_conflict_data);
-
- return SVN_NO_ERROR;
-}
-
#ifdef THIS_TEST_RAISES_MALFUNCTION
static svn_error_t *
test_write_invalid_tree_conflicts(apr_pool_t *pool)
@@ -380,14 +212,8 @@ struct svn_test_descriptor_t test_funcs[
SVN_TEST_NULL,
SVN_TEST_PASS2(test_read_tree_conflict,
"read 1 tree conflict"),
- SVN_TEST_PASS2(test_read_2_tree_conflicts,
- "read 2 tree conflicts"),
- SVN_TEST_XFAIL2(test_read_invalid_tree_conflicts,
- "detect broken tree conflict data"),
SVN_TEST_PASS2(test_write_tree_conflict,
"write 1 tree conflict"),
- SVN_TEST_PASS2(test_write_2_tree_conflicts,
- "write 2 tree conflicts"),
#ifdef THIS_TEST_RAISES_MALFUNCTION
SVN_TEST_PASS2(test_write_invalid_tree_conflicts,
"detect broken tree conflict data while writing"),
Modified: subversion/branches/ignore-mergeinfo/subversion/tests/svn_test_main.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/tests/svn_test_main.c?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/tests/svn_test_main.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/tests/svn_test_main.c Sat Dec 11 00:15:55 2010
@@ -191,9 +191,12 @@ do_test_num(const char *progname,
svn_boolean_t test_failed;
const char *msg = NULL; /* the message this individual test prints out */
const struct svn_test_descriptor_t *desc;
+ const int array_size = get_array_size();
/* Check our array bounds! */
- if ((test_num > get_array_size()) || (test_num <= 0))
+ if (test_num < 0)
+ test_num += array_size + 1;
+ if ((test_num > array_size) || (test_num <= 0))
{
printf("FAIL: %s: THERE IS NO TEST NUMBER %2d\n", progname, test_num);
skip_cleanup = TRUE;
@@ -279,7 +282,6 @@ int
main(int argc, const char *argv[])
{
const char *prog_name;
- int test_num;
int i;
svn_boolean_t got_error = FALSE;
apr_pool_t *pool, *test_pool;
@@ -425,10 +427,14 @@ main(int argc, const char *argv[])
{
for (i = 1; i < argc; i++)
{
- if (svn_ctype_isdigit(argv[i][0]))
+ if (svn_ctype_isdigit(argv[i][0]) || argv[i][0] == '-')
{
+ int test_num = atoi(argv[i]);
+ if (test_num == 0)
+ /* A --option argument, most likely. */
+ continue;
+
ran_a_test = TRUE;
- test_num = atoi(argv[i]);
if (do_test_num(prog_name, test_num, FALSE, &opts, test_pool))
got_error = TRUE;
@@ -458,6 +464,5 @@ main(int argc, const char *argv[])
svn_pool_destroy(pool); /* takes test_pool with it */
apr_terminate();
- exit(got_error);
return got_error;
}
Modified: subversion/branches/ignore-mergeinfo/tools/client-side/svnmucc/svnmucc-test.py
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/tools/client-side/svnmucc/svnmucc-test.py?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/tools/client-side/svnmucc/svnmucc-test.py (original)
+++ subversion/branches/ignore-mergeinfo/tools/client-side/svnmucc/svnmucc-test.py Sat Dec 11 00:15:55 2010
@@ -34,6 +34,10 @@ this_dir = os.path.dirname(os.path.abspa
sys.path.insert(0, '%s/../../../subversion/tests/cmdline' % (this_dir))
import svntest
+# setup the global 'svntest.main.options' object so functions in the
+# module don't freak out.
+svntest.main._parse_options(arglist=[])
+
# calculate the top of the build tree
if len(sys.argv) > 1:
build_top = os.path.abspath(sys.argv[1])
@@ -275,6 +279,20 @@ def main():
run_svnmucc(['M /foo/bar'], #---------
'propdel', 'testprop', 'foo/bar')
+ # revision 18
+ run_svnmucc(['M /foo/z.c',
+ 'M /foo/foo',
+ ], #---------
+ 'propset', 'testprop', 'true', 'foo/z.c',
+ 'propset', 'testprop', 'true', 'foo/foo')
+
+ # revision 19
+ run_svnmucc(['M /foo/z.c',
+ 'M /foo/foo',
+ ], #---------
+ 'propsetf', 'testprop', sys.argv[0], 'foo/z.c',
+ 'propsetf', 'testprop', sys.argv[0], 'foo/foo')
+
# Expected missing revision error
xrun_svnmucc(['svnmucc: \'a\' is not a revision'
], #---------
Modified: subversion/branches/ignore-mergeinfo/tools/client-side/svnmucc/svnmucc.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/tools/client-side/svnmucc/svnmucc.c?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/tools/client-side/svnmucc/svnmucc.c (original)
+++ subversion/branches/ignore-mergeinfo/tools/client-side/svnmucc/svnmucc.c Sat Dec 11 00:15:55 2010
@@ -141,6 +141,7 @@ typedef enum {
ACTION_MKDIR,
ACTION_CP,
ACTION_PROPSET,
+ ACTION_PROPSETF,
ACTION_PROPDEL,
ACTION_PUT,
ACTION_RM
@@ -161,41 +162,60 @@ struct operation {
const char *url; /* to copy, valid for add and replace */
const char *src_file; /* for put, the source file for contents */
apr_hash_t *children; /* const char *path -> struct operation * */
- apr_table_t *props; /* const char *prop_name -> const char *prop_value */
+ apr_hash_t *prop_mods; /* const char *prop_name ->
+ const svn_string_t *prop_value */
+ apr_array_header_t *prop_dels; /* const char *prop_name deletions */
void *baton; /* as returned by the commit editor */
};
-/* State to be passed to set_props iterator */
-struct driver_state {
- const svn_delta_editor_t *editor;
- svn_node_kind_t kind;
- apr_pool_t *pool;
- void *baton;
- svn_error_t* err;
-};
-
-
/* An iterator (for use via apr_table_do) which sets node properties.
REC is a pointer to a struct driver_state. */
-static int
-set_props(void *rec, const char *key, const char *value)
+static svn_error_t *
+change_props(const svn_delta_editor_t *editor,
+ void *baton,
+ struct operation *child,
+ apr_pool_t *pool)
{
- struct driver_state *d_state = (struct driver_state*)rec;
- svn_string_t *value_svnstring
- = value ? svn_string_create(value, d_state->pool) : NULL;
-
- if (d_state->kind == svn_node_dir)
- d_state->err = d_state->editor->change_dir_prop(d_state->baton, key,
- value_svnstring,
- d_state->pool);
- else
- d_state->err = d_state->editor->change_file_prop(d_state->baton, key,
- value_svnstring,
- d_state->pool);
- if (d_state->err)
- return 0;
- return 1;
+ apr_pool_t *iterpool = svn_pool_create(pool);
+
+ if (child->prop_dels)
+ {
+ int i;
+ for (i = 0; i < child->prop_dels->nelts; i++)
+ {
+ const char *prop_name;
+
+ svn_pool_clear(iterpool);
+ prop_name = APR_ARRAY_IDX(child->prop_dels, i, const char *);
+ if (child->kind == svn_node_dir)
+ SVN_ERR(editor->change_dir_prop(baton, prop_name,
+ NULL, iterpool));
+ else
+ SVN_ERR(editor->change_file_prop(baton, prop_name,
+ NULL, iterpool));
+ }
+ }
+ if (apr_hash_count(child->prop_mods))
+ {
+ apr_hash_index_t *hi;
+ for (hi = apr_hash_first(pool, child->prop_mods);
+ hi; hi = apr_hash_next(hi))
+ {
+ const void *key;
+ void *val;
+
+ svn_pool_clear(iterpool);
+ apr_hash_this(hi, &key, NULL, &val);
+ if (child->kind == svn_node_dir)
+ SVN_ERR(editor->change_dir_prop(baton, key, val, iterpool));
+ else
+ SVN_ERR(editor->change_file_prop(baton, key, val, iterpool));
+ }
+ }
+
+ svn_pool_destroy(iterpool);
+ return SVN_NO_ERROR;
}
@@ -209,7 +229,7 @@ drive(struct operation *operation,
{
apr_pool_t *subpool = svn_pool_create(pool);
apr_hash_index_t *hi;
- struct driver_state state;
+
for (hi = apr_hash_first(pool, operation->children);
hi; hi = apr_hash_next(hi))
{
@@ -228,7 +248,7 @@ drive(struct operation *operation,
SVN_ERR(editor->delete_entry(key, head, operation->baton, subpool));
}
/* Opens could be for directories or files. */
- if (child->operation == OP_OPEN)
+ if (child->operation == OP_OPEN || child->operation == OP_PROPSET)
{
if (child->kind == svn_node_dir)
{
@@ -242,8 +262,7 @@ drive(struct operation *operation,
}
}
/* Adds and replacements could also be for directories or files. */
- if (child->operation == OP_ADD || child->operation == OP_REPLACE
- || child->operation == OP_PROPSET)
+ if (child->operation == OP_ADD || child->operation == OP_REPLACE)
{
if (child->kind == svn_node_dir)
{
@@ -288,15 +307,9 @@ drive(struct operation *operation,
then close it. */
if (file_baton)
{
- if ((child->kind == svn_node_file)
- && (! apr_is_empty_table(child->props)))
+ if (child->kind == svn_node_file)
{
- state.baton = file_baton;
- state.pool = subpool;
- state.editor = editor;
- state.kind = child->kind;
- if (! apr_table_do(set_props, &state, child->props, NULL))
- SVN_ERR(state.err);
+ SVN_ERR(change_props(editor, file_baton, child, subpool));
}
SVN_ERR(editor->close_file(file_baton, NULL, subpool));
}
@@ -308,15 +321,9 @@ drive(struct operation *operation,
|| child->operation == OP_REPLACE))
{
SVN_ERR(drive(child, head, editor, subpool));
- if ((child->kind == svn_node_dir)
- && (! apr_is_empty_table(child->props)))
+ if (child->kind == svn_node_dir)
{
- state.baton = child->baton;
- state.pool = subpool;
- state.editor = editor;
- state.kind = child->kind;
- if (! apr_table_do(set_props, &state, child->props, NULL))
- SVN_ERR(state.err);
+ SVN_ERR(change_props(editor, child->baton, child, subpool));
}
SVN_ERR(editor->close_directory(child->baton, subpool));
}
@@ -344,7 +351,8 @@ get_operation(const char *path,
child->operation = OP_OPEN;
child->rev = SVN_INVALID_REVNUM;
child->kind = svn_node_dir;
- child->props = apr_table_make(pool, 0);
+ child->prop_mods = apr_hash_make(pool);
+ child->prop_dels = apr_array_make(pool, 1, sizeof(const char *));
apr_hash_set(operation->children, path, APR_HASH_KEY_STRING, child);
}
return child;
@@ -383,7 +391,7 @@ build(action_code_t action,
const char *url,
svn_revnum_t rev,
const char *prop_name,
- const char *prop_value,
+ const svn_string_t *prop_value,
const char *src_file,
svn_revnum_t head,
const char *anchor,
@@ -434,17 +442,26 @@ build(action_code_t action,
return svn_error_createf(SVN_ERR_BAD_URL, NULL,
"cannot set properties on a location being"
" deleted ('%s')", path);
- SVN_ERR(svn_ra_check_path(session,
- copy_src ? copy_src : path,
- copy_src ? copy_rev : head,
- &operation->kind, pool));
- if (operation->kind == svn_node_none)
- return svn_error_createf(SVN_ERR_BAD_URL, NULL,
- "propset: '%s' not found", path);
- else if ((operation->kind == svn_node_file)
- && (operation->operation == OP_OPEN))
- operation->operation = OP_PROPSET;
- apr_table_set(operation->props, prop_name, prop_value);
+ /* If we're not adding this thing ourselves, check for existence. */
+ if (! ((operation->operation == OP_ADD) ||
+ (operation->operation == OP_REPLACE)))
+ {
+ SVN_ERR(svn_ra_check_path(session,
+ copy_src ? copy_src : path,
+ copy_src ? copy_rev : head,
+ &operation->kind, pool));
+ if (operation->kind == svn_node_none)
+ return svn_error_createf(SVN_ERR_BAD_URL, NULL,
+ "propset: '%s' not found", path);
+ else if ((operation->kind == svn_node_file)
+ && (operation->operation == OP_OPEN))
+ operation->operation = OP_PROPSET;
+ }
+ if (! prop_value)
+ APR_ARRAY_PUSH(operation->prop_dels, const char *) = prop_name;
+ else
+ apr_hash_set(operation->prop_mods, prop_name,
+ APR_HASH_KEY_STRING, prop_value);
if (!operation->rev)
operation->rev = rev;
return SVN_NO_ERROR;
@@ -587,7 +604,7 @@ struct action {
/* property name/value */
const char *prop_name;
- const char *prop_value;
+ const svn_string_t *prop_value;
};
static svn_error_t *
@@ -680,6 +697,9 @@ execute(const apr_array_header_t *action
action->prop_name, action->prop_value,
NULL, head, anchor, session, &root, pool));
break;
+ case ACTION_PROPSETF:
+ default:
+ SVN_ERR_MALFUNCTION_NO_RETURN();
}
}
@@ -696,6 +716,23 @@ execute(const apr_array_header_t *action
return err;
}
+static svn_error_t *
+read_propvalue_file(const svn_string_t **value_p,
+ const char *filename,
+ apr_pool_t *pool)
+{
+ svn_stringbuf_t *value;
+ apr_pool_t *scratch_pool = svn_pool_create(pool);
+ apr_file_t *f;
+
+ SVN_ERR(svn_io_file_open(&f, filename, APR_READ | APR_BINARY | APR_BUFFERED,
+ APR_OS_DEFAULT, scratch_pool));
+ SVN_ERR(svn_stringbuf_from_aprfile(&value, f, scratch_pool));
+ *value_p = svn_string_create_from_buf(value, pool);
+ svn_pool_destroy(scratch_pool);
+ return SVN_NO_ERROR;
+}
+
static void
usage(apr_pool_t *pool, int exit_val)
{
@@ -711,6 +748,7 @@ usage(apr_pool_t *pool, int exit_val)
" put SRC-FILE URL add or modify file URL with contents copied from\n"
" SRC-FILE (use \"-\" to read from standard input)\n"
" propset NAME VAL URL set property NAME on URL to value VAL\n"
+ " propsetf NAME VAL URL set property NAME on URL to value from file VAL\n"
" propdel NAME URL delete property NAME from URL\n"
"\nOptions:\n"
" -h, --help display this text\n"
@@ -907,6 +945,8 @@ main(int argc, const char **argv)
action->action = ACTION_PUT;
else if (! strcmp(action_string, "propset"))
action->action = ACTION_PROPSET;
+ else if (! strcmp(action_string, "propsetf"))
+ action->action = ACTION_PROPSETF;
else if (! strcmp(action_string, "propdel"))
action->action = ACTION_PROPDEL;
else
@@ -952,9 +992,10 @@ main(int argc, const char **argv)
insufficient(pool);
}
- /* For propset and propdel, a property name (and maybe value)
- comes next. */
+ /* For propset, propsetf, and propdel, a property name (and
+ maybe a property value or file which contains one) comes next. */
if ((action->action == ACTION_PROPSET)
+ || (action->action == ACTION_PROPSETF)
|| (action->action == ACTION_PROPDEL))
{
action->prop_name = APR_ARRAY_IDX(action_args, i, const char *);
@@ -965,11 +1006,28 @@ main(int argc, const char **argv)
{
action->prop_value = NULL;
}
+ else if (action->action == ACTION_PROPSET)
+ {
+ action->prop_value =
+ svn_string_create(APR_ARRAY_IDX(action_args, i,
+ const char *), pool);
+ if (++i == action_args->nelts)
+ insufficient(pool);
+ }
else
{
- action->prop_value = APR_ARRAY_IDX(action_args, i, const char *);
+ const char *propval_file =
+ svn_path_canonicalize(APR_ARRAY_IDX(action_args, i,
+ const char *), pool);
+
if (++i == action_args->nelts)
insufficient(pool);
+
+ err = read_propvalue_file(&(action->prop_value), propval_file, pool);
+ if (err)
+ handle_error(err, pool);
+
+ action->action = ACTION_PROPSET;
}
}
@@ -978,6 +1036,7 @@ main(int argc, const char **argv)
|| action->action == ACTION_MKDIR
|| action->action == ACTION_PUT
|| action->action == ACTION_PROPSET
+ || action->action == ACTION_PROPSETF /* shouldn't see this one */
|| action->action == ACTION_PROPDEL)
num_url_args = 1;
else
@@ -1027,9 +1086,11 @@ main(int argc, const char **argv)
svn_string_create("committed using svnmucc", pool));
}
else
- /* -F or -m specified; use that even if --with-revprop=svn:log. */
- apr_hash_set(revprops, SVN_PROP_REVISION_LOG, APR_HASH_KEY_STRING,
- svn_string_create(message, pool));
+ {
+ /* -F or -m specified; use that even if --with-revprop=svn:log. */
+ apr_hash_set(revprops, SVN_PROP_REVISION_LOG, APR_HASH_KEY_STRING,
+ svn_string_create(message, pool));
+ }
if ((err = execute(actions, anchor, revprops, username, password,
config_dir, non_interactive, base_revision, pool)))
Modified: subversion/branches/ignore-mergeinfo/tools/dev/contribulyze.py
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/tools/dev/contribulyze.py?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/tools/dev/contribulyze.py (original)
+++ subversion/branches/ignore-mergeinfo/tools/dev/contribulyze.py Sat Dec 11 00:15:55 2010
@@ -28,8 +28,9 @@
#
# Some Subversion project log messages include parseable data to help
# track who's contributing what. The exact syntax is described in
-# hacking.html#crediting, but here's an example, indented by three
-# spaces, i.e., the "Patch by:" starts at the beginning of a line:
+# http://subversion.apache.org/docs/community-guide/conventions.html#crediting,
+# but here's an example, indented by three spaces, i.e., the "Patch by:"
+# starts at the beginning of a line:
#
# Patch by: David Anderson <da...@calixo.net>
# <ju...@erenkrantz.com>
Modified: subversion/branches/ignore-mergeinfo/tools/dev/unix-build/Makefile.svn
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/tools/dev/unix-build/Makefile.svn?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/tools/dev/unix-build/Makefile.svn (original)
+++ subversion/branches/ignore-mergeinfo/tools/dev/unix-build/Makefile.svn Sat Dec 11 00:15:55 2010
@@ -8,6 +8,7 @@ ENABLE_RUBY_BINDINGS ?= yes
ENABLE_PERL_BINDINGS ?= yes
ENABLE_JAVA_BINDINGS ?= no # they don't build with thread-less APR...
USE_APR_ICONV ?= no # set to yes to use APR iconv instead of GNU iconv
+PARALLEL ?= PARALLEL=1 CLEANUP=1
PWD = $(shell pwd)
UNAME = $(shell uname)
@@ -29,8 +30,8 @@ DISTDIR = $(PWD)/distfiles
SRCDIR = $(PWD)/src
OBJDIR = $(PWD)/objdir
-BDB_MAJOR_VER = 4.8
-BDB_VER = $(BDB_MAJOR_VER).30
+BDB_MAJOR_VER = 4.7
+BDB_VER = $(BDB_MAJOR_VER).25
APR_VER = 1.4.2
APR_ICONV_VER = 1.2.1
GNU_ICONV_VER = 1.13.1
@@ -38,6 +39,7 @@ APR_UTIL_VER = 1.3.9
HTTPD_VER = 2.2.15
NEON_VER = 0.29.3
SERF_VER = 0.7.x
+SERF_OLD_VER = 0.3.1
CYRUS_SASL_VER = 2.1.23
SQLITE_VER = 3.6.23.1
@@ -45,7 +47,6 @@ BDB_DIST = db-$(BDB_VER).tar.gz
APR_ICONV_DIST = apr-iconv-$(APR_ICONV_VER).tar.gz
GNU_ICONV_DIST = libiconv-$(GNU_ICONV_VER).tar.gz
NEON_DIST = neon-$(NEON_VER).tar.gz
-#SERF_DIST = serf-$(SERF_VER).tar.gz
SQLITE_DIST = sqlite-$(SQLITE_VER).tar.gz
CYRUS_SASL_DIST = cyrus-sasl-$(CYRUS_SASL_VER).tar.gz
HTTPD_DIST = httpd-$(HTTPD_VER).tar.bz2
@@ -70,6 +71,7 @@ HTTPD_URL = http://archive.apache.org/di
NEON_URL = http://webdav.org/neon/$(NEON_DIST)
#SERF_URL = http://serf.googlecode.com/files/$(SERF_DIST)
SERF_URL = http://serf.googlecode.com/svn/branches/$(SERF_VER)
+SERF_OLD_URL = http://serf.googlecode.com/svn/tags/$(SERF_OLD_VER)
SQLITE_URL = http://www.sqlite.org/$(SQLITE_DIST)
CYRUS_SASL_URL = ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/$(CYRUS_SASL_DIST)
@@ -81,6 +83,7 @@ APR_UTIL_SRCDIR = $(SRCDIR)/apr-util-$(A
HTTPD_SRCDIR = $(SRCDIR)/httpd-$(HTTPD_VER)
NEON_SRCDIR = $(SRCDIR)/neon-$(NEON_VER)
SERF_SRCDIR = $(SRCDIR)/serf-$(SERF_VER)
+SERF_OLD_SRCDIR = $(SRCDIR)/serf-$(SERF_OLD_VER)
SQLITE_SRCDIR = $(SRCDIR)/sqlite-$(SQLITE_VER)
CYRUS_SASL_SRCDIR = $(SRCDIR)/cyrus-sasl-$(CYRUS_SASL_VER)
SVN_SRCDIR = $(SVN_WC)
@@ -93,6 +96,7 @@ APR_UTIL_OBJDIR = $(OBJDIR)/apr-util-$(A
HTTPD_OBJDIR = $(OBJDIR)/httpd-$(HTTPD_VER)
NEON_OBJDIR = $(OBJDIR)/neon-$(NEON_VER)
SERF_OBJDIR = $(OBJDIR)/serf-$(SERF_VER)
+SERF_OLD_OBJDIR = $(OBJDIR)/serf-$(SERF_OLD_VER)
SQLITE_OBJDIR = $(OBJDIR)/sqlite-$(SQLITE_VER)
CYRUS_SASL_OBJDIR = $(OBJDIR)/cyrus-sasl-$(CYRUS_SASL_VER)
SVN_OBJDIR = $(OBJDIR)/$(SVN_REL_WC)
@@ -102,6 +106,10 @@ SVN_OBJDIR = $(OBJDIR)/$(SVN_REL_WC)
# builds!
svn_builddir ?=$(SVN_WC)
+ifdef PROFILE
+PROFILE_CFLAGS=-pg
+endif
+
#######################################################################
# Main targets.
#######################################################################
@@ -109,17 +117,18 @@ svn_builddir ?=$(SVN_WC)
.PHONY: all reset clean nuke
all: dirs-create bdb-install apr-install iconv-install apr-util-install \
- httpd-install neon-install serf-install sqlite-install \
- cyrus-sasl-install svn-install svn-bindings-install
+ httpd-install neon-install serf-install serf-old-install \
+ sqlite-install cyrus-sasl-install svn-install svn-bindings-install
# Use these to start a build from the beginning.
reset: dirs-reset bdb-reset apr-reset iconv-reset apr-util-reset \
- httpd-reset neon-reset serf-reset sqlite-reset cyrus-sasl-reset \
- svn-reset
+ httpd-reset neon-reset serf-reset serf-old-reset sqlite-reset \
+ cyrus-sasl-reset svn-reset
-# Use to save disc space.
+# Use to save disk space.
clean: bdb-clean apr-clean iconv-clean apr-util-clean httpd-clean \
- neon-clean serf-clean cyrus-sasl-clean svn-clean
+ neon-clean serf-clean serf-old-clean sqlite-clean cyrus-sasl-clean \
+ svn-clean
# Nukes everything (including installed binaries!)
# Use this to start ALL OVER AGAIN! Use with caution!
@@ -186,7 +195,8 @@ $(BDB_OBJDIR)/.retrieved: $(DISTDIR)/$(B
# configure bdb
$(BDB_OBJDIR)/.configured: $(BDB_OBJDIR)/.retrieved
cd $(BDB_SRCDIR)/build_unix \
- && env CFLAGS="-g" ../dist/configure \
+ && env CFLAGS="-g $(PROFILE_CFLAGS)" \
+ ../dist/configure \
--prefix=$(PREFIX)/bdb \
--enable-debug
touch $@
@@ -224,6 +234,12 @@ $(APR_OBJDIR)/.retrieved:
fi
touch $@
+ifdef THREADING
+THREADS_FLAG=--enable-threads
+else
+THREADS_FLAG=--disable-threads
+endif
+
# configure apr
$(APR_OBJDIR)/.configured: $(APR_OBJDIR)/.retrieved
cp $(APR_SRCDIR)/build/apr_hints.m4 \
@@ -233,10 +249,11 @@ $(APR_OBJDIR)/.configured: $(APR_OBJDIR)
> $(APR_SRCDIR)/build/apr_hints.m4
cd $(APR_SRCDIR) && ./buildconf
cd $(APR_OBJDIR) \
- && env CFLAGS="-O0 -g" $(APR_SRCDIR)/configure \
+ && env CFLAGS="-O0 -g $(PROFILE_CFLAGS)" \
+ $(APR_SRCDIR)/configure \
--prefix=$(PREFIX)/apr \
--enable-maintainer-mode \
- --disable-threads
+ $(THREADS_FLAG)
touch $@
# compile apr
@@ -277,7 +294,8 @@ $(APR_ICONV_OBJDIR)/.retrieved: $(DISTDI
# configure apr-iconv
$(APR_ICONV_OBJDIR)/.configured: $(APR_ICONV_OBJDIR)/.retrieved
cd $(APR_ICONV_OBJDIR) \
- && env CFLAGS="-g" $(APR_ICONV_SRCDIR)/configure \
+ && env CFLAGS="-g $(PROFILE_CFLAGS)" \
+ $(APR_ICONV_SRCDIR)/configure \
--prefix=$(PREFIX)/apr \
--with-apr=$(PREFIX)/apr
touch $@
@@ -285,7 +303,7 @@ $(APR_ICONV_OBJDIR)/.configured: $(APR_I
# compile apr-iconv
$(APR_ICONV_OBJDIR)/.compiled: $(APR_ICONV_OBJDIR)/.configured
(cd $(APR_ICONV_OBJDIR) \
- && make CPPFLAGS="-D_OSD_POSIX" CFLAGS="-g -O0")
+ && make CPPFLAGS="-D_OSD_POSIX" CFLAGS="-g -O0 $(PROFILE_CFLAGS)")
touch $@
# install apr-iconv
@@ -356,7 +374,8 @@ $(GNU_ICONV_OBJDIR)/.configured: $(GNU_I
cd $(SRCDIR)/libiconv-${GNU_ICONV_VER} && \
${MAKE} -f Makefile.devel lib/aliases.h
cd $(GNU_ICONV_OBJDIR) \
- && env CFLAGS="-g" $(GNU_ICONV_SRCDIR)/configure \
+ && env CFLAGS="-g $(PROFILE_CFLAGS)" \
+ $(GNU_ICONV_SRCDIR)/configure \
--prefix=$(PREFIX)/iconv \
--enable-extra-encodings
touch $@
@@ -423,7 +442,7 @@ $(APR_UTIL_OBJDIR)/.configured: $(APR_UT
cd $(APR_UTIL_SRCDIR) && ./buildconf --with-apr=$(APR_SRCDIR)
cd $(APR_UTIL_OBJDIR) \
&& env LD_LIBRARY_PATH=$(PREFIX)/bdb/lib \
- CFLAGS="-O0 -g" \
+ CFLAGS="-O0 -g $(PROFILE_CFLAGS)" \
$(APR_UTIL_SRCDIR)/configure \
--prefix=$(PREFIX)/apr \
--enable-maintainer-mode \
@@ -471,7 +490,8 @@ $(HTTPD_OBJDIR)/.retrieved: $(DISTDIR)/$
# configure httpd
$(HTTPD_OBJDIR)/.configured: $(HTTPD_OBJDIR)/.retrieved
cd $(HTTPD_OBJDIR) \
- && $(HTTPD_SRCDIR)/configure \
+ && CFLAGS="$(PROFILE_CFLAGS)" \
+ $(HTTPD_SRCDIR)/configure \
--prefix=$(PREFIX)/httpd \
--enable-maintainer-mode \
--enable-ssl \
@@ -545,12 +565,13 @@ endif
# configure neon
$(NEON_OBJDIR)/.configured: $(NEON_OBJDIR)/.retrieved
cd $(NEON_SRCDIR) && ./autogen.sh
- if [ -n "$(KRB5_CONFIG_PATH)" -a -d "$(KRB5_CONFIG_PATH)" ]; then \
+ if [ -n "$(KRB5_CONFIG_PATH)" ] && [ -d "$(KRB5_CONFIG_PATH)" ]; then \
cp $(KRB5_CONFIG_PATH)/krb5-config $(NEON_OBJDIR); \
chmod +x $(NEON_OBJDIR)/krb5-config; \
fi
cd $(NEON_OBJDIR) \
- && env CFLAGS="-g" $(NEON_SRCDIR)/configure \
+ && env CFLAGS="-g $(PROFILE_CFLAGS)" \
+ $(NEON_SRCDIR)/configure \
PATH=$(NEON_OBJDIR):$$PATH \
--prefix=$(PREFIX)/neon \
--with-ssl \
@@ -608,7 +629,8 @@ $(SERF_OBJDIR)/.retrieved:
# compile serf (serf won't compile outside its source tree)
$(SERF_OBJDIR)/.compiled: $(SERF_OBJDIR)/.retrieved
cd $(SERF_SRCDIR) && \
- env CFLAGS="-O0 -g" ./serfmake --with-apr=$(PREFIX)/apr \
+ env CFLAGS="-O0 -g $(PROFILE_CFLAGS)" \
+ ./serfmake --with-apr=$(PREFIX)/apr \
--prefix=$(PREFIX)/serf \
build
touch $@
@@ -623,6 +645,48 @@ $(SERF_OBJDIR)/.installed: $(SERF_OBJDIR
touch $@
#######################################################################
+# serf-old (compatible with Subversion 1.5)
+#######################################################################
+
+serf-old-retrieve: $(SERF_OLD_OBJDIR)/.retrieved
+serf-old-configure: $(SERF_OLD_OBJDIR)/.configured
+serf-old-compile: $(SERF_OLD_OBJDIR)/.compiled
+serf-old-install: $(SERF_OLD_OBJDIR)/.installed
+serf-old-reset:
+ $(foreach f, .retrieved .configured .compiled .installed, \
+ rm -f $(SERF_OLD_OBJDIR)/$(f);)
+
+serf-old-clean:
+ -(cd $(SERF_OLD_SRCDIR) && ./serfmake clean)
+
+# retrieve serf if not present yet
+$(SERF_OLD_OBJDIR)/.retrieved:
+ [ -d $(SERF_OLD_OBJDIR) ] || mkdir -p $(SERF_OLD_OBJDIR)
+ if [ ! -d $(SERF_OLD_SRCDIR) ]; then \
+ svn export $(SERF_OLD_URL) $(SERF_OLD_SRCDIR); \
+ fi
+ touch $@
+
+# compile serf (serf won't compile outside its source tree)
+$(SERF_OLD_OBJDIR)/.compiled: $(SERF_OLD_OBJDIR)/.retrieved
+ cd $(SERF_OLD_SRCDIR) && \
+ env CFLAGS="-O0 -g $(PROFILE_CFLAGS)" \
+ ./serfmake --with-apr=$(PREFIX)/apr \
+ --prefix=$(PREFIX)/serf-old \
+ build
+ touch $@
+
+# install serf
+$(SERF_OLD_OBJDIR)/.installed: $(SERF_OLD_OBJDIR)/.compiled
+ cd $(SERF_OLD_SRCDIR) && \
+ ./serfmake --with-apr=$(PREFIX)/apr \
+ --with-apr-util=$(PREFIX)/apr \
+ --prefix=$(PREFIX)/serf-old \
+ install
+ touch $@
+
+
+#######################################################################
# sqlite
#######################################################################
@@ -634,6 +698,9 @@ sqlite-reset:
$(foreach f, .retrieved .configured .compiled .installed, \
rm -f $(SQLITE_OBJDIR)/$(f);)
+sqlite-clean:
+ -cd $(SQLITE_OBJDIR) && make clean
+
# fetch distfile for sqlite
$(DISTDIR)/$(SQLITE_DIST):
cd $(DISTDIR) && $(FETCH_CMD) $(SQLITE_URL)
@@ -644,13 +711,20 @@ $(SQLITE_OBJDIR)/.retrieved: $(DISTDIR)/
tar -C $(SRCDIR) -zxf $(DISTDIR)/$(SQLITE_DIST)
touch $@
+ifdef THREADING
+THREADSAFE_FLAG=--enable-threadsafe
+else
+THREADSAFE_FLAG=--disable-threadsafe
+endif
+
# configure sqlite
$(SQLITE_OBJDIR)/.configured: $(SQLITE_OBJDIR)/.retrieved
cd $(SQLITE_OBJDIR) \
- && env CFLAGS="-g" $(SQLITE_SRCDIR)/configure \
+ && env CFLAGS="-g $(PROFILE_CFLAGS)" \
+ $(SQLITE_SRCDIR)/configure \
--prefix=$(PREFIX)/sqlite \
--disable-tcl \
- --disable-threadsafe
+ $(THREADSAFE_FLAG)
touch $@
# compile sqlite
@@ -676,7 +750,7 @@ cyrus-sasl-reset:
rm -f $(CYRUS_SASL_OBJDIR)/$(f);)
cyrus-sasl-clean:
- -(cd $(CYRUS_SASL_OBJDIR) && make clean)
+ -(cd $(CYRUS_SASL_OBJDIR) && make distclean)
# fetch distfile for cyrus-sasl
$(DISTDIR)/$(CYRUS_SASL_DIST):
@@ -692,12 +766,22 @@ $(CYRUS_SASL_OBJDIR)/.retrieved: $(DISTD
> $(CYRUS_SASL_SRCDIR)/plugins/digestmd5.c.patched
mv $(CYRUS_SASL_SRCDIR)/plugins/digestmd5.c.patched \
$(CYRUS_SASL_SRCDIR)/plugins/digestmd5.c
+ifeq ($(UNAME),OpenBSD)
+ # Fixes GSSAPI support on OpenBSD, which hasn't got libroken:
+ for f in `grep -l -R -- -lroken $(CYRUS_SASL_SRCDIR)`; do \
+ sed -e 's/-lroken//g' < $$f > $$f.tmp && \
+ mv $$f.tmp $$f; \
+ done
+ chmod +x $(CYRUS_SASL_SRCDIR)/configure
+endif
touch $@
# configure cyrus-sasl
$(CYRUS_SASL_OBJDIR)/.configured: $(CYRUS_SASL_OBJDIR)/.retrieved
cd $(CYRUS_SASL_OBJDIR) \
- && env CFLAGS="-g" $(CYRUS_SASL_SRCDIR)/configure \
+ && env CFLAGS="-g $(PROFILE_CFLAGS)" \
+ CPPFLAGS="-I/usr/include/kerberosV" \
+ $(CYRUS_SASL_SRCDIR)/configure \
--with-dbpath=$(PREFIX)/cyrus-sasl/etc/sasldb2 \
--with-plugindir=$(PREFIX)/cyrus-sasl/lib/sasl2 \
--with-configdir=$(PREFIX)/cyrus-sasl/lib/sasl2 \
@@ -757,7 +841,7 @@ $(SVN_OBJDIR)/.retrieved:
branchdir="$(BRANCH)"; \
co="co"; \
fi; \
- if [ ! -d $(SVN_WC) ]; then \
+ if [ ! -d $(SVN_WC) ] && [ ! -h $(SVN_WC) ]; then \
svn $${co} $(SUBVERSION_REPOS_URL)/$${branchdir} \
$(SVN_WC); \
fi
@@ -765,18 +849,40 @@ $(SVN_OBJDIR)/.retrieved:
ifeq ($(BRANCH_MAJOR),1.5)
BDB_FLAG=$(PREFIX)/bdb
+SERF_FLAG=--with-serf="$(PREFIX)/serf-old"
+MOD_DAV_SVN=modules/mod_dav_svn.so
+MOD_AUTHZ_SVN=modules/mod_authz_svn.so
+DISABLE_NEON_VERSION_CHECK=--disable-neon-version-check
else ifeq ($(BRANCH_MAJOR),1.4)
BDB_FLAG=$(PREFIX)/bdb
+MOD_DAV_SVN=modules/mod_dav_svn.so
+MOD_AUTHZ_SVN=modules/mod_authz_svn.so
+DISABLE_NEON_VERSION_CHECK=--disable-neon-version-check
else ifeq ($(BRANCH_MAJOR),1.3)
BDB_FLAG=$(PREFIX)/bdb
+MOD_DAV_SVN=modules/mod_dav_svn.so
+MOD_AUTHZ_SVN=modules/mod_authz_svn.so
+DISABLE_NEON_VERSION_CHECK=--disable-neon-version-check
else ifeq ($(BRANCH_MAJOR),1.2)
BDB_FLAG=$(PREFIX)/bdb
+MOD_DAV_SVN=modules/mod_dav_svn.so
+MOD_AUTHZ_SVN=modules/mod_authz_svn.so
+DISABLE_NEON_VERSION_CHECK=--disable-neon-version-check
else ifeq ($(BRANCH_MAJOR),1.1)
BDB_FLAG=$(PREFIX)/bdb
+MOD_DAV_SVN=modules/mod_dav_svn.so
+MOD_AUTHZ_SVN=modules/mod_authz_svn.so
+DISABLE_NEON_VERSION_CHECK=--disable-neon-version-check
else ifeq ($(BRANCH_MAJOR),1.0)
BDB_FLAG=$(PREFIX)/bdb
+MOD_DAV_SVN=modules/mod_dav_svn.so
+MOD_AUTHZ_SVN=modules/mod_authz_svn.so
+DISABLE_NEON_VERSION_CHECK=--disable-neon-version-check
else
BDB_FLAG=db.h:$(PREFIX)/bdb/include:$(PREFIX)/bdb/lib:db-$(BDB_MAJOR_VER)
+SERF_FLAG=--with-serf="$(PREFIX)/serf"
+MOD_DAV_SVN=modules/svn-$(WC)/mod_dav_svn.so
+MOD_AUTHZ_SVN=modules/svn-$(WC)/mod_authz_svn.so
endif
ifeq ($(ENABLE_JAVA_BINDINGS),yes)
@@ -786,6 +892,14 @@ else
JAVAHL_FLAG=--enable-javahl=no
endif
+ifdef PROFILE
+SVN_ALL_STATIC=--enable-all-static
+else
+SVN_WITH_HTTPD=--with-apxs="$(PREFIX)/httpd/bin/apxs" \
+ --with-apache-libexecdir="$(PREFIX)/httpd/modules/svn-$(WC)"
+SVN_WITH_SASL=--with-sasl="$(PREFIX)/cyrus-sasl"
+endif
+
# configure svn
$(SVN_OBJDIR)/.configured: $(SVN_OBJDIR)/.retrieved
@if [ $(ENABLE_JAVA_BINDINGS) = yes ]; then \
@@ -804,22 +918,23 @@ $(SVN_OBJDIR)/.configured: $(SVN_OBJDIR)
--prefix="$(SVN_PREFIX)" \
--with-apr="$(PREFIX)/apr" \
--with-apr-util="$(PREFIX)/apr" \
- --with-apxs="$(PREFIX)/httpd/bin/apxs" \
- --with-apache-libexecdir=$(PREFIX)/httpd/modules/svn-$(WC) \
--with-neon="$(PREFIX)/neon" \
- --with-serf="$(PREFIX)/serf" \
+ $(SVN_WITH_HTTPD) \
+ $(SVN_WITH_SASL) \
+ $(SERF_FLAG) \
--with-sqlite="$(PREFIX)/sqlite" \
--with-berkeley-db="$(BDB_FLAG)" \
- --with-sasl="$(PREFIX)/cyrus-sasl" \
--with-ruby-sitedir="$(SVN_PREFIX)/lib/ruby/site_ruby" \
--disable-mod-activation \
- $(JAVAHL_FLAG)
+ $(JAVAHL_FLAG) \
+ $(SVN_ALL_STATIC) \
+ $(DISABLE_NEON_VERSION_CHECK)
touch $@
# compile svn
$(SVN_OBJDIR)/.compiled: $(SVN_OBJDIR)/.configured
cd $(svn_builddir) \
- && make
+ && make EXTRA_CFLAGS="$(PROFILE_CFLAGS)"
touch $@
# install svn
@@ -879,8 +994,8 @@ httpd-conf:
echo "# httpd config for make check" > $(HTTPD_CHECK_CONF)
echo "ServerRoot \"$(PREFIX)/httpd\"" >> $(HTTPD_CHECK_CONF)
echo "Listen localhost:$(HTTPD_CHECK_PORT)" >> $(HTTPD_CHECK_CONF)
- echo "LoadModule dav_svn_module modules/svn-$(WC)/mod_dav_svn.so" >> $(HTTPD_CHECK_CONF)
- echo "LoadModule authz_svn_module modules/svn-$(WC)/mod_authz_svn.so" >> $(HTTPD_CHECK_CONF)
+ echo "LoadModule dav_svn_module $(MOD_DAV_SVN)" >> $(HTTPD_CHECK_CONF)
+ echo "LoadModule authz_svn_module $(MOD_AUTHZ_SVN)" >> $(HTTPD_CHECK_CONF)
echo "DocumentRoot "$(PREFIX)/httpd/htdocs"" >> $(HTTPD_CHECK_CONF)
echo "# These two Locations are used for 'make check'" >> $(HTTPD_CHECK_CONF)
echo "<Directory />" >> $(HTTPD_CHECK_CONF)
@@ -913,9 +1028,15 @@ httpd-conf:
echo " SVNParentPath /tmp" >> $(HTTPD_CHECK_CONF)
echo " Allow from all" >> $(HTTPD_CHECK_CONF)
echo "</Location>" >> $(HTTPD_CHECK_CONF)
+ echo 'RedirectMatch permanent ^/svn-test-work/repositories/REDIRECT-PERM-(.*)$$ /svn-test-work/repositories/$$1' >> $(HTTPD_CHECK_CONF)
+ echo 'RedirectMatch ^/svn-test-work/repositories/REDIRECT-TEMP-(.*)$$ /svn-test-work/repositories/$$1' >> $(HTTPD_CHECK_CONF)
# We need this to make sure some targets below pick up the right libraries
-LD_LIBRARY_PATH=$(PREFIX)/apr/lib:$(PREFIX)/iconv/lib:$(PREFIX)/bdb/lib:$(PREFIX)/neon/lib:$(PREFIX)/serf/lib:$(PREFIX)/sqlite/lib:$(PREFIX)/svn-$(WC)/lib
+LD_LIBRARY_PATH=$(PREFIX)/apr/lib:$(PREFIX)/iconv/lib:$(PREFIX)/bdb/lib:$(PREFIX)/neon/lib:$(PREFIX)/serf/lib:$(PREFIX)/sqlite/lib:$(PREFIX)/cyrus-sasl/lib:$(PREFIX)/iconv/lib:$(PREFIX)/svn-$(WC)/lib
+
+.PHONY: libpath
+libpath:
+ @echo export LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$$LD_LIBRARY_PATH
.PHONY: start-svnserve stop-svnserve start-httpd stop-httpd
@@ -925,7 +1046,7 @@ HTTPD_CMD = env LD_LIBRARY_PATH=$(LD_LIB
HTTPD_START_CMD = $(HTTPD_CMD) -k start
HTTPD_STOP_CMD = $(HTTPD_CMD) -k stop
-SVNSERVE_START_CMD = $(svn_builddir)/subversion/svnserve/svnserve \
+SVNSERVE_START_CMD = $(SVN_PREFIX)/bin/svnserve \
--listen-host 127.0.0.1 \
--pid-file $(PWD)/svnserve-$(WC).pid \
-d -r $(svn_builddir)/subversion/tests/cmdline
@@ -948,30 +1069,32 @@ start-svnserve: $(SVN_OBJDIR)/.compiled
stop-svnserve:
$(SVNSERVE_STOP_CMD)
+define do_check
+@-cd $(svn_builddir) && for fs in fsfs bdb; do \
+ echo "Begin test: $(subst svn-check-,,$@) x $$fs"; \
+ make check $(PARALLEL) $1 FS_TYPE=$$fs; \
+ for log in tests.log fails.log; do \
+ test -f $$log && mv -f $$log $$log.$@-$$fs; \
+ done; \
+done
+endef
+
svn-check-neon: httpd-conf $(SVN_OBJDIR)/.compiled $(SVN_OBJDIR)/.bindings-compiled
$(HTTPD_START_CMD)
- cd $(svn_builddir) && make check FS_TYPE=fsfs \
- BASE_URL=http://localhost:$(HTTPD_CHECK_PORT) HTTP_LIBRARY=neon
- cd $(svn_builddir) && make check FS_TYPE=bdb \
- BASE_URL=http://localhost:$(HTTPD_CHECK_PORT) HTTP_LIBRARY=neon
+ $(call do_check,BASE_URL=http://localhost:$(HTTPD_CHECK_PORT) HTTP_LIBRARY=neon)
$(HTTPD_STOP_CMD)
svn-check-serf: httpd-conf $(SVN_OBJDIR)/.compiled $(SVN_OBJDIR)/.bindings-compiled
$(HTTPD_START_CMD)
- cd $(svn_builddir) && make check FS_TYPE=fsfs \
- BASE_URL=http://localhost:$(HTTPD_CHECK_PORT) HTTP_LIBRARY=serf
- cd $(svn_builddir) && make check FS_TYPE=bdb \
- BASE_URL=http://localhost:$(HTTPD_CHECK_PORT) HTTP_LIBRARY=serf
+ $(call do_check,BASE_URL=http://localhost:$(HTTPD_CHECK_PORT) HTTP_LIBRARY=serf)
$(HTTPD_STOP_CMD)
svn-check-local:
- cd $(svn_builddir) && make check FS_TYPE=fsfs
- cd $(svn_builddir) && make check FS_TYPE=bdb
+ $(call do_check)
svn-check-svn:
$(SVNSERVE_START_CMD)
- cd $(svn_builddir) && make check FS_TYPE=fsfs BASE_URL=svn://127.0.0.1
- cd $(svn_builddir) && make check FS_TYPE=bdb BASE_URL=svn://127.0.0.1
+ $(call do_check,BASE_URL=svn://127.0.0.1)
$(SVNSERVE_STOP_CMD)
.PHONY: svn-check-swig-pl svn-check-swig-py svn-check-swig-rb svn-check-javahl
@@ -984,19 +1107,78 @@ RUBYLIB=$(SVN_PREFIX)/lib/ruby/site_ruby
grep ^svn_cv_ruby_sitedir_libsuffix $(svn_builddir)/config.log | \
cut -d'=' -f2)
svn-check-swig-pl:
- cd $(svn_builddir) && \
- env LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) make check-swig-pl
+ -if [ $(ENABLE_PERL_BINDINGS) = yes ]; then \
+ (cd $(svn_builddir) && \
+ env LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) \
+ make check-swig-pl 2>&1) | \
+ tee $(svn_builddir)/tests.log.bindings.pl; \
+ fi
+
svn-check-swig-py:
- cd $(svn_builddir) && \
- env LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) make check-swig-py
+ -if [ $(ENABLE_PYTHON_BINDINGS) = yes ]; then \
+ (cd $(svn_builddir) && \
+ env LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) \
+ make check-swig-py 2>&1) | \
+ tee $(svn_builddir)/tests.log.bindings.py; \
+ fi
+
+# We add the svn prefix to PATH here because the ruby tests
+# attempt to start an svnserve binary found in PATH.
svn-check-swig-rb:
- cd $(svn_builddir)/subversion/bindings/swig/ruby/test && \
- env RUBYLIB=$(RUBYLIB) \
- LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) \
- ruby run-test.rb --verbose=verbose
+ -if [ $(ENABLE_RUBY_BINDINGS) = yes ]; then \
+ (cd $(svn_builddir)/subversion/bindings/swig/ruby/test && \
+ env RUBYLIB=$(RUBYLIB) \
+ LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) \
+ PATH=$(SVN_PREFIX)/bin:$$PATH \
+ ruby run-test.rb --verbose=normal 2>&1) | \
+ tee $(svn_builddir)/tests.log.bindings.rb; \
+ fi
+
svn-check-javahl:
- cd $(svn_builddir) && \
- env LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) \
- make check-javahl
+ -if [ $(ENABLE_JAVA_BINDINGS) = yes ]; then \
+ (cd $(svn_builddir) && \
+ env LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) \
+ make check-javahl 2>&1) | \
+ tee $(svn_builddir)/tests.log.bindings.javahl; \
+ fi
svn-check: svn-check-local svn-check-svn svn-check-neon svn-check-serf svn-check-bindings
+
+.PHONY: sign-email
+sign-email:
+ @echo "Summary: +1 to release"
+ @echo ""
+ @echo "Tested: [bdb | fsfs] x [ra_local | ra_svn | ra_neon | ra_serf]"
+ @echo " swig bindings"
+ifeq ($(ENABLE_JAVA_BINDINGS),yes)
+ @echo " javahl bindings"
+endif
+ @echo ""
+ @echo "Test results: All passed."
+ @echo ""
+ @echo "Platform: `uname -r -s -m`"
+ @echo ""
+ @echo "Dependencies:"
+ @echo "bdb: $(BDB_VER)"
+ifeq ($(USE_APR_ICONV),yes)
+ @echo "apr-iconv: $(APR_ICONV_VER)"
+else
+ @echo "GNU-iconv: $(GNU_ICONV_VER)"
+endif
+ @echo "apr: $(APR_VER)"
+ @echo "apr-util: $(APR_UTIL_VER)"
+ @echo "httpd: $(HTTPD_VER)"
+ @echo "neon: $(NEON_VER)"
+ @echo "serf: $(SERF_VER)"
+ @echo "cyrus-sasl: $(CYRUS_SASL_VER)"
+ @echo "sqlite: $(SQLITE_VER)"
+ @echo "openssl: `openssl version | cut -d' ' -f2`"
+ @echo "swig: `swig -version | grep Version | cut -d' ' -f3`"
+ @echo "python: `python --version 2>&1 | cut -d' ' -f2`"
+ @echo "perl: `eval \`perl -V:version\`; echo $$version`"
+ @echo "ruby: `ruby --version | cut -d' ' -f2`"
+ifeq ($(ENABLE_JAVA_BINDINGS),yes)
+ @echo "java: `java -version 2>&1 | grep version | cut -d' ' -f3 | sed -e 's/\"//g'`"
+endif
+ @echo ""
+ @echo "Signatures:"
Modified: subversion/branches/ignore-mergeinfo/tools/dev/wc-format.py
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/tools/dev/wc-format.py?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/tools/dev/wc-format.py (original)
+++ subversion/branches/ignore-mergeinfo/tools/dev/wc-format.py Sat Dec 11 00:15:55 2010
@@ -4,31 +4,44 @@ import os
import sqlite3
import sys
-# helper
-def usage():
- sys.stderr.write("USAGE: %s [PATH]\n" + \
- "\n" + \
- "Prints to stdout the format of the working copy at PATH.\n")
-
-# parse argv
-wc = (sys.argv[1:] + ['.'])[0]
-
-# main()
-entries = os.path.join(wc, '.svn', 'entries')
-wc_db = os.path.join(wc, '.svn', 'wc.db')
-
-if os.path.exists(entries):
- formatno = int(open(entries).readline())
-elif os.path.exists(wc_db):
- formatno = sqlite3.connect(wc_db).execute('pragma user_version;').fetchone()[0]
-else:
- usage()
- sys.exit(1)
-
-# 1.0.x -> 1.3.x: format 4
-# 1.4.x: format 8
-# 1.5.x: format 9
-# 1.6.x: format 10
-# 1.7.x: format XXX
-print("%s: %d" % (wc, formatno))
+MIN_SINGLE_DB_FORMAT = 19
+def get_format(wc_path):
+ entries = os.path.join(wc_path, '.svn', 'entries')
+ wc_db = os.path.join(wc_path, '.svn', 'wc.db')
+
+ formatno = 'not under version control'
+
+ if os.path.exists(entries):
+ formatno = int(open(entries).readline())
+ elif os.path.exists(wc_db):
+ conn = sqlite3.connect(wc_db)
+ curs = conn.cursor()
+ curs.execute('pragma user_version;')
+ formatno = curs.fetchone()[0]
+ elif os.path.exists(wc_path):
+ parent_path = os.path.dirname(os.path.abspath(wc_path))
+ if wc_path != parent_path:
+ formatno = get_format(parent_path)
+ if formatno >= MIN_SINGLE_DB_FORMAT:
+ return formatno
+
+ return formatno
+
+def print_format(wc_path):
+ # see subversion/libsvn_wc/wc.h for format values and information
+ # 1.0.x -> 1.3.x: format 4
+ # 1.4.x: format 8
+ # 1.5.x: format 9
+ # 1.6.x: format 10
+ # 1.7.x: format XXX
+ formatno = get_format(wc_path)
+ print '%s: %s' % (wc_path, formatno)
+
+
+if __name__ == '__main__':
+ paths = sys.argv[1:]
+ if not paths:
+ paths = ['.']
+ for wc_path in paths:
+ print_format(wc_path)
Modified: subversion/branches/ignore-mergeinfo/tools/diff/diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/tools/diff/diff.c?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/tools/diff/diff.c (original)
+++ subversion/branches/ignore-mergeinfo/tools/diff/diff.c Sat Dec 11 00:15:55 2010
@@ -1,4 +1,4 @@
-/* diff-test.c -- test driver for text diffs
+/* diff.c -- test driver for text diffs
*
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one
@@ -28,68 +28,121 @@
#include "svn_pools.h"
#include "svn_diff.h"
#include "svn_io.h"
-
+#include "svn_utf.h"
static svn_error_t *
do_diff(svn_stream_t *ostream,
- const char *original, const char *modified,
+ const char *original,
+ const char *modified,
svn_boolean_t *has_changes,
+ svn_diff_file_options_t *options,
+ svn_boolean_t show_c_function,
apr_pool_t *pool)
{
svn_diff_t *diff;
- SVN_ERR(svn_diff_file_diff(&diff, original, modified, pool));
-
+ SVN_ERR(svn_diff_file_diff_2(&diff, original, modified, options, pool));
*has_changes = svn_diff_contains_diffs(diff);
+ return svn_diff_file_output_unified3(ostream, diff, original, modified,
+ NULL, NULL, SVN_APR_LOCALE_CHARSET,
+ NULL, show_c_function, pool);
+}
- SVN_ERR(svn_diff_file_output_unified(ostream, diff,
- original, modified,
- NULL, NULL, pool));
-
- return NULL;
+static void
+print_usage(svn_stream_t *ostream, const char *progname,
+ apr_pool_t *pool)
+{
+ svn_error_clear(svn_stream_printf(ostream, pool,
+ "Usage: %s [OPTIONS] <file1> <file2>\n"
+ "\n"
+ "Display the differences between <file1> and <file2> in unified diff\n"
+ "format. OPTIONS are diff extensions as described by 'svn help diff'.\n"
+ "Use '--' alone to indicate that no more options follow.\n",
+ progname));
}
-int main(int argc, char *argv[])
+int main(int argc, const char *argv[])
{
apr_pool_t *pool;
svn_stream_t *ostream;
- int rc;
svn_error_t *svn_err;
+ svn_boolean_t has_changes;
+ svn_diff_file_options_t *diff_options;
+ apr_array_header_t *options_array;
+ int i;
+ const char *from = NULL;
+ const char *to = NULL;
+ svn_boolean_t show_c_function = FALSE;
+ svn_boolean_t no_more_options = FALSE;
apr_initialize();
+ atexit(apr_terminate);
pool = svn_pool_create(NULL);
svn_err = svn_stream_for_stdout(&ostream, pool);
if (svn_err)
{
- svn_handle_error2(svn_err, stdout, FALSE, "diff-test: ");
- rc = 2;
+ svn_handle_error2(svn_err, stdout, FALSE, "diff: ");
+ return 2;
}
- else if (argc == 3)
+
+ options_array = apr_array_make(pool, 0, sizeof(const char *));
+
+ for (i = 1 ; i < argc ; i++)
{
- svn_boolean_t has_changes;
-
- svn_err = do_diff(ostream, argv[1], argv[2], &has_changes, pool);
- if (svn_err == NULL)
+ if (!no_more_options && (argv[i][0] == '-'))
{
- rc = has_changes ? 1 : 0;
+ /* Special case: '--' means "no more options follow" */
+ if (argv[i][1] == '-' && !argv[i][2])
+ {
+ no_more_options = TRUE;
+ continue;
+ }
+ /* Special case: we need to detect '-p' and handle it specially */
+ if (argv[i][1] == 'p' && !argv[i][2])
+ {
+ show_c_function = TRUE;
+ continue;
+ }
+ APR_ARRAY_PUSH(options_array, const char *) = argv[i];
}
else
{
- svn_handle_error2(svn_err, stdout, FALSE, "diff-test: ");
- rc = 2;
+ if (from == NULL)
+ from = argv[i];
+ else if (to == NULL)
+ to = argv[i];
+ else
+ {
+ print_usage(ostream, argv[0], pool);
+ return 2;
+ }
}
}
- else
+
+ if (!from || !to)
{
- svn_error_clear(svn_stream_printf(ostream, pool,
- "Usage: %s <file1> <file2>\n",
- argv[0]));
- rc = 2;
+ print_usage(ostream, argv[0], pool);
+ return 2;
}
- apr_terminate();
+ diff_options = svn_diff_file_options_create(pool);
+
+ svn_err = svn_diff_file_options_parse(diff_options, options_array, pool);
+ if (svn_err)
+ {
+ svn_handle_error2(svn_err, stdout, FALSE, "diff: ");
+ return 2;
+ }
+
+ svn_err = do_diff(ostream, from, to, &has_changes,
+ diff_options, show_c_function, pool);
+ if (svn_err)
+ {
+ svn_handle_error2(svn_err, stdout, FALSE, "diff: ");
+ return 2;
+ }
- return rc;
+ return has_changes ? 1 : 0;
}
Modified: subversion/branches/ignore-mergeinfo/tools/diff/diff3.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/tools/diff/diff3.c?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/tools/diff/diff3.c (original)
+++ subversion/branches/ignore-mergeinfo/tools/diff/diff3.c Sat Dec 11 00:15:55 2010
@@ -1,4 +1,4 @@
-/* diff3-test.c -- test driver for 3-way text merges
+/* diff3.c -- test driver for 3-way text merges
*
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one
@@ -66,7 +66,7 @@ int main(int argc, char *argv[])
svn_err = svn_stream_for_stdout(&ostream, pool);
if (svn_err)
{
- svn_handle_error2(svn_err, stdout, FALSE, "diff3-test: ");
+ svn_handle_error2(svn_err, stdout, FALSE, "diff3: ");
rc = 2;
}
else if (argc == 4)
@@ -81,7 +81,7 @@ int main(int argc, char *argv[])
}
else
{
- svn_handle_error2(svn_err, stdout, FALSE, "diff3-test: ");
+ svn_handle_error2(svn_err, stdout, FALSE, "diff3: ");
rc = 2;
}
}
Modified: subversion/branches/ignore-mergeinfo/tools/diff/diff4.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/tools/diff/diff4.c?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/tools/diff/diff4.c (original)
+++ subversion/branches/ignore-mergeinfo/tools/diff/diff4.c Sat Dec 11 00:15:55 2010
@@ -1,4 +1,4 @@
-/* diff4-test.c -- test driver for 3-way text merges
+/* diff4.c -- test driver for 4-way text merges
*
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one
@@ -67,7 +67,7 @@ int main(int argc, char *argv[])
svn_err = svn_stream_for_stdout(&ostream, pool);
if (svn_err)
{
- svn_handle_error2(svn_err, stdout, FALSE, "diff4-test: ");
+ svn_handle_error2(svn_err, stdout, FALSE, "diff4: ");
rc = 2;
}
else if (argc == 5)
@@ -77,7 +77,7 @@ int main(int argc, char *argv[])
pool);
if (svn_err != NULL)
{
- svn_handle_error2(svn_err, stdout, FALSE, "diff4-test: ");
+ svn_handle_error2(svn_err, stdout, FALSE, "diff4: ");
rc = 2;
}
}
Modified: subversion/branches/ignore-mergeinfo/tools/dist/construct-rolling-environment.sh
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/tools/dist/construct-rolling-environment.sh?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/tools/dist/construct-rolling-environment.sh (original)
+++ subversion/branches/ignore-mergeinfo/tools/dist/construct-rolling-environment.sh Sat Dec 11 00:15:55 2010
@@ -53,11 +53,11 @@ TEMPDIR=$BASEDIR/temp
case $LOCATION in
US)
APACHE_MIRROR=http://www.pangex.com/pub/apache
- SOURCEFORGE_MIRROR=http://internap.dl.sourceforge.net/sourceforge
+ SOURCEFORGE_MIRROR=softlayer
;;
UK)
APACHE_MIRROR=http://apache.rmplc.co.uk
- SOURCEFORGE_MIRROR=http://kent.dl.sourceforge.net/sourceforge
+ SOURCEFORGE_MIRROR=kent
;;
*)
echo "Unknown LOCATION" >&2
@@ -77,7 +77,7 @@ setup() {
create_prefix() {
wget -nc http://ftp.gnu.org/gnu/autoconf/$AUTOCONF.tar.bz2
wget -nc http://ftp.gnu.org/gnu/libtool/$LIBTOOL.tar.gz
- wget -nc $SOURCEFORGE_MIRROR/swig/$SWIG.tar.gz
+ wget -nc "http://sourceforge.net/projects/swig/files/swig/$SWIG/$SWIG.tar.gz/download?use_mirror=$SOURCEFORGE_MIRROR"
tar jxvf $AUTOCONF.tar.bz2
cd $AUTOCONF
Modified: subversion/branches/ignore-mergeinfo/tools/dist/dist.sh
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/tools/dist/dist.sh?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/tools/dist/dist.sh (original)
+++ subversion/branches/ignore-mergeinfo/tools/dist/dist.sh Sat Dec 11 00:15:55 2010
@@ -229,6 +229,10 @@ rm -f "$DISTPATH/STATUS"
# (See http://svn.haxx.se/dev/archive-2009-04/0166.shtml for discussion.)
rm -rf "$DISTPATH/contrib"
+# Remove notes/ from our distribution tarball. It's large, but largely
+# blue-sky and out-of-date, and of questionable use to end users.
+rm -rf "$DISTPATH/notes"
+
# Remove packages/ from the tarball.
# (See http://svn.haxx.se/dev/archive-2009-12/0205.shtml)
rm -rf "$DISTPATH/packages"
Modified: subversion/branches/ignore-mergeinfo/tools/hook-scripts/mailer/mailer.py
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/tools/hook-scripts/mailer/mailer.py?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/tools/hook-scripts/mailer/mailer.py (original)
+++ subversion/branches/ignore-mergeinfo/tools/hook-scripts/mailer/mailer.py Sat Dec 11 00:15:55 2010
@@ -866,12 +866,16 @@ class DiffGenerator:
content = src_fname = dst_fname = None
else:
src_fname, dst_fname = diff.get_files()
- content = DiffContent(self.cfg.get_diff_cmd(self.group, {
- 'label_from' : label1,
- 'label_to' : label2,
- 'from' : src_fname,
- 'to' : dst_fname,
- }))
+ try:
+ content = DiffContent(self.cfg.get_diff_cmd(self.group, {
+ 'label_from' : label1,
+ 'label_to' : label2,
+ 'from' : src_fname,
+ 'to' : dst_fname,
+ }))
+ except OSError:
+ # diff command does not exist, try difflib.unified_diff()
+ content = DifflibDiffContent(label1, label2, src_fname, dst_fname)
# return a data item for this diff
return _data(
@@ -890,6 +894,33 @@ class DiffGenerator:
content=content,
)
+def _classify_diff_line(line, seen_change):
+ # classify the type of line.
+ first = line[:1]
+ ltype = ''
+ if first == '@':
+ seen_change = True
+ ltype = 'H'
+ elif first == '-':
+ if seen_change:
+ ltype = 'D'
+ else:
+ ltype = 'F'
+ elif first == '+':
+ if seen_change:
+ ltype = 'A'
+ else:
+ ltype = 'T'
+ elif first == ' ':
+ ltype = 'C'
+ else:
+ ltype = 'U'
+
+ if line[-2] == '\r':
+ line=line[0:-2] + '\n' # remove carriage return
+
+ return line, ltype, seen_change
+
class DiffContent:
"This is a generator-like object returning annotated lines of a diff."
@@ -917,36 +948,42 @@ class DiffContent:
self.pipe = None
raise IndexError
- # classify the type of line.
- first = line[:1]
- if first == '@':
- self.seen_change = True
- ltype = 'H'
- elif first == '-':
- if self.seen_change:
- ltype = 'D'
- else:
- ltype = 'F'
- elif first == '+':
- if self.seen_change:
- ltype = 'A'
- else:
- ltype = 'T'
- elif first == ' ':
- ltype = 'C'
- else:
- ltype = 'U'
+ line, ltype, self.seen_change = _classify_diff_line(line, self.seen_change)
+ return _data(
+ raw=line,
+ text=line[1:-1], # remove indicator and newline
+ type=ltype,
+ )
- if line[-2] == '\r':
- line=line[0:-2] + '\n' # remove carriage return
+class DifflibDiffContent():
+ "This is a generator-like object returning annotated lines of a diff."
+
+ def __init__(self, label_from, label_to, from_file, to_file):
+ import difflib
+ self.seen_change = False
+ fromlines = open(from_file, 'U').readlines()
+ tolines = open(to_file, 'U').readlines()
+ self.diff = difflib.unified_diff(fromlines, tolines,
+ label_from, label_to)
+
+ def __nonzero__(self):
+ # we always have some items
+ return True
+ def __getitem__(self, idx):
+
+ try:
+ line = self.diff.next()
+ except StopIteration:
+ raise IndexError
+
+ line, ltype, self.seen_change = _classify_diff_line(line, self.seen_change)
return _data(
raw=line,
text=line[1:-1], # remove indicator and newline
type=ltype,
)
-
class TextCommitRenderer:
"This class will render the commit mail in plain text."
Modified: subversion/branches/ignore-mergeinfo/tools/hook-scripts/svnperms.conf.example
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/tools/hook-scripts/svnperms.conf.example?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/tools/hook-scripts/svnperms.conf.example (original)
+++ subversion/branches/ignore-mergeinfo/tools/hook-scripts/svnperms.conf.example Sat Dec 11 00:15:55 2010
@@ -9,6 +9,8 @@
#
[groups]
group1 = user1 user2 user3
+group2 = user4 user5
+supergroup = @group1 @group2 user6
#
# Example repository control, showing allowed syntax.
@@ -20,13 +22,13 @@ group1 = user1 user2 user3
# - line breaks are accepted
#
[example1 groups]
-group2 = user9 user10
+group3 = user9 user10
[example1]
trunk/.* = *(add,remove,update) @group1,user4,user5(update)
user6,user7()
trunk/.* = user8(add,update)
-tags/[^/]+/ = @group2(add)
+tags/[^/]+/ = @group3(add)
branches/[^/]+/.* = *(add,remove,update)
#
Modified: subversion/branches/ignore-mergeinfo/tools/hook-scripts/svnperms.py
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/tools/hook-scripts/svnperms.py?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/tools/hook-scripts/svnperms.py (original)
+++ subversion/branches/ignore-mergeinfo/tools/hook-scripts/svnperms.py Sat Dec 11 00:15:55 2010
@@ -128,7 +128,17 @@ class Permission:
def parse_groups(self, groupsiter):
for option, value in groupsiter:
- self._group[option] = value.split()
+ groupusers = []
+ for token in value.split():
+ # expand nested groups in place; no forward decls
+ if token[0] == "@":
+ try:
+ groupusers.extend(self._group[token[1:]])
+ except KeyError:
+ raise Error, "group '%s' not found" % token[1:]
+ else:
+ groupusers.append(token)
+ self._group[option] = groupusers
def parse_perms(self, permsiter):
for option, value in permsiter:
Modified: subversion/branches/ignore-mergeinfo/tools/server-side/svn-rep-sharing-stats.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/tools/server-side/svn-rep-sharing-stats.c?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/tools/server-side/svn-rep-sharing-stats.c (original)
+++ subversion/branches/ignore-mergeinfo/tools/server-side/svn-rep-sharing-stats.c Sat Dec 11 00:15:55 2010
@@ -329,12 +329,10 @@ pretty_print(const char *name,
for (hi = apr_hash_first(scratch_pool, reps_ref_counts);
hi; hi = apr_hash_next(hi))
{
- const struct key_t *key;
struct value_t *value;
SVN_ERR(cancel_func(NULL));
- key = svn__apr_hash_index_key(hi);
value = svn__apr_hash_index_val(hi);
SVN_ERR(svn_cmdline_printf(scratch_pool, "%s %" APR_UINT64_T_FMT " %s\n",
name, value->refcount,
Modified: subversion/branches/ignore-mergeinfo/win-tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/win-tests.py?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/win-tests.py (original)
+++ subversion/branches/ignore-mergeinfo/win-tests.py Sat Dec 11 00:15:55 2010
@@ -226,7 +226,6 @@ if run_httpd:
base_url = 'http://localhost:' + str(httpd_port)
if base_url:
- all_tests = client_tests
repo_loc = 'remote repository ' + base_url + '.'
if base_url[:4] == 'http':
log = 'dav-tests.log'