Sergey Raevskiy <sergey.raevs...@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*

Reply via email to