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

Re: svn commit: r28280 - in trunk/subversion: include libsvn_wc svnversion tests/cmdline

From: David Glasser <glasser_at_davidglasser.net>
Date: 2007-12-05 20:42:36 CET

On Dec 5, 2007 11:33 AM, <dlr@tigris.org> wrote:
> Author: dlr
> Date: Wed Dec 5 11:33:17 2007
> New Revision: 28280
>
> Log:
> Add a "sparse_checkout" flag to the svn_wc_revision_status_t
> structure, and expose it as new "P" output from the 'svnversion'
> command (e.g. "37P" means a partial checkout of r37).
>
> * subversion/svnversion/main.c
> (help): Include documentation for the new "P" (sParse checkout) output.
> (main): Append "P" to the outout when the sparse_checkout field of
                              output
> the revision status is set.
>
> * subversion/include/svn_wc.h
> (svn_wc_revision_status_t): Document that this structure now
> represents a WC summary, rather than solely the mix of revisions
> found in the WC (meaning that it's now somewhat mis-named). Add a
> new "sparse_checkout" field.
>
> * subversion/libsvn_wc/revision_status.c
> (analyze_status): Set BATON->result->sparse_checkout when
> STATUS->entry->depth is other than infinity.
> (svn_wc_revision_status): Initialize *RESULT_P->sparse_checkout to FALSE.
>
> * subversion/tests/cmdline/svnversion_tests.py
> (svnversion_test): Include test for the "sParse checkout" output.
>
>
> Modified:
> trunk/subversion/include/svn_wc.h
> trunk/subversion/libsvn_wc/revision_status.c
> trunk/subversion/svnversion/main.c
> trunk/subversion/tests/cmdline/svnversion_tests.py
>
> Modified: trunk/subversion/include/svn_wc.h
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/include/svn_wc.h?pathrev=28280&r1=28279&r2=28280
> ==============================================================================
> --- trunk/subversion/include/svn_wc.h (original)
> +++ trunk/subversion/include/svn_wc.h Wed Dec 5 11:33:17 2007
> @@ -4482,8 +4482,9 @@
> apr_pool_t *pool);
>
>
> -/** A structure to report the mix of revisions found within a working copy,
> - * and whether any parts are switched or locally modified.
> +/** A structure to report a summary of a working copy, including the
> + * mix of revisions found within it, whether any parts are switched or
> + * locally modified, and whether it is a sparse checkout.
> *
> * @note Fields may be added to the end of this structure in future
> * versions. Therefore, to preserve binary compatibility, users
> @@ -4498,6 +4499,11 @@
>
> svn_boolean_t switched; /**< Is anything switched? */
> svn_boolean_t modified; /**< Is anything modified? */
> +
> + /** Whether any WC paths are at a depth other than @c svn_depth_infinity.
> + * @since New in 1.5.
> + */
> + svn_boolean_t sparse_checkout;
> }
> svn_wc_revision_status_t;
>
>
> Modified: trunk/subversion/libsvn_wc/revision_status.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/revision_status.c?pathrev=28280&r1=28279&r2=28280
> ==============================================================================
> --- trunk/subversion/libsvn_wc/revision_status.c (original)
> +++ trunk/subversion/libsvn_wc/revision_status.c Wed Dec 5 11:33:17 2007
> @@ -63,6 +63,7 @@
> sb->result->modified |= (status->text_status != svn_wc_status_normal);
> sb->result->modified |= (status->prop_status != svn_wc_status_normal
> && status->prop_status != svn_wc_status_none);
> + sb->result->sparse_checkout |= (status->entry->depth == svn_depth_infinity);

I think this wants to be != . (Do the svnversion tests other than the
one you added pass? I'd think that this would add the 'P' most of the
time...)

>
> if (sb->wc_path
> && (! sb->wc_url)
> @@ -94,6 +95,7 @@
> result->max_rev = SVN_INVALID_REVNUM;
> result->switched = FALSE;
> result->modified = FALSE;
> + result->sparse_checkout = FALSE;
>
> /* initialize walking baton */
> sb.result = result;
>
> Modified: trunk/subversion/svnversion/main.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/svnversion/main.c?pathrev=28280&r1=28279&r2=28280
> ==============================================================================
> --- trunk/subversion/svnversion/main.c (original)
> +++ trunk/subversion/svnversion/main.c Wed Dec 5 11:33:17 2007
> @@ -66,6 +66,7 @@
> " 4123:4168 mixed revision working copy\n"
> " 4168M modified working copy\n"
> " 4123S switched working copy\n"
> + " 4123P partial working copy, from a sparse checkout\n"
> " 4123:4168MS mixed revision, modified, switched working copy\n"
> "\n"
> " If invoked on a directory that is not a working copy, an\n"
> @@ -247,6 +248,8 @@
> SVN_INT_ERR(svn_cmdline_fputs("M", stdout, pool));
> if (res->switched)
> SVN_INT_ERR(svn_cmdline_fputs("S", stdout, pool));
> + if (res->sparse_checkout)
> + SVN_INT_ERR(svn_cmdline_fputs("P", stdout, pool));
>
> if (! no_newline)
> SVN_INT_ERR(svn_cmdline_fputs("\n", stdout, pool));
>
> Modified: trunk/subversion/tests/cmdline/svnversion_tests.py
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/tests/cmdline/svnversion_tests.py?pathrev=28280&r1=28279&r2=28280
> ==============================================================================
> --- trunk/subversion/tests/cmdline/svnversion_tests.py (original)
> +++ trunk/subversion/tests/cmdline/svnversion_tests.py Wed Dec 5 11:33:17 2007
> @@ -119,6 +119,26 @@
> repo_url,
> None, svntest.verify.AnyOutput)
>
> + # Perform a sparse checkout of under the existing WC, and confirm that
> + # svnversion detects it as a "partial" WC.
> + A_path = os.path.join(wc_dir, "A")
> + A_A_path = os.path.join(A_path, "SPARSE_A")
> + expected_output = wc.State(A_path, {
> + "SPARSE_A" : Item(),
> + "SPARSE_A/mu" : Item(status='A '),
> + })
> + expected_disk = wc.State("", {
> + "mu" : Item(expected_disk.desc['A/mu'].contents),
> + })
> + svntest.actions.run_and_verify_checkout(repo_url + "/A", A_A_path,
> + expected_output, expected_disk,
> + None, None, None, None,
> + "--depth=files")
> +
> + # Partial (sparse) checkout
> + svntest.actions.run_and_verify_svnversion("Sparse checkout", A_A_path,
> + repo_url, [ "2S\n" ], [])

And so I guess this wants to be 2SP. (I think the S is coming from
the fact that SPARSE_A is "switched" with respect to A.)

--dave

-- 
David Glasser | glasser_at_davidglasser.net | http://www.davidglasser.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Dec 5 20:42:49 2007

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