views:

166

answers:

5

Hello.

How do I have in each *.pas file it's version, incrementing on each save in some comment line? I have plenty of files on three PCs and I need to have a possibility to quickly check their versions against each other.

This problem is easily solved by some centralized version control, but some sources I have cannot be trusted to external servers and are kept on TrueCrypt volumes.

May be some addon can do that for me? Something like changing $Version: to $Version: 121212 on each save, incrementing this value?

May be there is another way also of solving this problem?

+3  A: 

You should try a DVCS like Mercurial. It doesn't need a centralized server while still giving you the benefits of a VCS.

It will also make it easy to synchronize the changes made on each PC to the others.

Uwe Raabe
@Uwe Do you have more information about Delphi and Mercurial?
Heinz Z.
Using a DVCS or VCS does not change the issue, it just change the way it syncs with the remote repository. AFAIK a DVCS can't generate a global revision number locally because it has no way to compute it. It has to use some other identifier for each distributed version - and I guess they could be used to detect differences but not the timeline. For the matter the OP could use a local VCS and store its sensitive files there, but again it would not be able to generate global revision numbers, if more than one developers works on them he's out of luck
ldsandon
@Heinz Z.: I'm currently using a mix of SVN and Mercurial ("Kiln" to be specific) for my projects. There is no direct relation between Delphi and Mercurial at the moment. It's just that the DVCS approach better matches my working behaviour that made me switch from SVN to Hg.
Uwe Raabe
+1  A: 

You may also look at Git : http://git-scm.com/

philnext
+4  A: 

Read this chapter about keyword substitution in Subversion.

In short: you have to enable keyword substitution for your files via svn propset svn:keywords ... and insert the revision keyword in these files.

splash
Oops, I missed the "w/o SVN" in the subject. But I will leave the answer. Maybe it's useful for somebody else who also missed it. :)
splash
@splash - nevermind the oops. The OP needs guidance, and will hopefully be swayed back to using SVN. It's the better solution, IMO.
Chris Thornton
Yea... I wish Embarcadero will gather their wits together at last and will start offering really convinient IDEs with everything needed integrated
FractalizeR
"everything needed" may have different meaning to different developers :) There are too many VCS out there, limiting developer's choices would not be a good idea.
ldsandon
+1  A: 

Don't know if one already exists, but you can write a Delphi plug-in (using its OTA interface) to achieve what you need. Although of course it won't work well if more than one developer works on the same file, unless you use an external, shared counter.

ldsandon
+1  A: 

Note that locally hosting subversion can mean filesystem access. i.e. you don't even have to set http. Just point place the repository in your (already) encrypted hard disk, and instead of an URL, use a reference like \share\directory\svn\repo\project1 or C:\svn\repo\project1

Chris Thornton
Yes, this is what I was going to suggest. To add a specific suggestion to Chris' answer, TortoiseSVN can be used on it's own to create file-based Subversion repositories, which in this instance, could be on one of your TrueCrypt volumes.
Conor Boyd