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

Re: Cross-branch locking

From: Ryan Schmidt <subversion-2005_at_ryandesign.com>
Date: 2005-09-15 12:31:05 CEST

On Sep 15, 2005, at 05:59, Kalin KOZHUHAROV wrote:

>> On Sep 14, 2005, at 6:55 PM, James McNeill wrote:
>>> Locking a file only locks it in one place in the repository. If
>>> you have a
>>> trunk and a branch version of a non-mergeable (binary, usually)
>>> file, it is
>>> still possible for people to make changes to both copies
>>> simultaneously and
>>> end up with non-mergeable changes.
>>> Has anyone thought about ways to prevent this from happening?

Difficult, since Subversion does not have a concept of branches or
tags. They're all just copies. The fact that you treat a branch or a
tag differently is just a convention; it's not codified anywhere in
the repository data.

I think the only possible thing Subversion could do would be to
notice that branches/release-1.1/foo was copied from trunk/foo and
therefore if trunk/foo is locked then branches/release-1.1/foo would
be automatically locked as well. I don't think that's what everyone
desires though. What if I copied foo to a completely different
project in the same repository, because they start out by sharing
some resources, but then diverge over time? I wouldn't want the new
project's foo to be locked just because the original project's foo
was. And since branches and tags are just copies, Subversion has no
way of knowing whether you are copying something to a new branch or
tag or whether you're copying to an unrelated project.

> Ben Collins-Sussman wrote:
>> Why not lock both locations? You can run 'svn lock' on URLs if
>> you wish.
> What if there are 231 branches + trunk :-) You have to lock 232
> URLs...

What kind of development are you doing where you need to keep 232
parallel development tracks? That's ludicrous. In our projects, we
have the trunk, and we have the most-current release branch, and
that's it. If we used locks, then we'd lock the file in the trunk and
in the current branch and that'd be it. Yes, there are some older
release branches, but there's no reason to lock anything there,
because nobody should be working on those anymore, because they're

> CLI cannot handle something like that, I guess (not tried):
> svn lock 'http://example.com/repos/mine/branches/*/doc/whatever.doc'
> end even then we usually have trunc/doc and branches/FOO/doc

No, certainly not with that syntax, but it would be trivial to write
a script which gets a list of all branches and locks a file in all of
them, and in the trunk.

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Sep 15 12:33:12 2005

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.