views:

1225

answers:

7

Is there currently a feature that allows a exclusive checkout in SVN?

and

Is there a good plugin for Delphi that allows the access via IDE?

+8  A: 

SVN has a concept of "locking" which roughly corresponds to the exclusive checkout. For example, in TortoiseSVN this is exposed via Get lock and Release lock menu entries.

JCL contains a SVN version control expert which works quite fine. Besides other things, tt gives you access to the locking functionality from the IDE.

gabr
+8  A: 

TortoiseSVN can be added into the Delphi tools menu. I've not tried this myself, since I'm happy using it as an Explorer extension.

Regarding the exclusive checkout, I'm guessing you mean so only one person can edit it at a time? That's not really the idea behind Subversion, the idea is you have working copies and then check in your changes. It'll then try to merge your changes in (this usually works most of the time). If there are conflicts you'll need to resolve them manually.

Pauk
How are these conflicts put visible? For example if somone changes a parameter from string to int.
Acron
If someone is making a simple change like that, you won't see a conflict, it'll merge it in on commit. If say you have someone change a string to int and you also change the same string to a real then you would have a conflict. The conflict would be visible when committing and you'd have options on how to resolve it. See this url for more info - http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-conflicts.html
Pauk
+1 for the wiki link - I use that method, and it's great. I also recommend adding "Open Folder Here" which is just explorer.exe $PATH($EDNAME) That gives you access to anything else in Tortoise, easily.
Chris Thornton
A: 

What do you mean by "exclusive checkout"? Do you mean that after you check out, nobody else can check out?

That's called a lock and subversion can do this (see Locking), though it's not recommended in general as the purpose of version control is to allow multiple people to simultaneously work on the versioned item.

Michael Barth
You're right. I meant that nobody can check out after I did it until I commit when the lock is disabled.
Acron
A: 

For first part, I was using Visual Source Safe which is support locking (you have to check out before use), SVN has locking command, but it's against it's concept, you need few time to get used with it, and you will never use the locking command again.

For second part of your question, The TortoiseSVN can be used as external tool, or you can get it working with File Browser bundled with Delphi 2007 and above, and you can use IBrowser which work with older versions.

and Subversion add-ins for Delphi summarize the available SVN plug-ins for Delphi IDE, beside SourceConneXion which is commercial product.

Mohammed Nasman
+2  A: 

I believe one of the reasons why people sometimes enquire about locking items in a Subversion repository is because they have their Delphi DFMs saved in a binary format, which makes committing/merging problematic.

An alternative to changing DFMs etc to text is use Scooter Software's Beyond Compare.

Beyond Compare is written in Delphi, and natively knows how to read binary DFMs. This means that it then becomes less of an issue (or even no issue) whether your DFMs are stored in Subversion in binary or text. Beyond Compare V3 also does 3-way merging which makes it really easy to merge multiple commits etc. Even ignoring the ability to diff binary DFMs, it's still a much better diff viewer than TortoiseSVN's built-in tools. I can highly recommend it, and it's very inexpensive.

Currently the only things that I lock in our repository are COM type libraries (*.tlb and their associated *_TLB.pas files).

Conor Boyd
Interesting point about binary form DFMs but there are pretty easy to convert to text on mass. Since Delphi 1 there has been a file called Convert.exe in the bin folder which will do that. E.g. `convert -i -t -s c:\files\*.dfm`
Pauk
Also, +1 for Beyond Compare, it's a great app. I must admit I prefer it to TortoiseMerge.
Pauk
We use an in-house tool as part of our internalisation process which (currently) requires our DFMs to remain binary. Using Beyond Compare makes this legacy restriction a non-issue for us. Whether a DFM is binary or not is now irrelevant since BC will happily compare binary and non-binary versions of the same DFM for example.
Conor Boyd
+1  A: 

Regarding exclusive checkouts. It can be done, but it's a pain and generally not worth the time. If you do have dfms saved as binary, convert them to text.

Regarding delphi addins, I have a post at Delphi addins for subversion.

I use the jedi jcl, and TortoiseSvn.

There are also Delphi svn and Delphi addin in for Tortoise svn that I know of.

SeanX
A: 

Maybe I'm naive, but why would anyone want to go to the enormous trouble of merging their changes? Merging might be a simple matter if programmers were editing text files whose contents are easily understood, and which therefore could be merged by virtue of the programmers knowing the meanings of the changes. However if you're using SVN with MS Visual Studio, where changes to one file frequently case changes to other files you didn't know about, and where the encoding of information in such files may be completely unknown to the programmers (who would therefore have no concept of how to interpret much less merge such files) and may even be binary, why would you go to the enormous trouble and risk of having multiple people simultaneously editing things?

The locking paradigm is simple. Only one person edits at a time. Merging is never required. Programmers don't need to know the encodings of (possibly binary) files that they don't even realize that they're modifying. Nobody can stomp on anyone else's changes. Locking (i.e. locking by default) sounds much preferable to me.

Dave Ziffer