06-10-2010 03:14 PM
Is there any way to save a VI in LV9 so that it uses relative paths to its subVIs and controls? Prior to LV8 this was the standard.
Background - I am using Subversion and I have both a deployment repository of code and an experimental branch stored on my local hard drive. The majority of code is the same, but if I copy a VI from the experimental branch into the the deployment repo the new copy references VIs in the experimental directory because LV9 is using an absolute path. This results in lots of conflicts.
Thanks,
Richard
06-11-2010 04:51 AM
LV 2009 uses relative paths just like earlier versions. This is fundamental behavior of LV and changing it would have caused a lot of stuff to be broken.
If I had to guess, I would guess that you actually still have the local code in memory, thus causing cross-linkages.
The other option is that you mentioned your hard drive and you seem to indicate that only some of the code is stored there. I believe that if you call code which is on another drive, LV does use an absolute path, but that also existed in previous versions and should only affect you if you're actually asking for code which is on another drive (e.g. if you were editing your repo code and told it to load VIs from the experimental code).
I'm not sure what you mean by having a local experimental repository, but what you're doing doesn't sound like normal SVN usage at all. In normal usage you don't copy anything. You have your local copy and you commit your changes to the repository when you're done. Branching is more complicated, but I believe should still work completely inside SVN.
06-11-2010 10:01 AM
Thank you for your reply. Yes, I do have both projects open while I'm comparing VIs. All the code is located on the same disk. When I save as and create an unopened disk copy from the experimental project into the identical location in the development project I get conflicts and links back into the experimental directories.
I will try closing the other project next time before opening.
Richard
06-11-2010 10:09 AM
When you want to move the experimental code to the development, try using a "Source Distribution" in the project. Configure it to duplicate the hiarchy to the new loaction (production).
Ben
06-12-2010 02:50 PM
RichardJennings wrote:I do have both projects open while I'm comparing VIs
If by "projects" you're refering to an .lvproj file, then ideally you shouldn't have any conflicts, because opening VIs in separate projects (assuming you're careful to separate them, which can be tricky) should not cause any conflicts at all.
In any case, you should note that if you do Save As on a VI, it doesn't take the other VIs with it. Rather, it keeps pointing to them at their old location. This might be the source of your troubles. One option would be to simply move the VIs instead of saving them. Another option would be to do a source distibution as Ben suggested (and if the production branch is not changed, this is probably the best option). Another option would be to build an executable (what most people do when they want an easy to use and static application) and the last option would be to use SVN correctly - Check out the code in both places, modify and commit it on your drive and then update in the production drive.