Julian Foad wrote:
> I was puzzled by this pair of lines in
> subversion/clients/cmdline/status-cmd.c:
>
> /* We want our -u statuses to be against HEAD. */
> rev.kind = svn_opt_revision_unspecified;
...
> The command-line client specifically passes svn_opt_revision_unspecified
> as the "revision" parameter to svn_client_status when it really wants
> HEAD. I think this is because it knows that a network round-trip will
> be avoided; if it had asked for HEAD then svn_client_status would have
> used a round trip to convert that to a revision number to put in the
> request.
>
> I think that the optimisation of not resolving HEAD to a number should
> be done within svn_client_status, and not its caller. The caller really
> wants HEAD in this case, and it should say so. The callee can know how
> to avoid the round trip in the case of HEAD.
Can someone reassure me that the operation will be atomic: that the server will determine the particular revision that is HEAD when it gets the request, and will send the whole of the response against that particular revision even if HEAD is changing because commits are happening in parallel?
- Julian
> Index: subversion/libsvn_client/status.c
> ===================================================================
> --- subversion/libsvn_client/status.c (revision 7099)
> +++ subversion/libsvn_client/status.c (working copy)
...
> @@ -199,10 +198,20 @@
...
> + if (revision->kind == svn_opt_revision_head)
> + {
> + /* Cause the revision number to be omitted from the request,
> + which implies HEAD. */
> + revnum = SVN_INVALID_REVNUM;
> + }
> + else
> + {
> + /* Get a revision number for our status operation. */
> + SVN_ERR (svn_client__get_revision_number
> + (&revnum, ra_lib, session, revision, target, pool));
> + }
>
> /* Do the deed. Let the RA layer drive the status editor. */
> SVN_ERR (ra_lib->do_status (session, &reporter, &report_baton,
...
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Sep 21 18:31:32 2003