On Wed, 15 Dec 2004 fitz@tigris.org wrote:
> Author: fitz
> Date: Wed Dec 15 16:46:11 2004
> New Revision: 12324
>
> Modified:
> branches/locking/subversion/libsvn_fs_fs/lock.c
> Log:
> Remove 2 TODO comments, implement functionality indicated by TODOs.
>
> * lock.c (generate_new_lock): Accept lock comment as an arg (char *).
>
> (svn_fs_fs__attach_lock): Add out-of-date-check.
>
> (svn_fs_fs__lock): Pass comment to generate_new_lock.
>
>
> @@ -577,8 +578,26 @@
> lock->owner = fs->access_ctx->username;
> }
>
> - /* ### FITZ TODO: if vaild, use current_rev here to do an
> - out-of-dateness check. See how fs_base is doing it. */
> + /* Is the caller attempting to lock an out-of-date working file? */
> + if (SVN_IS_VALID_REVNUM(current_rev))
> + {
> + svn_revnum_t created_rev;
> + SVN_ERR (svn_fs_fs__node_created_rev (&created_rev, root, lock->path, pool));
> +
> + /* SVN_INVALID_REVNUM means the path doesn't exist. So
> + apparently somebody is trying to lock something in their
> + working copy, but somebody else has deleted the thing
> + from HEAD. That counts as being 'out of date'. */
> + if (! SVN_IS_VALID_REVNUM(created_rev))
> + return svn_error_createf (SVN_ERR_FS_OUT_OF_DATE, NULL,
> + "Path '%s' doesn't exist in HEAD revision.",
> + lock->path);
Dot at the end of error message and missing _().
> +
> + if (current_rev < created_rev)
> + return svn_error_createf (SVN_ERR_FS_OUT_OF_DATE, NULL,
> + "Lock failed: newer version of '%s' exists.",
> + lock->path);
> + }
Same.
Regards,
//Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Dec 16 18:18:32 2004