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

Re: [Patch] Fix multiple reporting of the same lock in FSFS.

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Mon, 09 Feb 2015 15:36:31 +0000

Sergey Raevskiy <sergey.raevskiy_at_visualsvn.com> writes:

> + /* Make a file '/A'. */
> + SVN_ERR(svn_fs_begin_txn(&txn, fs, 0, pool));
> + SVN_ERR(svn_fs_txn_root(&root, txn, pool));
> + SVN_ERR(svn_fs_make_file(root, "/A", pool));
> + SVN_ERR(svn_fs_commit_txn(&conflict, &newrev, txn, pool));
> +
> + /* Obtain a lock on '/A'. */
> + SVN_ERR(svn_fs_lock(&lock, fs, "/A", NULL, NULL, FALSE, 0, newrev, FALSE,
> + pool));
> +
> + /* Add a lock token to FS access context. */
> + SVN_ERR(svn_fs_access_add_lock_token(access, lock->token));
> +
> + /* Make some weird change: replace file '/A' by a directory with a child. */
> + SVN_ERR(svn_fs_begin_txn(&txn, fs, newrev, pool));
> + SVN_ERR(svn_fs_txn_root(&root, txn, pool));
> + SVN_ERR(svn_fs_delete(root, "/A", pool));
> + SVN_ERR(svn_fs_make_dir(root, "/A", pool));
> + SVN_ERR(svn_fs_make_file(root, "/A/b", pool));
> + SVN_ERR(svn_fs_commit_txn(&conflict, &newrev, txn, pool));
> +
> + /* Obtain a lock on '/A/b'. */
> + SVN_ERR(svn_fs_lock(&lock, fs, "/A/b", NULL, NULL, FALSE, 0, newrev, FALSE,
> + pool));

This is issue 2507

http://subversion.tigris.org/issues/show_bug.cgi?id=2507

Commit does not remove locks, lock removal is a separate step after
commit. However that doesn't work well when a commit removes a locked
item, after such a commit the remaining lock is invalid and should not
apply.

What happens if you remove /A and resinstate /A as a file, does the lock
come back?

-- 
Philip Martin | Subversion Committer
WANdisco // *Non-Stop Data*
Received on 2015-02-09 16:37:50 CET

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