Modified: subversion/branches/fsfs-format7/tools/dev/fsfs-reorg.c URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/tools/dev/fsfs-reorg.c?rev=1476675&r1=1476674&r2=1476675&view=diff ============================================================================== --- subversion/branches/fsfs-format7/tools/dev/fsfs-reorg.c (original) +++ subversion/branches/fsfs-format7/tools/dev/fsfs-reorg.c Sat Apr 27 21:30:36 2013 @@ -54,7 +54,7 @@ typedef struct revision_info_t revision_ /* A FSFS rev file is sequence of fragments and unused space (the latter * only being inserted by this tool and not during ordinary SVN operation). - * + * * This type defines the type of any fragment. * * Please note that the classification as "property", "dir" or "file" @@ -105,7 +105,7 @@ typedef struct revision_location_t { /* pack file offset (manifest value), 0 for non-packed files */ apr_size_t offset; - + /* offset of the changes list relative to OFFSET */ apr_size_t changes; @@ -114,7 +114,7 @@ typedef struct revision_location_t /* first offset behind the revision data in the pack file (file length * for non-packed revs) */ - apr_size_t end; + apr_size_t end; } revision_location_t; /* Absolute position and size of some item. @@ -238,7 +238,7 @@ struct revision_info_t /* all noderevs_t of this revision (ordered by source file offset), * i.e. those that point back to this struct */ apr_array_header_t *node_revs; - + /* all representation_t of this revision (ordered by source file offset), * i.e. those that point back to this struct */ apr_array_header_t *representations; @@ -268,7 +268,7 @@ typedef struct revision_pack_t /* Cache for revision source content. All content is stored in DATA and * the HASH maps revision number to an svn_string_t instance whose data * member points into DATA. - * + * * Once TOTAL_SIZE exceeds LIMIT, all content will be discarded. Similarly, * the hash gets cleared every 10000 insertions to keep the HASH_POOL * memory usage in check. @@ -313,7 +313,7 @@ typedef struct dir_cache_entry_t /* Directory cache. (revision, offset) will be mapped directly into the * ENTRIES array of ENTRY_COUNT buckets (many entries will be NULL). * Two alternating pools will be used to allocate dir content. - * + * * If the INSERT_COUNT exceeds a given limit, the pools get exchanged and * the older of the two will be cleared. This is to keep dir objects valid * for at least one insertion. @@ -325,7 +325,7 @@ typedef struct dir_cache_t /* currently used for entry allocations */ apr_pool_t *pool1; - + /* previously used for entry allocations */ apr_pool_t *pool2; @@ -484,7 +484,7 @@ create_content_cache(apr_pool_t *pool, result->total_size = 0; result->insert_count = 0; result->data = apr_palloc(pool, limit); - + return result; } @@ -539,7 +539,7 @@ set_cached_content(content_cache_t *cach memcpy(cache->data + cache->total_size, data->data, data->len); cache->total_size += data->len; - + key = apr_palloc(cache->hash_pool, sizeof(*key)); *key = revision; @@ -650,7 +650,7 @@ get_cached_dir(fs_fs_t *fs, apr_size_t i = get_dir_cache_index(fs, revision, offset); dir_cache_entry_t *entry = &fs->dir_cache->entries[i]; - + return entry->offset == offset && entry->revision == revision ? entry->hash : NULL; @@ -837,12 +837,12 @@ read_revision_header(apr_size_t *changes char *space; apr_uint64_t val; apr_size_t len; - + /* Read in this last block, from which we will identify the last line. */ len = sizeof(buf); if (start + len > end) len = end - start; - + memcpy(buf, file_content->data + end - len, len); /* The last byte should be a newline. */ @@ -972,7 +972,7 @@ read_number(svn_revnum_t *result, const { svn_stringbuf_t *content; apr_uint64_t number; - + SVN_ERR(svn_stringbuf_from_file2(&content, path, pool)); content->data[content->len-1] = 0; @@ -1170,7 +1170,7 @@ find_representation(int *idx, /* not found -> no result */ if (info == NULL) return NULL; - + assert(revision == info->revision); /* look for the representation */ @@ -1253,7 +1253,7 @@ read_rep_base(representation_t **represe /* Parse the representation reference (text: or props:) in VALUE, look * it up in FS and return it in *REPRESENTATION. To be able to parse the * base rep, we pass the FILE_CONTENT as well. - * + * * If necessary, allocate the result in POOL; use SCRATCH_POOL for temp. * allocations. */ @@ -1297,7 +1297,7 @@ parse_representation(representation_t ** svn_sort__array_insert(&result, revision_info->representations, idx); } - + *representation = result; return SVN_NO_ERROR; @@ -1417,7 +1417,7 @@ get_combined_window(svn_stringbuf_t **co /* apply deltas */ result = svn_stringbuf_create_empty(pool); source = base_content->data; - + for (i = 0; i < windows->nelts; ++i) { svn_txdelta_window_t *window @@ -1441,7 +1441,7 @@ get_combined_window(svn_stringbuf_t **co /* cache result and return it */ set_cached_window(fs, representation, result); *content = result; - + return SVN_NO_ERROR; } @@ -1459,7 +1459,7 @@ read_noderev(noderev_t **noderev, * pertain to the revision given in REVISION_INFO. If the data has not * been read yet, parse it and store it in REVISION_INFO. Return the result * in *NODEREV. - * + * * Use POOL for allocations and SCRATCH_POOL for temporaries. */ static svn_error_t * @@ -1524,7 +1524,7 @@ read_dir(apr_hash_t **hash, /* cache the result */ set_cached_dir(fs, representation, *hash); - + return SVN_NO_ERROR; } @@ -1659,7 +1659,7 @@ read_noderev(noderev_t **noderev, /* empty line -> end of noderev data */ if (line->len == 0) break; - + sep = strchr(line->data, ':'); if (sep == NULL) continue; @@ -1670,7 +1670,7 @@ read_noderev(noderev_t **noderev, if (key.len + 2 > line->len) continue; - + value.data = sep + 2; value.len = line->len - (key.len + 2); @@ -1891,7 +1891,7 @@ read_revisions(fs_fs_t **fs, /* determine cache sizes */ if (memsize < 100) memsize = 100; - + content_cache_size = memsize * 7 / 10 > 4000 ? 4000 : memsize * 7 / 10; window_cache_size = memsize * 2 / 10 * 1024 * 1024; dir_cache_size = (memsize / 10) * 16000; @@ -1991,7 +1991,7 @@ add_revisions_pack_heads(revision_pack_t { info = APR_ARRAY_IDX(pack->info, i, revision_info_t*); info->target.offset = pack->target_offset; - + fragment.data = info; fragment.kind = header_fragment; fragment.position = pack->target_offset; @@ -2002,7 +2002,7 @@ add_revisions_pack_heads(revision_pack_t info = APR_ARRAY_IDX(pack->info, pack->info->nelts - 1, revision_info_t*); info->target.offset = pack->target_offset; - + /* followed by the changes list */ for (i = 0; i < pack->info->nelts; ++i) @@ -2065,7 +2065,7 @@ add_noderev_recursively(fs_fs_t *fs, * has not been covered, yet. Place the base reps along the deltification * chain as far as those reps have not been covered, yet. If REPRESENTATION * is a directory, recursively place its elements. - * + * * Use POOL for allocations. */ static svn_error_t * @@ -2091,7 +2091,7 @@ add_representation_recursively(fs_fs_t * fs, representation->revision)); representation->target.offset = *current_pos; representation->covered = TRUE; - + fragment.data = representation; fragment.kind = kind; fragment.position = *current_pos; @@ -2106,7 +2106,7 @@ add_representation_recursively(fs_fs_t * apr_pool_t *text_pool = svn_pool_create(pool); svn_stringbuf_t *content; - get_combined_window(&content, fs, representation, text_pool); + SVN_ERR(get_combined_window(&content, fs, representation, text_pool)); representation->target.size = content->len; *current_pos += representation->target.size + 13; @@ -2287,7 +2287,7 @@ get_fragment_content(svn_string_t **cont * may significantly. This function causes all directory target reps in * PACK of FS to be built and their new MD5 as well as rep sizes be updated. * We must do that before attempting to write noderevs. - * + * * Use POOL for allocations. */ static svn_error_t * @@ -2347,7 +2347,7 @@ get_content_length(apr_size_t *length, } else *length = content->len; - + return SVN_NO_ERROR; } @@ -2363,7 +2363,7 @@ move_fragment(fragment_t *fragment, noderev_t *node; /* move the fragment */ - fragment->position = new_position; + fragment->position = new_position; /* move the underlying object */ switch (fragment->kind) @@ -2484,7 +2484,7 @@ pack_revisions(fs_fs_t *fs, } } while (needed_to_expand); - + svn_pool_destroy(itempool); return SVN_NO_ERROR; @@ -2680,7 +2680,7 @@ get_updated_dir(svn_string_t **content, /* done */ *content = svn_stringbuf__morph_into_string(result); - + return SVN_NO_ERROR; } @@ -2772,7 +2772,7 @@ update_text(svn_stringbuf_t *node_rev, /* for directories, we need to write all rep info anew */ char *newline_pos = strchr(val_pos, '\n'); svn_checksum_t checksum; - const char* temp = apr_psprintf(scratch_pool, "%ld %" APR_SIZE_T_FMT " %" + const char* temp = apr_psprintf(scratch_pool, "%ld %" APR_SIZE_T_FMT " %" APR_SIZE_T_FMT" %" APR_SIZE_T_FMT " %s", representation->revision->revision, representation->target.offset - representation->revision->target.offset, @@ -2793,7 +2793,7 @@ update_text(svn_stringbuf_t *node_rev, * Content size and checksums are unchanged. */ const char* temp; char *end_pos = strchr(val_pos, ' '); - + val_pos = end_pos + 1; end_pos = strchr(strchr(val_pos, ' ') + 1, ' '); temp = apr_psprintf(scratch_pool, "%" APR_SIZE_T_FMT " %" APR_SIZE_T_FMT, @@ -2842,7 +2842,7 @@ get_fragment_content(svn_string_t **cont case changes_fragment: info = fragment->data; SVN_ERR(get_content(&revision_content, fs, info->revision, pool)); - + *content = svn_string_create_empty(pool); (*content)->data = revision_content->data + info->original.changes; (*content)->len = info->target.changes_len; @@ -2989,7 +2989,7 @@ static svn_error_t * prepare_repo(const char *path, apr_pool_t *pool) { svn_node_kind_t kind; - + const char *old_path = svn_dirent_join(path, "db/old", pool); const char *new_path = svn_dirent_join(path, "new", pool); const char *revs_path = svn_dirent_join(path, "db/revs", pool); @@ -3118,13 +3118,13 @@ int main(int argc, const char *argv[]) printf("Reading revisions\n"); svn_err = read_revisions(&fs, repo_path, start_revision, memsize, pool); } - + if (!svn_err) { printf("\nReordering revision content\n"); svn_err = reorder_revisions(fs, pool); } - + if (!svn_err) { printf("\nPacking and writing revisions\n");
Modified: subversion/branches/fsfs-format7/tools/dev/unix-build/Makefile.svn URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/tools/dev/unix-build/Makefile.svn?rev=1476675&r1=1476674&r2=1476675&view=diff ============================================================================== --- subversion/branches/fsfs-format7/tools/dev/unix-build/Makefile.svn (original) +++ subversion/branches/fsfs-format7/tools/dev/unix-build/Makefile.svn Sat Apr 27 21:30:36 2013 @@ -1510,13 +1510,17 @@ svn-check: svn-check-prepare-ramdisk svn svn-check-neon svn-check-serf svn-check-bindings .PHONY: sign-email +ifdef NEON_FLAG +NEON_STR=ra_neon | +NEON_VER_LINE=@echo "neon: $(NEON_VER)" +endif sign-email: @echo "Summary: +1 to release" @echo "" - @echo "Tested: [bdb | fsfs] x [ra_local | ra_svn | ra_neon | ra_serf]" + @echo "Tested: [bdb | fsfs] x [ra_local | ra_svn | $(NEON_STR)ra_serf]" @echo " swig bindings" ifeq ($(ENABLE_JAVA_BINDINGS),yes) - @echo " javahl bindings" + @echo " javahl bindings" endif @echo "" @echo "Test results: All passed." @@ -1533,7 +1537,7 @@ endif @echo "apr: $(APR_VER)" @echo "apr-util: $(APR_UTIL_VER)" @echo "httpd: $(HTTPD_VER)" - @echo "neon: $(NEON_VER)" + $(NEON_VER_LINE) @echo "serf: $(SERF_VER)" @echo "cyrus-sasl: $(CYRUS_SASL_VER)" @echo "sqlite: $(SQLITE_VER)" Modified: subversion/branches/fsfs-format7/tools/dist/_gnupg.py URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/tools/dist/_gnupg.py?rev=1476675&r1=1476674&r2=1476675&view=diff ============================================================================== --- subversion/branches/fsfs-format7/tools/dist/_gnupg.py (original) +++ subversion/branches/fsfs-format7/tools/dist/_gnupg.py Sat Apr 27 21:30:36 2013 @@ -1,9 +1,9 @@ # Copyright (c) 2008-2011 by Vinay Sajip. # All rights reserved. -# +# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: -# +# # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright notice, @@ -12,7 +12,7 @@ # * The name(s) of the copyright holder(s) may not be used to endorse or # promote products derived from this software without specific prior # written permission. -# +# # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) "AS IS" AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO Modified: subversion/branches/fsfs-format7/tools/dist/backport.pl URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/tools/dist/backport.pl?rev=1476675&r1=1476674&r2=1476675&view=diff ============================================================================== --- subversion/branches/fsfs-format7/tools/dist/backport.pl (original) +++ subversion/branches/fsfs-format7/tools/dist/backport.pl Sat Apr 27 21:30:36 2013 @@ -30,11 +30,17 @@ my $STATUS = './STATUS'; my $BRANCHES = '^/subversion/branches'; my $YES = $ENV{YES}; # batch mode: eliminate prompts, add sleeps -my $WET_RUN = qw[false true][1]; # don't commit +my $MAY_COMMIT = qw[false true][0]; my $DEBUG = qw[false true][0]; # 'set -x', etc +$DEBUG = 'true' if exists $ENV{DEBUG}; +$MAY_COMMIT = 'true' if ($ENV{MAY_COMMIT} // "false") =~ /^(1|yes|true)$/i; # derived values my $SVNq; +my $SVNvsn = do { + my ($major, $minor, $patch) = `$SVN --version -q` =~ /^(\d+)\.(\d+)\.(\d+)/; + 1e6*$major + 1e3*$minor + $patch; +}; $SVN .= " --non-interactive" if $YES or not defined ctermid; $SVNq = "$SVN -q "; @@ -59,7 +65,7 @@ EOF sub prompt { local $\; # disable 'perl -l' effects - print "Go ahead? "; + print "$_[0] "; # TODO: this part was written by trial-and-error ReadMode 'cbreak'; @@ -78,9 +84,14 @@ sub merge { if ($entry{branch}) { # NOTE: This doesn't escape the branch into the pattern. - $pattern = sprintf '\V\(%s branch(es)?\|branches\/%s\|Branch(es)?:\n *%s\)', $entry{branch}, $entry{branch}, $entry{branch}; - $mergeargs = "--reintegrate $BRANCHES/$entry{branch}"; - print $logmsg_fh "Reintegrate the $entry{header}:"; + $pattern = sprintf '\V\(%s branch(es)?\|branches\/%s\|Branch\(es\)\?: \*\n\? \*%s\)', $entry{branch}, $entry{branch}, $entry{branch}; + if ($SVNvsn >= 1_008_000) { + $mergeargs = "$BRANCHES/$entry{branch}"; + print $logmsg_fh "Merge the $entry{header}:"; + } else { + $mergeargs = "--reintegrate $BRANCHES/$entry{branch}"; + print $logmsg_fh "Reintegrate the $entry{header}:"; + } print $logmsg_fh ""; } elsif (@{$entry{revisions}}) { $pattern = '^ [*] \V' . 'r' . $entry{revisions}->[0]; @@ -98,6 +109,7 @@ sub merge { print $logmsg_fh $_ for @{$entry{entry}}; close $logmsg_fh or die "Can't close $logmsg_filename: $!"; + my $reintegrated_word = ($SVNvsn >= 1_008_000) ? "merged" : "reintegrated"; my $script = <<"EOF"; #!/bin/sh set -e @@ -105,28 +117,43 @@ if $DEBUG; then set -x fi $SVN diff > $backupfile +cp STATUS STATUS.$$ $SVNq revert -R . +mv STATUS.$$ STATUS $SVNq up $SVNq merge $mergeargs -$VIM -e -s -n -N -i NONE -u NONE -c '/$pattern/normal! dap' -c wq $STATUS -if $WET_RUN; then +if [ "`$SVN status -q | wc -l`" -eq 1 ]; then + if [ -n "`$SVN diff | perl -lne 'print if s/^(Added|Deleted|Modified): //' | grep -vx svn:mergeinfo`" ]; then + # This check detects STATUS entries that name non-^/subversion/ revnums. + # ### Q: What if we actually commit a mergeinfo fix to trunk and then want + # ### to backport it? + # ### A: We don't merge it using the script. + echo "Bogus merge: includes only svn:mergeinfo changes!" >&2 + exit 2 + fi +fi +if $MAY_COMMIT; then + $VIM -e -s -n -N -i NONE -u NONE -c '/$pattern/normal! dap' -c wq $STATUS $SVNq commit -F $logmsg_filename else - echo "Committing:" + echo "Would have committed:" + echo '[[[' $SVN status -q + echo 'M STATUS (not shown in the diff)' cat $logmsg_filename + echo ']]]' fi EOF $script .= <<"EOF" if $entry{branch}; reinteg_rev=\`$SVN info $STATUS | sed -ne 's/Last Changed Rev: //p'\` -if $WET_RUN; then +if $MAY_COMMIT; then # Sleep to avoid out-of-order commit notifications if [ -n "\$YES" ]; then sleep 15; fi - $SVNq rm $BRANCHES/$entry{branch} -m "Remove the '$entry{branch}' branch, reintegrated in r\$reinteg_rev." + $SVNq rm $BRANCHES/$entry{branch} -m "Remove the '$entry{branch}' branch, $reintegrated_word in r\$reinteg_rev." if [ -n "\$YES" ]; then sleep 1; fi else - echo "Removing reintegrated '$entry{branch}' branch" + echo "Removing $reintegrated_word '$entry{branch}' branch" fi EOF @@ -157,7 +184,8 @@ sub parse_entry { s/^ // for @_; # revisions - $branch = sanitize_branch $1 if $_[0] =~ /^(\S*) branch$/; + $branch = sanitize_branch $1 + if $_[0] =~ /^(\S*) branch$/ or $_[0] =~ m#branches/(\S+)#; while ($_[0] =~ /^r/) { while ($_[0] =~ s/^r(\d+)(?:$|[,; ]+)//) { push @revisions, $1; @@ -195,11 +223,12 @@ sub parse_entry { } sub handle_entry { + my $in_approved = shift; my %entry = parse_entry @_; my @vetoes = grep { /^ -1:/ } @{$entry{votes}}; if ($YES) { - merge %entry unless @vetoes; + merge %entry if $in_approved and not @vetoes; } else { print ""; print "\n>>> The $entry{header}:"; @@ -212,7 +241,14 @@ sub handle_entry { print ""; print "Vetoes found!" if @vetoes; - merge %entry if prompt; + if (prompt 'Go ahead?') { + merge %entry; + system($ENV{SHELL} // "/bin/sh") == 0 + or warn "Creating an interactive subshell failed ($?): $!" + if prompt "Shall I open a subshell?"; + # Don't revert. The next merge() call will do that anyway, or maybe the + # user did in his interactive shell. + } } # TODO: merge() changes ./STATUS, which we're reading below, but @@ -232,17 +268,17 @@ sub main { # ### TODO: need to run 'revert' here # ### TODO: both here and in merge(), unlink files that previous merges added - die "Local mods to STATUS file $STATUS" if `$SVN status -q $STATUS`; + # When running from cron, there shouldn't be local mods. (For interactive + # usage, we preserve local mods to STATUS.) + die "Local mods to STATUS file $STATUS" if $YES and `$SVN status -q $STATUS`; # Skip most of the file while (<STATUS>) { - last if /^Approved changes/; - } - while (<STATUS>) { - last unless /^=+$/; + last if /^Status of \d+\.\d+/; } $/ = ""; # paragraph mode + my $in_approved = 0; while (<STATUS>) { my @lines = split /\n/; @@ -250,6 +286,7 @@ sub main { # Section header when (/^[A-Z].*:$/i) { print "\n\n=== $lines[0]" unless $YES; + $in_approved = $lines[0] =~ /^Approved changes/; } # Separator after section header when (/^=+$/i) { @@ -259,10 +296,10 @@ sub main { when (/^ \*/) { warn "Too many bullets in $lines[0]" and next if grep /^ \*/, @lines[1..$#lines]; - handle_entry @lines; + handle_entry $in_approved, @lines; } default { - warn "Unknown entry '$lines[0]' at $ARGV:$.\n"; + warn "Unknown entry '$lines[0]' at line $.\n"; } } } Modified: subversion/branches/fsfs-format7/tools/dist/release.py URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/tools/dist/release.py?rev=1476675&r1=1476674&r2=1476675&view=diff ============================================================================== --- subversion/branches/fsfs-format7/tools/dist/release.py (original) +++ subversion/branches/fsfs-format7/tools/dist/release.py Sat Apr 27 21:30:36 2013 @@ -448,7 +448,9 @@ def roll_tarballs(args): m.update(open(filename, 'r').read()) open(filename + '.sha1', 'w').write(m.hexdigest()) - shutil.move('svn_version.h.dist', get_deploydir(args.base_dir)) + shutil.move('svn_version.h.dist', + get_deploydir(args.base_dir) + '/' + 'svn_version.h.dist' + + '-' + str(args.version)) # And we're done! @@ -593,7 +595,8 @@ def move_to_dist(args): 'Publish Subversion-%s.' % str(args.version)] if (args.username): svnmucc_cmd += ['--username', args.username] - svnmucc_cmd += ['rm', dist_dev_url + '/' + 'svn_version.h.dist'] + svnmucc_cmd += ['rm', dist_dev_url + '/' + 'svn_version.h.dist' + + '-' + str(args.version)] for filename in filenames: svnmucc_cmd += ['mv', dist_dev_url + '/' + filename, dist_release_url + '/' + filename] @@ -633,7 +636,7 @@ def get_sha1info(args, replace=False): else: target = get_deploydir(args.base_dir) - sha1s = glob.glob(os.path.join(target, '*.sha1')) + sha1s = glob.glob(os.path.join(target, 'subversion*-%s*.sha1' % args.version)) class info(object): pass Modified: subversion/branches/fsfs-format7/tools/hook-scripts/control-chars.py URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/tools/hook-scripts/control-chars.py?rev=1476675&r1=1476674&r2=1476675&view=diff ============================================================================== --- subversion/branches/fsfs-format7/tools/hook-scripts/control-chars.py (original) +++ subversion/branches/fsfs-format7/tools/hook-scripts/control-chars.py Sat Apr 27 21:30:36 2013 @@ -53,7 +53,7 @@ def walk_tree(node, path, callback): "Walk NODE" if not node: return 0 - + ret_val = callback(node, path) if ret_val > 0: return ret_val @@ -67,10 +67,10 @@ def walk_tree(node, path, callback): ret_val = walk_tree(node, full_path, callback) # If we ran into an error just return up the stack all the way if ret_val > 0: - return ret_val + return ret_val node = node.sibling - return 0 + return 0 def usage(): sys.stderr.write("Invalid arguments, expects to be called like a pre-commit hook.") @@ -81,10 +81,10 @@ def main(ignored_pool, argv): return 2 repos_path = svn.core.svn_path_canonicalize(argv[1]) - txn_name = argv[2] - + txn_name = argv[2] + if not repos_path or not txn_name: - usage() + usage() return 2 repos = svn.repos.svn_repos_open(repos_path) @@ -92,7 +92,7 @@ def main(ignored_pool, argv): txn = svn.fs.svn_fs_open_txn(fs, txn_name) txn_root = svn.fs.svn_fs_txn_root(txn) base_rev = svn.fs.svn_fs_txn_base_revision(txn) - if base_rev is None or base_rev <= svn.core.SVN_INVALID_REVNUM: + if base_rev is None or base_rev <= svn.core.SVN_INVALID_REVNUM: sys.stderr.write("Transaction '%s' is not based on a revision" % txn_name) return 2 base_root = svn.fs.svn_fs_revision_root(fs, base_rev) Modified: subversion/branches/fsfs-format7/tools/hook-scripts/mailer/mailer.py URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/tools/hook-scripts/mailer/mailer.py?rev=1476675&r1=1476674&r2=1476675&view=diff ============================================================================== --- subversion/branches/fsfs-format7/tools/hook-scripts/mailer/mailer.py (original) +++ subversion/branches/fsfs-format7/tools/hook-scripts/mailer/mailer.py Sat Apr 27 21:30:36 2013 @@ -256,7 +256,7 @@ class MailedOutput(OutputBase): 'X-Svn-Commit-Author: %s\n' \ 'X-Svn-Commit-Revision: %d\n' \ 'X-Svn-Commit-Repository: %s\n' \ - % (self.from_addr, ', '.join(self.to_addrs), subject, + % (self.from_addr, ', '.join(self.to_addrs), subject, Utils.formatdate(), Utils.make_msgid(), group, self.repos.author or 'no_author', self.repos.rev, os.path.basename(self.repos.repos_dir)) Modified: subversion/branches/fsfs-format7/tools/hook-scripts/validate-files.py URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/tools/hook-scripts/validate-files.py?rev=1476675&r1=1476674&r2=1476675&view=diff ============================================================================== --- subversion/branches/fsfs-format7/tools/hook-scripts/validate-files.py (original) +++ subversion/branches/fsfs-format7/tools/hook-scripts/validate-files.py Sat Apr 27 21:30:36 2013 @@ -61,7 +61,7 @@ class Config(configparser.SafeConfigPars def get_rule_section_name(self, rule): """Given a rule name provide the section name it is defined in.""" - return 'rule:%s' % (rule) + return 'rule:%s' % (rule) class Commands: """Class to handle logic of running commands""" @@ -74,9 +74,9 @@ class Commands: cmd = "'%s' changed -t '%s' '%s'" % (svnlook, txn, repo) p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - - changed = [] - while True: + + changed = [] + while True: line = p.stdout.readline() if not line: break @@ -87,7 +87,7 @@ class Commands: if line[-1] != "/" and (text_mod == "A" or text_mod == "U"): changed.append(line[4:]) - # wait on the command to finish so we can get the + # wait on the command to finish so we can get the # returncode/stderr output data = p.communicate() if p.returncode != 0: @@ -127,7 +127,7 @@ def main(repo, txn): # this shouldn't ever happen if len(changed) == 0: sys.exit(0) - + for rule in rules: section = config.get_rule_section_name(rule) pattern = config.get(section, 'pattern') @@ -145,7 +145,7 @@ def main(repo, txn): sys.stderr.write(err_mesg) exitcode = 1 - return exitcode + return exitcode if __name__ == "__main__": if len(sys.argv) != 3: Modified: subversion/branches/fsfs-format7/tools/server-side/fsfs-stats.c URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/tools/server-side/fsfs-stats.c?rev=1476675&r1=1476674&r2=1476675&view=diff ============================================================================== --- subversion/branches/fsfs-format7/tools/server-side/fsfs-stats.c (original) +++ subversion/branches/fsfs-format7/tools/server-side/fsfs-stats.c Sat Apr 27 21:30:36 2013 @@ -101,11 +101,11 @@ typedef struct representation_t /* classification of the representation. values of rep_kind_t */ char kind; - + /* the source content has a PLAIN header, so we may simply copy the * source content into the target */ char is_plain; - + } representation_t; /* Represents a single revision. @@ -142,7 +142,7 @@ typedef struct revision_info_t /* total size of file noderevs (i.e. the structs - not the rep) */ apr_size_t file_noderev_size; - + /* all representation_t of this revision (in no particular order), * i.e. those that point back to this struct */ apr_array_header_t *representations; @@ -202,7 +202,7 @@ typedef struct histogram_line_t apr_int64_t sum; } histogram_line_t; -/* A histogram of 64 bit integer values. +/* A histogram of 64 bit integer values. */ typedef struct histogram_t { @@ -214,17 +214,17 @@ typedef struct histogram_t histogram_line_t lines[64]; } histogram_t; -/* Information we collect per file ending. +/* Information we collect per file ending. */ typedef struct extension_info_t { /* file extension, including leading "." * "(none)" in the container for files w/o extension. */ const char *extension; - + /* histogram of representation sizes */ histogram_t rep_histogram; - + /* histogram of sizes of changed files */ histogram_t node_histogram; } extension_info_t; @@ -387,7 +387,7 @@ get_content(svn_stringbuf_t **content, large_buffer_size), large_buffer_size); #endif - + SVN_ERR(svn_io_file_seek(file, APR_SET, &offset, pool)); SVN_ERR(svn_io_file_read_full2(file, (*content)->data, len, NULL, NULL, pool)); @@ -444,7 +444,7 @@ initialize_largest_changes(fs_fs_t *fs, apr_pool_t *pool) { apr_size_t i; - + fs->largest_changes = apr_pcalloc(pool, sizeof(*fs->largest_changes)); fs->largest_changes->count = count; fs->largest_changes->min_size = 1; @@ -640,12 +640,12 @@ read_revision_header(apr_size_t *changes char *space; apr_uint64_t val; apr_size_t len; - + /* Read in this last block, from which we will identify the last line. */ len = sizeof(buf); if (len > file_content->len) len = file_content->len; - + memcpy(buf, file_content->data + file_content->len - len, len); /* The last byte should be a newline. */ @@ -775,7 +775,7 @@ read_number(svn_revnum_t *result, const { svn_stringbuf_t *content; apr_uint64_t number; - + SVN_ERR(svn_stringbuf_from_file2(&content, path, pool)); content->data[content->len-1] = 0; @@ -869,7 +869,7 @@ find_representation(int *idx, /* not found -> no result */ if (info == NULL) return NULL; - + assert(revision == info->revision); /* look for the representation */ @@ -952,7 +952,7 @@ read_rep_base(representation_t **represe /* Parse the representation reference (text: or props:) in VALUE, look * it up in FS and return it in *REPRESENTATION. To be able to parse the * base rep, we pass the FILE_CONTENT as well. - * + * * If necessary, allocate the result in POOL; use SCRATCH_POOL for temp. * allocations. */ @@ -989,7 +989,7 @@ parse_representation(representation_t ** */ apr_size_t header_size; svn_boolean_t is_plain; - + result = apr_pcalloc(pool, sizeof(*result)); result->revision = revision; result->expanded_size = (apr_size_t)(expanded_size ? expanded_size : size); @@ -1004,7 +1004,7 @@ parse_representation(representation_t ** result->is_plain = is_plain; svn_sort__array_insert(&result, revision_info->representations, idx); } - + *representation = result; return SVN_NO_ERROR; @@ -1136,7 +1136,7 @@ get_combined_window(svn_stringbuf_t **co SVN_ERR(get_cached_window(content, fs, representation, pool)); if (*content) return SVN_NO_ERROR; - + /* read the delta windows for this representation */ sub_pool = svn_pool_create(pool); iter_pool = svn_pool_create(pool); @@ -1152,7 +1152,7 @@ get_combined_window(svn_stringbuf_t **co /* apply deltas */ result = svn_stringbuf_create_empty(pool); source = base_content->data; - + for (i = 0; i < windows->nelts; ++i) { svn_txdelta_window_t *window @@ -1173,7 +1173,7 @@ get_combined_window(svn_stringbuf_t **co /* cache result and return it */ SVN_ERR(set_cached_window(fs, representation, result, sub_pool)); *content = result; - + svn_pool_destroy(iter_pool); svn_pool_destroy(sub_pool); @@ -1225,7 +1225,7 @@ parse_dir(fs_fs_t *fs, /* calculate some invariants */ revision_key = apr_psprintf(text_pool, "r%ld/", representation->revision); key_len = strlen(revision_key); - + /* Parse and process all directory entries. */ while (*current != 'E') { @@ -1308,7 +1308,7 @@ read_noderev(fs_fs_t *fs, /* empty line -> end of noderev data */ if (line->len == 0) break; - + sep = strchr(line->data, ':'); if (sep == NULL) continue; @@ -1319,7 +1319,7 @@ read_noderev(fs_fs_t *fs, if (key.len + 2 > line->len) continue; - + value.data = sep + 2; value.len = line->len - (key.len + 2); @@ -1331,7 +1331,7 @@ read_noderev(fs_fs_t *fs, SVN_ERR(parse_representation(&text, fs, file_content, &value, revision_info, pool, scratch_pool)); - + /* if we are the first to use this rep, mark it as "text rep" */ if (++text->ref_count == 1) text->kind = is_dir ? dir_rep : file_rep; @@ -1357,7 +1357,7 @@ read_noderev(fs_fs_t *fs, if (props && props->ref_count == 1) add_change(fs, (apr_int64_t)props->size, (apr_int64_t)props->expanded_size, props->revision, path, props->kind); - + /* if this is a directory and has not been processed, yet, read and * process it recursively */ if (is_dir && text && text->ref_count == 1) @@ -1437,7 +1437,7 @@ read_pack_file(fs_fs_t *fs, { apr_size_t root_node_offset; svn_stringbuf_t *rev_content; - + /* create the revision info for the current rev */ revision_info_t *info = apr_pcalloc(pool, sizeof(*info)); info->representations = apr_array_make(iter_pool, 4, sizeof(representation_t*)); @@ -1452,13 +1452,13 @@ read_pack_file(fs_fs_t *fs, info->offset, info->end - info->offset, iter_pool)); - + SVN_ERR(read_revision_header(&info->changes, &info->changes_len, &root_node_offset, rev_content, iter_pool)); - + info->change_count = get_change_count(rev_content->data + info->changes, info->changes_len); @@ -1467,7 +1467,7 @@ read_pack_file(fs_fs_t *fs, info->representations = apr_array_copy(pool, info->representations); APR_ARRAY_PUSH(fs->revisions, revision_info_t*) = info; - + /* destroy temps */ svn_pool_clear(iter_pool); } @@ -1556,7 +1556,7 @@ read_revisions(fs_fs_t **fs, cache_config.cache_size = memsize * 1024 * 1024; svn_cache_config_set(&cache_config); - + SVN_ERR(fs_open(fs, path, pool)); /* create data containers and caches */ @@ -1599,7 +1599,7 @@ typedef struct rep_pack_stats_t /* total size after deltification (i.e. on disk size) */ apr_int64_t packed_size; - + /* total size after de-deltification (i.e. plain text size) */ apr_int64_t expanded_size; @@ -1614,13 +1614,13 @@ typedef struct representation_stats_t { /* stats over all representations */ rep_pack_stats_t total; - + /* stats over those representations with ref_count == 1 */ rep_pack_stats_t uniques; /* stats over those representations with ref_count > 1 */ rep_pack_stats_t shared; - + /* sum of all ref_counts */ apr_int64_t references; @@ -1635,7 +1635,7 @@ typedef struct node_stats_t { /* number of noderev structs */ apr_int64_t count; - + /* their total size on disk (structs only) */ apr_int64_t size; } node_stats_t; @@ -1647,7 +1647,7 @@ add_rep_pack_stats(rep_pack_stats_t *sta representation_t *rep) { stats->count++; - + stats->packed_size += rep->size; stats->expanded_size += rep->expanded_size; stats->overhead_size += rep->header_size + 7 /* ENDREP\n */; @@ -1706,7 +1706,7 @@ print_largest_reps(largest_changes_t *ch changes->changes[i]->path->data); } -/* Print the non-zero section of HISTOGRAM to console. +/* Print the non-zero section of HISTOGRAM to console. * Use POOL for allocations. */ static void @@ -1806,7 +1806,29 @@ get_by_extensions(fs_fs_t *fs, return result; } -/* Print the (up to) 16 extensions in FS with the most changes. +/* Add all extension_info_t* entries of TO_ADD not already in TARGET to + * TARGET. + */ +static void +merge_by_extension(apr_array_header_t *target, + apr_array_header_t *to_add) +{ + int i, k, count; + + count = target->nelts; + for (i = 0; i < to_add->nelts; ++i) + { + extension_info_t *info = APR_ARRAY_IDX(to_add, i, extension_info_t *); + for (k = 0; k < count; ++k) + if (info == APR_ARRAY_IDX(target, k, extension_info_t *)) + break; + + if (k == count) + APR_ARRAY_PUSH(target, extension_info_t*) = info; + } +} + +/* Print the (up to) 16 extensions in FS with the most changes. * Use POOL for allocations. */ static void @@ -1902,6 +1924,9 @@ print_histograms_by_extension(fs_fs_t *f apr_array_header_t *data = get_by_extensions(fs, compare_count, pool); int i; + merge_by_extension(data, get_by_extensions(fs, compare_node_size, pool)); + merge_by_extension(data, get_by_extensions(fs, compare_rep_size, pool)); + for (i = 0; i < data->nelts; ++i) { extension_info_t *info = APR_ARRAY_IDX(data, i, extension_info_t *); @@ -2147,7 +2172,7 @@ int main(int argc, const char *argv[]) printf("\n"); print_stats(fs, pool); - + if (svn_err) { svn_handle_error2(svn_err, stdout, FALSE, ERROR_TAG); Modified: subversion/branches/fsfs-format7/tools/server-side/mod_dontdothat/mod_dontdothat.c URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/tools/server-side/mod_dontdothat/mod_dontdothat.c?rev=1476675&r1=1476674&r2=1476675&view=diff ============================================================================== --- subversion/branches/fsfs-format7/tools/server-side/mod_dontdothat/mod_dontdothat.c (original) +++ subversion/branches/fsfs-format7/tools/server-side/mod_dontdothat/mod_dontdothat.c Sat Apr 27 21:30:36 2013 @@ -584,7 +584,8 @@ dontdothat_insert_filters(request_rec *r /* XXX is there a way to error out from this point? Would be nice... */ - err = svn_config_read2(&config, cfg->config_file, TRUE, FALSE, r->pool); + err = svn_config_read3(&config, cfg->config_file, TRUE, + FALSE, TRUE, r->pool); if (err) { char buff[256]; Modified: subversion/branches/fsfs-format7/tools/server-side/svnauthz.c URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/tools/server-side/svnauthz.c?rev=1476675&r1=1476674&r2=1476675&view=diff ============================================================================== --- subversion/branches/fsfs-format7/tools/server-side/svnauthz.c (original) +++ subversion/branches/fsfs-format7/tools/server-side/svnauthz.c Sat Apr 27 21:30:36 2013 @@ -65,7 +65,7 @@ static const apr_getopt_option_t options " " " rw write access (which also implies read)\n" " " - " r read-only access\n" + " r read-only access\n" " " " no no access\n") }, @@ -268,7 +268,7 @@ get_authz(svn_authz_t **authz, struct sv /* Else */ return svn_repos_authz_read2(authz, opt_state->authz_file, opt_state->groups_file, - TRUE, NULL, pool); + TRUE, pool); } static svn_error_t * @@ -341,7 +341,7 @@ subcommand_accessof(apr_getopt_t *os, vo /* Check that --is argument matches. * The errors returned here are not strictly correct, but * none of the other code paths will generate them and they - * roughly mean what we're saying here. */ + * roughly mean what we're saying here. */ if (check_rw && !write_access) err = svn_error_createf(SVN_ERR_AUTHZ_UNWRITABLE, NULL, ("%s is '%s', not writable"), @@ -584,7 +584,7 @@ sub_main(int argc, const char *argv[], a if (opt_state.version) { /* Use the "help" subcommand to handle the "--version" option. */ - static const svn_opt_subcommand_desc2_t pseudo_cmd = + static const svn_opt_subcommand_desc2_t pseudo_cmd = { "--version", subcommand_help, {0}, "", {svnauthz__version /* must accept its own option */ } }; @@ -631,7 +631,7 @@ sub_main(int argc, const char *argv[], a err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, ("Repository and authz file arguments " "required")); - return EXIT_ERROR(err, EXIT_FAILURE); + return EXIT_ERROR(err, EXIT_FAILURE); } SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_state.repos_path, os->argv[os->ind], @@ -646,7 +646,7 @@ sub_main(int argc, const char *argv[], a { err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, ("Authz file argument required")); - return EXIT_ERROR(err, EXIT_FAILURE); + return EXIT_ERROR(err, EXIT_FAILURE); } /* Grab AUTHZ_FILE from argv. */ @@ -725,7 +725,7 @@ sub_main(int argc, const char *argv[], a * match. */ return EXIT_ERROR(err, 3); } - + return EXIT_ERROR(err, EXIT_FAILURE); } Modified: subversion/branches/fsfs-format7/tools/server-side/svnpubsub/commit-hook.py URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/tools/server-side/svnpubsub/commit-hook.py?rev=1476675&r1=1476674&r2=1476675&view=diff ============================================================================== --- subversion/branches/fsfs-format7/tools/server-side/svnpubsub/commit-hook.py (original) +++ subversion/branches/fsfs-format7/tools/server-side/svnpubsub/commit-hook.py Sat Apr 27 21:30:36 2013 @@ -51,14 +51,14 @@ def svncmd_info(repo, revision): def svncmd_changed(repo, revision): cmd = "%s changed -r %s %s" % (SVNLOOK, revision, repo) p = svncmd(cmd) - changed = {} + changed = {} while True: line = p.stdout.readline() if not line: break line = line.strip() (flags, filename) = (line[0:3], line[4:]) - changed[filename] = {'flags': flags} + changed[filename] = {'flags': flags} return changed def do_put(body): Modified: subversion/branches/fsfs-format7/tools/server-side/svnpubsub/irkerbridge.py URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/tools/server-side/svnpubsub/irkerbridge.py?rev=1476675&r1=1476674&r2=1476675&view=diff ============================================================================== --- subversion/branches/fsfs-format7/tools/server-side/svnpubsub/irkerbridge.py (original) +++ subversion/branches/fsfs-format7/tools/server-side/svnpubsub/irkerbridge.py Sat Apr 27 21:30:36 2013 @@ -30,7 +30,7 @@ # Space separated list of URLs to streams. # This option should only be in the DEFAULT section, is ignored in # all other sections. -# irker=hostname:port +# irker=hostname:port # The hostname/port combination of the irker daemon. If port is # omitted it defaults to 6659. Irker is connected to over UDP. # match=What to use to decide if the commit should be sent to irker. @@ -42,7 +42,7 @@ # Space separated list of URLs (any URL that Irker will accept) to # send the resulting message to. At current Irker only supports IRC. # template=string -# A string to use to format the output. The string is a Python +# A string to use to format the output. The string is a Python # string Template. The following variables are available: # $committer, $id, $date, $repository, $log, $log_firstline, # $log_firstparagraph, $dirs_changed, $dirs_count, $dirs_count_s, @@ -61,13 +61,13 @@ # section other than the [DEFAULT] section consists of a configuration that # may match and send a message to irker to deliver. All matching sections # will generate a message. -# +# # Interpolation of values within the config file is allowed by including # %(name)s within a value. For example I can reference the UUID of a repo # repeatedly by doing: # [DEFAULT] # ASF_REPO=13f79535-47bb-0310-9956-ffa450edef68 -# +# # [#commits] # match=%(ASF_REPO)s/ # @@ -143,7 +143,7 @@ class BigDoEverythingClass(object): if hasattr(commit, 'dirs_changed') or not hasattr(commit, 'changed'): return - dirs_changed = set() + dirs_changed = set() for p in commit.changed: if p[-1] == '/' and commit.changed[p]['flags'][1] == 'U': # directory with property changes add the directory itself. @@ -302,14 +302,14 @@ def main(args): logfile = os.path.abspath(options.logfile) else: parser.error('LOGFILE is required when running as a daemon') - + if options.pidfile: pidfile = os.path.abspath(options.pidfile) else: parser.error('PIDFILE is required when running as a daemon') - config = ReloadableConfig(config_file) + config = ReloadableConfig(config_file) bdec = BigDoEverythingClass(config, options) d = Daemon(logfile, pidfile, bdec) Modified: subversion/branches/fsfs-format7/tools/server-side/svnpubsub/svnpubsub/client.py URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/tools/server-side/svnpubsub/svnpubsub/client.py?rev=1476675&r1=1476674&r2=1476675&view=diff ============================================================================== --- subversion/branches/fsfs-format7/tools/server-side/svnpubsub/svnpubsub/client.py (original) +++ subversion/branches/fsfs-format7/tools/server-side/svnpubsub/svnpubsub/client.py Sat Apr 27 21:30:36 2013 @@ -94,7 +94,7 @@ class Client(asynchat.async_chat): except: self.handle_error() return - + self.push(('GET %s HTTP/1.0\r\n\r\n' % resource).encode('ascii')) def handle_connect(self): @@ -123,7 +123,7 @@ class Client(asynchat.async_chat): self.last_activity = time.time() if not self.skipping_headers: - self.ibuffer.append(data) + self.ibuffer.append(data) class JSONRecordHandler: Modified: subversion/branches/fsfs-format7/tools/server-side/svnpubsub/svnpubsub/server.py URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/tools/server-side/svnpubsub/svnpubsub/server.py?rev=1476675&r1=1476674&r2=1476675&view=diff ============================================================================== --- subversion/branches/fsfs-format7/tools/server-side/svnpubsub/svnpubsub/server.py (original) +++ subversion/branches/fsfs-format7/tools/server-side/svnpubsub/svnpubsub/server.py Sat Apr 27 21:30:36 2013 @@ -36,7 +36,7 @@ # # URL is built into 2 parts: # /commits/${optional_type}/${optional_repository} -# +# # If the type is included in the URL, you will only get commits of that type. # The type can be * and then you will receive commits of any type. # @@ -82,7 +82,7 @@ class Commit: raise ValueError('Invalid Format Value') if not self.check_value('id'): raise ValueError('Invalid ID Value') - + def check_value(self, k): return hasattr(self, k) and self.__dict__[k] @@ -130,7 +130,7 @@ class Client(object): if self.repository and self.repository != commit.repository: return False - return True + return True def notify(self, data): self.write(data) @@ -173,18 +173,18 @@ class SvnPubSub(resource.Resource): log.msg("REQUEST: %s" % (request.uri)) request.setHeader('content-type', 'text/plain') - repository = None - type = None + repository = None + type = None uri = request.uri.split('/') uri_len = len(uri) - if uri_len < 2 or uri_len > 4: + if uri_len < 2 or uri_len > 4: request.setResponseCode(400) return "Invalid path\n" - if uri_len >= 3: + if uri_len >= 3: type = uri[2] - + if uri_len == 4: repository = uri[3] Modified: subversion/branches/fsfs-format7/tools/server-side/svnpubsub/svntweet.py URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/tools/server-side/svnpubsub/svntweet.py?rev=1476675&r1=1476674&r2=1476675&view=diff ============================================================================== --- subversion/branches/fsfs-format7/tools/server-side/svnpubsub/svntweet.py (original) +++ subversion/branches/fsfs-format7/tools/server-side/svnpubsub/svntweet.py Sat Apr 27 21:30:36 2013 @@ -93,7 +93,7 @@ class JSONRecordHandler: obj = json.loads(record) if 'svnpubsub' in obj: actual_version = obj['svnpubsub'].get('version') - EXPECTED_VERSION = 1 + EXPECTED_VERSION = 1 if actual_version != EXPECTED_VERSION: raise ValueException("Unknown svnpubsub format: %r != %d" % (actual_format, expected_format)) @@ -207,7 +207,7 @@ class BigDoEverythingClasss(object): if path[0:1] == '/' and len(path) > 1: path = path[1:] - #TODO: allow URL to be configurable. + #TODO: allow URL to be configurable. link = " - http://svn.apache.org/r%d" % (commit.id) left -= len(link) msg = "r%d in %s by %s: " % (commit.id, path, commit.committer) Modified: subversion/branches/fsfs-format7/tools/server-side/svnpubsub/svnwcsub.py URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/tools/server-side/svnpubsub/svnwcsub.py?rev=1476675&r1=1476674&r2=1476675&view=diff ============================================================================== --- subversion/branches/fsfs-format7/tools/server-side/svnpubsub/svnwcsub.py (original) +++ subversion/branches/fsfs-format7/tools/server-side/svnpubsub/svnwcsub.py Sat Apr 27 21:30:36 2013 @@ -452,7 +452,7 @@ def prepare_logging(logfile): # Apply the handler to the root logger root = logging.getLogger() root.addHandler(handler) - + ### use logging.INFO for now. switch to cmdline option or a config? root.setLevel(logging.INFO) Modified: subversion/branches/fsfs-format7/win-tests.py URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/win-tests.py?rev=1476675&r1=1476674&r2=1476675&view=diff ============================================================================== --- subversion/branches/fsfs-format7/win-tests.py (original) +++ subversion/branches/fsfs-format7/win-tests.py Sat Apr 27 21:30:36 2013 @@ -364,8 +364,12 @@ def locate_libs(): 'mod_dav_svn', 'mod_dav_svn.so') mod_authz_svn_path = os.path.join(abs_objdir, 'subversion', 'mod_authz_svn', 'mod_authz_svn.so') + mod_dontdothat_path = os.path.join(abs_objdir, 'tools', 'server-side', + 'mod_dontdothat', 'mod_dontdothat.so') + copy_changed_file(mod_dav_svn_path, abs_objdir) copy_changed_file(mod_authz_svn_path, abs_objdir) + copy_changed_file(mod_dontdothat_path, abs_objdir) os.environ['PATH'] = abs_objdir + os.pathsep + os.environ['PATH'] @@ -471,6 +475,9 @@ class Httpd: self.authz_file = os.path.join(abs_builddir, CMDLINE_TEST_SCRIPT_NATIVE_PATH, 'svn-test-work', 'authz') + self.dontdothat_file = os.path.join(abs_builddir, + CMDLINE_TEST_SCRIPT_NATIVE_PATH, + 'svn-test-work', 'dontdothat') self.httpd_config = os.path.join(self.root, 'httpd.conf') self.httpd_users = os.path.join(self.root, 'users') self.httpd_mime_types = os.path.join(self.root, 'mime.types') @@ -488,6 +495,7 @@ class Httpd: self._create_users_file() self._create_mime_types_file() + self._create_dontdothat_file() # Determine version. if os.path.exists(os.path.join(self.httpd_dir, @@ -514,7 +522,7 @@ class Httpd: fp.write('PidFile pid\n') fp.write('ErrorLog log\n') fp.write('Listen ' + str(self.httpd_port) + '\n') - + if not no_log: fp.write('LogFormat "%h %l %u %t \\"%r\\" %>s %b" common\n') fp.write('Customlog log common\n') @@ -542,6 +550,9 @@ class Httpd: fp.write(self._svn_module('dav_svn_module', 'mod_dav_svn.so')) fp.write(self._svn_module('authz_svn_module', 'mod_authz_svn.so')) + # And for mod_dontdothat + fp.write(self._svn_module('dontdothat_module', 'mod_dontdothat.so')) + # Don't handle .htaccess, symlinks, etc. fp.write('<Directory />\n') fp.write('AllowOverride None\n') @@ -587,6 +598,13 @@ class Httpd: fp = open(self.httpd_mime_types, 'w') fp.close() + def _create_dontdothat_file(self): + "Create empty mime.types file" + fp = open(self.dontdothat_file, 'w') + fp.write('[recursive-actions]\n') + fp.write('/ = deny\n') + fp.close() + def _sys_module(self, name, path): full_path = os.path.join(self.httpd_dir, 'modules', path) return 'LoadModule ' + name + " " + self._quote(full_path) + '\n' @@ -600,6 +618,7 @@ class Httpd: CMDLINE_TEST_SCRIPT_NATIVE_PATH, 'svn-test-work', name) location = '/svn-test-work/' + name + ddt_location = '/ddt-test-work/' + name return \ '<Location ' + location + '>\n' \ ' DAV svn\n' \ @@ -612,6 +631,19 @@ class Httpd: ' AuthName "Subversion Repository"\n' \ ' AuthUserFile ' + self._quote(self.httpd_users) + '\n' \ ' Require valid-user\n' \ + '</Location>\n' \ + '<Location ' + ddt_location + '>\n' \ + ' DAV svn\n' \ + ' SVNParentPath ' + self._quote(path) + '\n' \ + ' SVNAdvertiseV2Protocol ' + self.httpv2_option + '\n' \ + ' SVNPathAuthz ' + self.path_authz_option + '\n' \ + ' SVNAllowBulkUpdates ' + self.bulkupdates_option + '\n' \ + ' AuthzSVNAccessFile ' + self._quote(self.authz_file) + '\n' \ + ' AuthType Basic\n' \ + ' AuthName "Subversion Repository"\n' \ + ' AuthUserFile ' + self._quote(self.httpd_users) + '\n' \ + ' Require valid-user\n' \ + ' DontDoThatConfigFile ' + self._quote(self.dontdothat_file) + '\n' \ '</Location>\n' def start(self):
