Thanks for replies to all. Just to the sentence:
> Subversion ... can only detect conflicts, not resolve them ... IMO Subversion locks (or locks in general) are a collaboration tool to prevent conflicts (without other communication channels). It works well with files in the repository. It seems to me unfortunate that it does not work for the new (or deleted) files, too. Furthemore, from bug https://issues.apache.org/jira/browse/SVN-2507 it seems to me it's technically possible to have a lock for a file not in the repository - it's possible to remove a locked file with "svn commit --no-unlock". Then, only the user holding the lock may create and commit a new file of the same name. (And that's what I need :)) So, what about to take this as an advantage, and allow svn lock and svn unlock to work with files not in the repository? (It would solve SVN-2507, too). Cheers Andy On Tue, 3 Jun 2025 at 00:12, Branko Čibej <br...@apache.org> wrote: > > You can only lock files that are in the repository. A new file in the working > copy, even after being "svn add"-ed, can't be locked until it's committed. > > Daniel is correct, tree conflicts are the only mechanism that can reliably > detect the issue. Resolving it requires users to talk to each other; > Subversion is not a communication channel, it's a collaboration tool, it can > only detect conflicts, not resolve them (in general, that is; conflicts in > text files are an exception, and even there, no automated merge is > error-free). > > -- Brane > > On Mon, 2 Jun 2025, 17:54 Daniel Sahlberg, <daniel.l.sahlb...@gmail.com> > wrote: >> >> Hi >> I think the answer on Stack Overflow is spot on, there is no way to avoid >> this problem. As already explained there, the tree conflict is probably the >> easiest solution anyway compared to a ”central naming authority” or other >> manual workaround. >> Kind regards >> Daniel >> >> mån 2 juni 2025 kl. 17:22 skrev Ondra Medek <xmed...@gmail.com>: >>> >>> Hello, >>> >>> We have a directory versioned in SVN and use svn lock to prevent >>> conflicts (of non-mergeable files). However, when I create a new file >>> and do svn lock newfile, then got error: >>> >>> svn: E155010: The node '...\newfile' was not found. >>> >>> When 2 users create and commit `newfile` at the same time, then one of >>> them has a tree conflict. >>> How to use svn lock for a new file? Or is there any other way to >>> prevent conflicts when 2 users create the same file and the same time? >>> See my SO question >>> https://stackoverflow.com/questions/79639066/how-to-lock-or-prevent-conflicts-for-a-new-file-with-svn/79640745 >>> and workaround >>> https://stackoverflow.com/questions/79639066/how-to-lock-or-prevent-conflicts-for-a-new-file-with-svn/79640745 >>> >>> If this functionality is missing, then consider it as a feature >>> request. But then, the bug >>> https://issues.apache.org/jira/browse/SVN-2507 may be a blocker of >>> such feature request. >>> >>> Thanks >>> Andy