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

Re: CVS update: MODIFIED: libsvn_fs ...

From: Karl Fogel <kfogel_at_collab.net>
Date: 2001-06-15 00:24:34 CEST

Sorry, I don't know why this didn't have a log message -- I think I
specified the wrong file with cvs -F or something. Anyway, it was:

   * subversion/libsvn_fs/reps-table.h (svn_fs__write_rep,
   svn_fs__write_new_rep): Prototype fixes.
   
   * subversion/libsvn_fs/reps-table.c (svn_fs__write_new_rep):
   Implement.
   (svn_fs__open_reps_table): Initialize the "next-key" entry.
   
   * subversion/libsvn_fs/strings-table.h (svn_fs__new_string_stream):
   New func.
   
   * subversion/libsvn_fs/strings-table.c (svn_fs__new_string_stream):
   Implement.
   
   * subversion/libsvn_fs/key-gen.h (svn_fs__next_key_key): Replaces
   `next_key_key', doc fix. All references changed.
   
   
   New tests for strings and representations interfaces:
   
   * subversion/tests/libsvn_fs/strings-reps-test.c: New file.
   
   * build.conf (strings-reps-test): New target.

And I will try to make this happen in the repository post-facto, now.

-K

kfogel@tigris.org writes:
> Modified: subversion/tests/libsvn_fs run-fs-tests.sh
> Log:
>
>
> Revision Changes Path
> 1.17 +12 -0 subversion/build.conf
>
> http://subversion.tigris.org/source/browse/subversion/build.conf.diff?r1=1.16&r2=1.17
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: build.conf
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/build.conf,v
> retrieving revision 1.16
> retrieving revision 1.17
> diff -u -b -r1.16 -r1.17
> --- build.conf 2001/06/11 16:10:49 1.16
> +++ build.conf 2001/06/14 16:28:56 1.17
> @@ -212,6 +212,18 @@
> install = test
> group = fs-programs
> libs = libsvn_test libsvn_fs libsvn_delta libsvn_subr $(SVN_APR_LIBS) libexpat
> +# run-fs-tests.sh will run this for us
> +testing = skip
> +
> +[strings-reps-test]
> +type = exe
> +path = subversion/tests/libsvn_fs
> +sources = strings-reps-test.c
> +install = test
> +group = fs-programs
> +libs = libsvn_test libsvn_test_fs libsvn_fs libsvn_delta libsvn_subr
> + $(SVN_APR_LIBS) libexpat
> +# run-fs-tests.sh will run this for us
> testing = skip
>
> [ra-local-test]
>
>
>
> 1.2 +1 -1 subversion/subversion/libsvn_fs/key-gen.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_fs/key-gen.c.diff?r1=1.1&r2=1.2
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: key-gen.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_fs/key-gen.c,v
> retrieving revision 1.1
> retrieving revision 1.2
> diff -u -b -r1.1 -r1.2
> --- key-gen.c 2001/06/08 20:27:32 1.1
> +++ key-gen.c 2001/06/14 16:28:57 1.2
> @@ -110,7 +110,7 @@
>
> /*** Keys for reps and strings. ***/
>
> -static const char next_key_key[] = "next-key";
> +const char svn_fs__next_key_key[] = "next-key";
>
>
> void
>
>
>
> 1.2 +2 -2 subversion/subversion/libsvn_fs/key-gen.h
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_fs/key-gen.h.diff?r1=1.1&r2=1.2
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: key-gen.h
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_fs/key-gen.h,v
> retrieving revision 1.1
> retrieving revision 1.2
> diff -u -b -r1.1 -r1.2
> --- key-gen.h 2001/06/08 20:27:32 1.1
> +++ key-gen.h 2001/06/14 16:28:57 1.2
> @@ -37,8 +37,8 @@
>
>
> /* In the `representations' and `strings', the value at this key is
> - the key to use when next storing a rep or string. */
> -extern const char next_key_key[];
> + the key to use when storing a new rep or string. */
> +extern const char svn_fs__next_key_key[];
>
>
> /* Generate the next key after a given alphanumeric key.
>
>
>
> 1.2 +84 -0 subversion/subversion/libsvn_fs/reps-table.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_fs/reps-table.c.diff?r1=1.1&r2=1.2
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: reps-table.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_fs/reps-table.c,v
> retrieving revision 1.1
> retrieving revision 1.2
> diff -u -b -r1.1 -r1.2
> --- reps-table.c 2001/06/08 00:56:48 1.1
> +++ reps-table.c 2001/06/14 16:28:57 1.2
> @@ -19,6 +19,7 @@
> #include "trail.h"
> #include "strings-table.h"
> #include "reps-table.h"
> +#include "key-gen.h"
>
>
>
> @@ -36,6 +37,18 @@
> create ? (DB_CREATE | DB_EXCL) : 0,
> 0666));
>
> + /* Create the `next-key' table entry. */
> + if (create)
> + {
> + DBT key, value;
> +
> + DB_ERR (reps->put
> + (reps, 0,
> + svn_fs__str_to_dbt (&key, (char *) svn_fs__next_key_key),
> + svn_fs__str_to_dbt (&value, (char *) "0"),
> + 0));
> + }
> +
> *reps_p = reps;
> return 0;
> }
> @@ -87,11 +100,82 @@
> {
> DBT query, result;
>
> + svn_stringbuf_t *s = svn_fs__unparse_skel (skel, trail->pool);
> + /* printf ("kff key sez \"%s\"\n", key); */
> + /* printf ("kff stringbuf sez \"%s\"\n", s->data); */
> +
> SVN_ERR (DB_WRAP (fs, "storing representation",
> fs->representations->put
> (fs->representations, trail->db_txn,
> svn_fs__str_to_dbt (&query, (char *) key),
> svn_fs__skel_to_dbt (&result, skel, trail->pool), 0)));
> +
> + return SVN_NO_ERROR;
> +}
> +
> +
> +svn_error_t *
> +svn_fs__write_new_rep (char **key,
> + svn_fs_t *fs,
> + skel_t *skel,
> + trail_t *trail)
> +{
> + DBT query, result;
> + int db_err;
> + apr_size_t len;
> + char next_key[200]; /* This will be a problem if the number of
> + representations in a filesystem ever
> + exceeds 1821797716821872825139468712408937
> + 126733897152817476066745969754933395997209
> + 053270030282678007662838673314795994559163
> + 674524215744560596468010549540621501770423
> + 499988699078859474399479617124840673097380
> + 736524850563115569208508785942830080999927
> + 310762507339484047393505519345657439796788
> + 24151197232629947748581376. Somebody warn
> + my grandchildren. */
> +
> + /* printf ("kff a\n"); */
> + /* Get the current value associated with `next-key'. */
> + svn_fs__str_to_dbt (&query, (char *) svn_fs__next_key_key);
> + /* printf ("kff b\n"); */
> + SVN_ERR (DB_WRAP (fs, "allocating new representation (getting next-key)",
> + fs->representations->get (fs->representations,
> + trail->db_txn,
> + &query,
> + svn_fs__result_dbt (&result),
> + 0)));
> + /* printf ("kff c\n"); */
> + svn_fs__track_dbt (&result, trail->pool);
> +
> + /* Store the new rep skel. */
> + /* printf ("kff d\n"); */
> + *key = apr_pstrndup (trail->pool, result.data, result.size);
> + /* printf ("kff e\n"); */
> +
> + {
> + svn_stringbuf_t *s;
> + /* printf ("kff ee\n"); */
> + s = svn_fs__unparse_skel (skel, trail->pool);
> + /* printf ("kff caller stringbuf sez \"%s\"\n", s->data); */
> + /* printf ("kff caller key sez \"%s\"\n", *key); */
> + }
> +
> + SVN_ERR (svn_fs__write_rep (fs, *key, skel, trail));
> +
> + /* Bump to future key. */
> + len = result.size;
> + /* printf ("kff f\n"); */
> + svn_fs__next_key (result.data, &len, next_key);
> + /* printf ("kff g\n"); */
> + db_err = fs->representations->put
> + (fs->representations, trail->db_txn,
> + svn_fs__str_to_dbt (&query, (char *) svn_fs__next_key_key),
> + svn_fs__str_to_dbt (&result, (char *) next_key),
> + 0);
> + /* printf ("kff h\n"); */
> + SVN_ERR (DB_WRAP (fs, "bumping next representation key", db_err));
> + /* printf ("kff i\n"); */
>
> return SVN_NO_ERROR;
> }
>
>
>
> 1.3 +6 -6 subversion/subversion/libsvn_fs/reps-table.h
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_fs/reps-table.h.diff?r1=1.2&r2=1.3
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: reps-table.h
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_fs/reps-table.h,v
> retrieving revision 1.2
> retrieving revision 1.3
> diff -u -b -r1.2 -r1.3
> --- reps-table.h 2001/06/08 20:27:32 1.2
> +++ reps-table.h 2001/06/14 16:28:57 1.3
> @@ -47,20 +47,20 @@
> /* Store SKEL as the representation for KEY in FS, as part of
> TRAIL. Do any necessary temporary allocation in TRAIL->pool. */
> svn_error_t *svn_fs__write_rep (svn_fs_t *fs,
> - const char *id,
> + const char *key,
> skel_t *skel,
> trail_t *trail);
>
>
> -/* Store SKEL as the representation for KEY in FS, as part of
> - TRAIL. Do any necessary temporary allocation in TRAIL->pool. */
> -svn_error_t *svn_fs__write_new_rep (svn_fs_t *fs,
> - char **id,
> +/* Store SKEL as a new representation in FS, and the new rep's key in
> + *KEY, as part of trail. The new key is allocated in TRAIL->pool. */
> +svn_error_t *svn_fs__write_new_rep (char **key,
> + svn_fs_t *fs,
> skel_t *skel,
> trail_t *trail);
>
> /* Delete representation KEY from FS, as part of TRAIL.
> - WARNING: This does not ensure that no nodes refer to the
> + WARNING: This does not ensure that no one references this
> representation! Callers should ensure that themselves. */
> svn_error_t *svn_fs__delete_rep (svn_fs_t *fs,
> const char *key,
>
>
>
> 1.5 +11 -0 subversion/subversion/libsvn_fs/strings-table.h
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_fs/strings-table.h.diff?r1=1.4&r2=1.5
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: strings-table.h
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_fs/strings-table.h,v
> retrieving revision 1.4
> retrieving revision 1.5
> diff -u -b -r1.4 -r1.5
> --- strings-table.h 2001/05/10 16:18:30 1.4
> +++ strings-table.h 2001/06/14 16:28:57 1.5
> @@ -79,6 +79,17 @@
> trail_t *trail);
>
>
> +/* Set *STREAM to a write stream for a new string in FS, as part of
> + * TRAIL. Store the new string's key in *KEY.
> + *
> + * Allocate the stream and the new key in TRAIL->pool.
> + */
> +svn_error_t *svn_fs__new_string_stream (const char *key,
> + svn_stream_t **stream,
> + svn_fs_t *fs,
> + trail_t *trail);
> +
> +
> /* Set *STREAM to an appending write stream for string KEY in FS, as
> * part of TRAIL.
> *
>
>
>
> 1.13 +6 -0 subversion/subversion/svnadmin/main.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/svnadmin/main.c.diff?r1=1.12&r2=1.13
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: main.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/svnadmin/main.c,v
> retrieving revision 1.12
> retrieving revision 1.13
> diff -u -b -r1.12 -r1.13
> --- main.c 2001/06/08 21:31:22 1.12
> +++ main.c 2001/06/14 16:28:57 1.13
> @@ -100,6 +100,12 @@
> " - lstxn REPOS_PATH\n"
> " Print all txns and their trees.\n"
> "\n"
> + " - lsreps REPOS_PATH\n"
> + " Print all representations.\n"
> + "\n"
> + " - lsstrings REPOS_PATH\n"
> + " Print all string lengths.\n"
> + "\n"
> " - lsrevs REPOS_PATH [LOWER_REV [UPPER_REV]]\n"
> " If no revision is given, all revision trees are printed.\n"
> " If just LOWER_REV is given, that revision tree is printed.\n"
>
>
>
> 1.7 +1 -1 subversion/subversion/tests/libsvn_fs/run-fs-tests.sh
>
> http://subversion.tigris.org/source/browse/subversion/subversion/tests/libsvn_fs/run-fs-tests.sh.diff?r1=1.6&r2=1.7
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: run-fs-tests.sh
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/tests/libsvn_fs/run-fs-tests.sh,v
> retrieving revision 1.6
> retrieving revision 1.7
> diff -u -b -r1.6 -r1.7
> --- run-fs-tests.sh 2001/06/08 20:27:32 1.6
> +++ run-fs-tests.sh 2001/06/14 16:28:57 1.7
> @@ -6,7 +6,7 @@
> rm -fr test-repo-*;
> fi
>
> -for test_pgm in key-test skel-test fs-test; do
> +for test_pgm in key-test skel-test strings-reps-test fs-test; do
> echo " - running all sub-tests in $test_pgm ..."
> ./$test_pgm
> done
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cvs-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: cvs-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:32 2006

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