LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW and SVN

Info: I am a single developer, working alone (so maybe my comments do not apply), and using tortoise SVN (mostly) happily.

In my experience its not a great idea to go for weeks without committing changes back into the repository. I always try and leave the project build in a "runnable" condition at the end of a day's work, and then commit that code. Doing this helps to build up a habit of committing regularly (and then you can leave a meaningful commit log message).

I would rather commit too often than not often enough. Hard drives are cheap, network access over 100base-T or gigE means the commits should take not more than a few minutes maximum (in reality its often only a few tens of seconds maximum).

SVN has its problems, but it has saved my bacon on a few occasions already. And it is difficult to argue with its performance/cost ratio Smiley Very Happy
0 Kudos
Message 31 of 43
(5,051 Views)
I can't respond to all of those, since I'm far from being a Subversion expert, but I understand your frustration. I can comment on some of them, though.

My first clue: Two developers could "lock" the same VI and make changes.

Not sure about that one. I know that SVN supports the locking model, but it's not its default behavior. The default is check out\update (if you already checked out), then work, then commit and resolve differences if any exist. No locking is necessary. The developers are responsible to talking to each other to make sure they don't work on the same code.
You will probably say that the whole point of SCC is that developers let the SCC tool prevent others from editing files they are working on, but this method works for many teams. It's a bit more problematic for LabVIEW, where your changes can affect many files, which is why people use the techniques described in this thread.

  • SVN indeed seemed to work OK when it was just me ... or maybe one more developer checking in, checking out, updating , etc. code into and out of the SVN repository. But the more developers that got involved, the more errors and headaches crept into the process.
  • Although I had no idea what the problems others were having, I saw, on more than one occasion, IT looking over a developer's shoulder who was unsuccessful trying to check in updated code. Sometimes the entire directory had to be deleted, the previous revision reinstated then checked out again, the new code redone and checked back in.
  • I would get an error trying to check in some code. I would try the Tortoise/SVN - suggested solution. That would fix that problem but another would arrise. I would fix that. I could do this a half-dozen times then end up right back to the original error. Smiley Mad
  • It got so frustrating, and I had heard it so often for so long that if I had heard that insipid Tortoise/SVN error sound ONE MORE TIME I was going to start taking hostages.


For me, all of these sort of go together. My biggest problem is my coworkers. For me, Subversion plays nicely. For my boss, I often hear the very annoying sound coming from his office (we keep documents under SCC as well), at which point it's usually time to send the cavalry. I wouldn't be shocked if this would be even harder on us if we used VSS.
As with you, trying the suggest solutions usually doesn't help (I suspect that's because they are trying to handle other problems) and usually deleting the offending folder, updating to get it back and then reapplying the changes is required. Usually, this is done by simply moving the modified files and then moving them back, which is a simple enough solution.
 
I'm not sure, but I suspect most of these issues are caused by them moving and copying folders using the Windows shell. Since SVN keeps all the SCC info in hidden subdirectories, this causes it to go crazy when you try to commit.
You might think that this is bad design, but I happen to find this extremely useful, especially when working on large binary files like VIs. It means that all the comparisons can be done on the client's side, without having to send a lot of data through the network. This makes Subversion commits and updates much faster than VSS (at least for me).

Checking out a subdirectory occasionally created errors when attempting to check it back in. My biggest problem with this was that I could have a subdirectory checked out and locked for a week at a time, make numerous changes to numerous VI's in the subdirectory, then if just ONE vi had a problem none of the others could be checked in until the error on the one VI was corrected.

I would also advise against that, although I can understand how this could be a problem if you're working on a feature which takes a while to finalize. As for your problem, that is actually a feature, and one which I think is very good. In Subversion, commits are atomic - if one file fails, the entire commit fails. Since commits are supposed to represent points in time, this behavior is correct - everything has to go together.


___________________
Try to take over the world!
Message 32 of 43
(5,041 Views)
Paul,

"
My first clue: Two developers could "lock" the same VI and make changes. Just this fact alone goes against everything revision control software is supposed to accomplish. This was an issue I had to bring to the attention of IT. The way it was explained to me is that this was "default" behavior and the change/cluge/hack/workaround had to be implemented manually. IT fixed it, but what the hell was that all about??? In "source control" software no less??
"

My main roles is as a Software Configuration Manager I have used CVS, SNV (a little) and specialise in ClearCase and I can tell you that a large number of Source Control Tools not only allow two or more people to work on the same file at the same time,  but are designed to encourage this.  The whole benfit of a good source Control Tool is to support parallel development and provide the tools ( braches in ClearCase ) to do this well. That is why they have  built in  merge tools. So this fact alone DOES NOT go against everything revision control software is supposed to accomplish.

It works great for text files, BUT it all falls appart with LabVIEW VI's as they are binary. (I have not played yet with the LabVIEW 8.5 mege tool). The other problem with LabVIEW VI's occurs as everyone else has already said with the fact that a VI is both source and compiled code in one happy package (oh how I hate that).

