kfogel@tigris.org writes:
> Log:
> Locking branch: Support lock/unlock on URLs.
>
> * subversion/clients/cmdline/lock-cmd.c
> (svn_cl__lock): Be more flexible about finding a temp dir, now that
> we can't unconditionally depend on targets being local.
>
> * subversion/libsvn_client/locking_commands.c
> (store_head_revision): New static helper function.
> (struct lock_baton): Reorder fields to be more intuitive.
> (store_locks_callback): Handle the no-working-copy case, redocument,
> and rearrange the code a bit.
> (open_lock_targets): Renamed to...
> (organize_lock_targets): ...here, and rewritten.
> (svn_client_lock, svn_client_unlock): Handle the URL case.
Please note the following about 'svn unlock URL' below...
> --- branches/locking/subversion/libsvn_client/locking_commands.c
> +++ branches/locking/subversion/libsvn_client/locking_commands.c
> @@ -324,19 +409,34 @@
> apr_pool_t *pool)
> {
> svn_wc_adm_access_t *adm_access;
> + const char *common_parent;
> const svn_wc_entry_t *entry;
> + const char *url;
> svn_ra_session_t *ra_session;
> apr_hash_t *path_tokens;
> struct lock_baton cb;
>
> - SVN_ERR (open_lock_targets (&entry, &adm_access, &path_tokens,
> - targets, FALSE, force, ctx, pool));
> + SVN_ERR (organize_lock_targets (&common_parent, &entry, &adm_access,
> + &path_tokens, targets, FALSE, force, ctx,
> + pool));
> +
> + if (svn_path_is_url (common_parent))
> + {
> + url = common_parent;
> + /* Unlocking a URL is pointless with the 'force' flag anyway, so
> + just set it if we're operating on URLs. */
> + force = TRUE;
> + }
> + else
> + {
> + url = entry->url;
> + }
Because 'svn unlock URL' would never work without the 'force' flag
anyway, I just made that code run with 'force = TRUE' automatically.
My reasoning was that if someone types 'svn unlock URL', then they
know what they meant to do, and there's no point making them type
'--force' every time (which of course they'd eventually habituate to).
If consensus is that this is a bad idea, then it's easy to change:
just make the obvious tweak in the above code.
-Karl
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Mar 13 03:49:17 2005