Author Topic: Does anyone use SVN to keep track of libraries?  (Read 392 times)

0 Members and 1 Guest are viewing this topic.

Offline angust_uk

  • Newbie
  • Posts: 2
  • Country: gb
Does anyone use SVN to keep track of libraries?
« 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
 

Offline brucehoult

  • Frequent Contributor
  • **
  • Posts: 324
  • Country: ru
Re: Does anyone use SVN to keep track of libraries?
« Reply #1 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.
 
The following users thanked this post: angust_uk

Offline Pitrsek

  • Contributor
  • Posts: 44
  • Country: cz
Re: Does anyone use SVN to keep track of libraries?
« Reply #2 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. 
 
 
The following users thanked this post: angust_uk

Offline Pseudobyte

  • Contributor
  • Posts: 42
  • Country: us
Re: Does anyone use SVN to keep track of libraries?
« Reply #3 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.
“They Don’t Think It Be Like It Is, But It Do”
 
The following users thanked this post: angust_uk

Offline ivaylo

  • Frequent Contributor
  • **
  • Posts: 470
  • Country: us
Re: Does anyone use SVN to keep track of libraries?
« Reply #4 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?
 
The following users thanked this post: angust_uk

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 2305
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Does anyone use SVN to keep track of libraries?
« Reply #5 on: August 07, 2017, 05:22:25 PM »
Are you using SVN together with other synchronisation software?
 
The following users thanked this post: angust_uk

Offline angust_uk

  • Newbie
  • Posts: 2
  • Country: gb
Re: Does anyone use SVN to keep track of libraries?
« Reply #6 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
 

Offline Pseudobyte

  • Contributor
  • Posts: 42
  • Country: us
Re: Does anyone use SVN to keep track of libraries?
« Reply #7 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.
“They Don’t Think It Be Like It Is, But It Do”
 

Offline ivaylo

  • Frequent Contributor
  • **
  • Posts: 470
  • Country: us
Re: Does anyone use SVN to keep track of libraries?
« Reply #8 on: August 08, 2017, 04:08:29 PM »
Hmm, OK. I've never used it under Windows actually. What do:
  • svn log your_messed_up_file
  • svn blame your_messed_up_file
show (or whatever the Tortoise equivalents are)? These GUI tools make things more difficult to figure out sometimes...
 

Offline ivaylo

  • Frequent Contributor
  • **
  • Posts: 470
  • Country: us
Re: Does anyone use SVN to keep track of libraries?
« Reply #9 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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

http://opalkelly.com/