EEVblog Electronics Community Forum

Electronics => General PCB/EDA/CAD Discussions => Altium Designer => Topic started by: angust_uk on August 05, 2017, 01:34:47 am

Title: Does anyone use SVN to keep track of libraries?
Post by: angust_uk on August 05, 2017, 01:34:47 am
Hi all

We 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!


Thanks
Angus
Title: Re: Does anyone use SVN to keep track of libraries?
Post by: brucehoult on August 05, 2017, 04:04:55 am
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.
Title: Re: Does anyone use SVN to keep track of libraries?
Post by: Pitrsek on August 05, 2017, 04:40:37 am
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. 
 
Title: Re: Does anyone use SVN to keep track of libraries?
Post by: Pseudobyte on August 07, 2017, 12:29:38 pm
Important rules for svn libraries:

1. .schlib filename must be exactly the same as the symbol inside it.
2. only one sym for .schlib
3. .pcblib filename must be exactly the same as the footprint inside it.
4. only one footprint for .pcblib
5. 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.
Title: Re: Does anyone use SVN to keep track of libraries?
Post by: ivaylo on August 07, 2017, 05:13:49 pm
Never had any problems with SVN (used it both with text and binaries over thousands of files). What server are you using?
Title: Re: Does anyone use SVN to keep track of libraries?
Post by: Jeroen3 on August 07, 2017, 05:22:25 pm
Are you using SVN together with other synchronisation software?
Title: Re: Does anyone use SVN to keep track of libraries?
Post by: angust_uk on August 07, 2017, 11:54:05 pm
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
Title: Re: Does anyone use SVN to keep track of libraries?
Post by: Pseudobyte on August 08, 2017, 12:17:06 am
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!

SVN 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>>Commit

I 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.
Title: Re: Does anyone use SVN to keep track of libraries?
Post by: ivaylo on August 08, 2017, 04:08:29 pm
Hmm, OK. I've never used it under Windows actually. What do:
show (or whatever the Tortoise equivalents are)? These GUI tools make things more difficult to figure out sometimes...
Title: Re: Does anyone use SVN to keep track of libraries?
Post by: ivaylo on August 08, 2017, 04:11:37 pm
Also:
svn stat your_messed_up_file
will tell you if other synchronization software is overriding stuff.