Whatever source control tool you use, no matter how long you have used it LabVIEW will give you some interesting new problems to overcome using it efficiently within a team environment.


"
SVN indeed seemed to work OK when it was just me ... or maybe one more developer checking in, checking out, updating , etc. code into and out of the SVN repository. But the more developers that got involved, the more errors and headaches crept into the process.
"

LabVIEW again,  due to the recompile issue and lack of merge tools. I have worked on ClearCase projects with 60+ developers, with text files this is less of a problem that a project with 5 LabVIEW developers.

Danny Thomson AshVire Ltd
0 Kudos
Message 33 of 43
(4,978 Views)
I just had a good chat with a respected fellow LV guy and he claims his company uses SVN with about 30 developers - and he claims it works great for them. Yea, it's tricky at first but everyone eventually got the hang of it. I know a lot of highly respected and competent LV developers use it and think it's great. My previous problems were probably due to inadequate and faulty implementation, training and installation. We may move to SVN in my current company since our VSS license is old, has too few licenses and nobody (except me) seems to know how to use it. I'm prepared take this on myself (just to be able to say: "I kicked it's arse!") and take back a lot of the bad of what I said. We shall see. Smiley Happy  I'll update this thread if we continue with our progress ...
PaulG.

LabVIEW versions 5.0 - 2023

“All programmers are optimists”
― Frederick P. Brooks Jr.
Message 34 of 43
(4,955 Views)
Hi Paul,

would you be willing to write an article on the LAVA wiki on this?
I use SVN solely so my info is probably not of high value.

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 35 of 43
(4,946 Views)

Hey nrp,

Do you know of any good tutorials to get set up with using tortoise svn?  Any help is greatly appreciated.

 

Thanks, 

TIm

--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 36 of 43
(4,545 Views)

I can point you to a couple documents that may prove useful. 

 

The Large LabVIEW Application Community has a document on Source Code Control and Group Development Practices in LabVIEW for Advanced Configuration Management...

 

This site on Software Engineering with LabVIEW also features a number of articles on integration with source code control and software configuration management

 

Finally, I just had an avid LabVIEW user e-mail me with a 16 page document he put together on integrating SVN with the LabVIEW Project Explorer, which I've hastily posted here in order to respond to your question: Using SVN and PushOK with LabVIEW for SCC.*

 
*this wiki document on ni.com is open for editing and updating by the community.  Please feel free to contribute.
Elijah Kerry
NI Director, Software Community
Message 37 of 43
(4,534 Views)

Elijah K wrote:

 

Finally, I just had an avid LabVIEW user e-mail me with a 16 page document he put together on integrating SVN with the LabVIEW Project Explorer, which I've hastily posted here in order to respond to your question: Using SVN and PushOK with LabVIEW for SCC.*

 
*this wiki document on ni.com is open for editing and updating by the community.  Please feel free to contribute.

This document is not available at this address, where can I find it

 

Thanks

 

Dany

LabVIEW ChampionArchitect
0 Kudos
Message 38 of 43
(4,442 Views)

Hi, perhaps this is usefull for someone:

 

We use svn and Labview since 2005 and it works together without problems.

We are about 5 developers, we have 11 projects which are about 2GB on data and about 2000 files (most of them are binaries like .vi, vit, ...).

svn handle binaries very efficient ,so our 2000 commits takes not so much space on the repository server.

I would now decide for svn also for bigger projects, but we have found some usefull rules of conduct:

 

1. Labview files get the needs-lock property: That means that the file are write-protected till lock and labview cannot save automatically.

2. For better tracking changes, only really changed vi's were commited. Before compiling an executable, there is a seperated commit for mass compile if needed to get everything consistent.

3. developers commit changes so fast as possible -> no weekly locked files in the repo

4. developers don't steel the lock without asking the other developer, which has the lock. (a lock means normally: still working on it)

5. Better to make to much commits than to less -> commits are cheap!

6. files, which are in project folder are only used in this project.

7. files, which are used in more than one project (like device drivers) are in a seperated "modules" folder which is integrated to the project which a small batch file -> so a developer can upgrade e.g. a Labview version without affecting other projects.

the batch look like this:

     rd /S /Q ..\Module

     mkdir ..\Module

     svn export -r1788 --force http://servername/svn/repo/Module/Frontpanel-Tools/trunk@1788 ../Module/Frontpanel-Tools

 

So the modules file are not checked out but only exported and therefore no unintentional changes can happen and affect other projects.

If changes are needed you have to check out the files, modify them and commit, change the revision number in the batch file and commit the change of the batch..

 

8. main front-panels get the svn:keywords=Revision -> so you can place a text $Revision::             $ and svn fill in the revision number for each commit. Important is, that you have enough spaces for the revision number between the :: and the $. in the other case svn could destroy the vi!

 

9. For client we use TortoiseSVN.

 

I hope this helps,

regards, Andreas.

Message 39 of 43
(4,304 Views)
At JKI, we have just released a new TortoiseSVN Tool for LabVIEW that helps developers integrate TSVN with their LabVIEW workflows.
Message 40 of 43
(4,175 Views)