Does anyone use SVN to keep track of libraries? - Page 1
Forum section: electronics / general

author: angust_uk
author_rank: Regular Contributor
timestamp: August 04, 2017, 03:34:47 pm
content: Hi allWe are currently using SVN to store all our library files (both .SchLib and .PcbLib). Unlike projects, which Altium deals with fine, we're having to use a separate SVN client (we use TortoiseSVN) to update and commit changes from and to the server, as it seems Altium doesn't recognise the fact that library files are under source control. Does anyone else do this?We are seeing some issues where occasionally parts go missing from the libraries, and I can't for the life of me figure out why (in one commit, by me, I can see a new part that's been added, then in the next commit, also by me, the new part has gone!). It's all a bit worrying, as the whole point is to avoid losing data!Any input would be hugely appreciated!ThanksAngus

author: brucehoult
author_rank: Super Contributor
timestamp: August 04, 2017, 06:04:55 pm
content: I haven't used svn by choice in ten years! git is so much easier, especially as you can just use it locally if you want.One thing you really have to watch with svn is that it tried to guess whether each file is binary or text, and if it gets it wrong then horrible things happen. git treats everything as binary.

author: Pitrsek
author_rank: Regular Contributor
timestamp: August 04, 2017, 06:40:37 pm
content: We do. I did nod understood from your post if your library are separate files or integrated library project. We use library in form of integrated library project, in this case the integrated SVN works fine. I did not test if it works fine if your schlib and pcblib files are stand alone files, with no project. Regarding the loss of data, we have encountered some that were caused by concurrent editing of the same file. Yes, I was able to sort it out, but it was huge pain in the ***. So since then, whenever I go to work on our library, I ask other colleague if he committed all changes....We are in proces of changing from integrated library to database library.

author: Pseudobyte
author_rank: Frequent Contributor
timestamp: August 07, 2017, 02:29:38 am
content: Important rules for svn libraries:1. .schlib filename must be exactly the same as the symbol inside it.2. only one sym for .schlib3. .pcblib filename must be exactly the same as the footprint inside it.4. only one footprint for .pcblib5. do not use specified filepaths within the database for SYM reference and FTPT reference (Altium advises against this)Occasionally we need to cleanup the cache on our computers, not really a problem just more of an annoyance. You can do this by deleting the C:\Users\xxx\AppData\Local\Temp\SVNDBlib Cache folder, we have a batch file to do this within the repository. I also recommend that you give the excel or access db a required lock property in the svn, this requires users to lock the file before editing it ensuring that only one person is modifying the file at a time. I am happy to answer any questions you have on this. It took me a while to fully understand this workflow, a few support cases, and lot's of reading and searching.

author: ivaylo
author_rank: Frequent Contributor
timestamp: August 07, 2017, 07:13:49 am
content: Never had any problems with SVN (used it both with text and binaries over thousands of files). What server are you using?

author: Jeroen3
author_rank: Super Contributor
timestamp: August 07, 2017, 07:22:25 am
content: Are you using SVN together with other synchronisation software?

author: angust_uk
author_rank: Regular Contributor
timestamp: August 07, 2017, 01:54:05 pm
content: Thanks all for the helpful replies!We're using our own local server, running VisualSVN (@ivaylo: what software do you use on your server?) and are using separate library files (i.e. not integrated libraries). There is no other synchronisation going on (at least nothing intentional!); we checkout projects in the usual way straight from Altium, and library files through Windows Explorer via TortoiseSVN.I've now managed to clean things up and locate all the missing parts though I'm just not confident we won't see the same issue again!Angus

author: Pseudobyte
author_rank: Frequent Contributor
timestamp: August 07, 2017, 02:17:06 pm
content: Quote from: angust_uk on August 07, 2017, 01:54:05 pmSVN only has good workflow if those using it understand it's pitfalls. Make sure that only one person is modifying your database at a time. Our workflow is: Update>>Lock DB(Require Lock For Edit)>>Make Changes/Add Files>>CommitI am not sure how you are loosing files. Someone would have to either mark the file for deletion, and then commit, or they would have needed to revert the SVN revision.

author: ivaylo
author_rank: Frequent Contributor
timestamp: August 08, 2017, 06:08:29 am
content: Hmm, OK. I've never used it under Windows actually. What do:svn log your_messed_up_filesvn blame your_messed_up_fileshow (or whatever the Tortoise equivalents are)? These GUI tools make things more difficult to figure out sometimes...

author: ivaylo
author_rank: Frequent Contributor
timestamp: August 08, 2017, 06:11:37 am
content: Also:svn stat your_messed_up_filewill tell you if other synchronization software is overriding stuff.