From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
02-01-2018 06:39 PM
So I'm in my first "real project" using source code control- I'm using TortoiseSVN. So far I quite like it, and of course wish I'd been doing it for years 🙂
My question is regarding moving and renaming files. In this project I sometimes end up changing my mind about how I want a function to be used, and end up renaming it. Usually something simple; for example, "Edit test settings" to "Edit global test settings" or something. Sometimes it ends up being a folder that gets moved and a dozen VI's get affected (their path changes but their name doesn't).
When I commit this change to SVN, it detects the new file as being added and the old one as missing. I don't see a way to tell it that I renamed something apart from manually doing that to each file within the repo browser, but that means the LabVIEW project goes nuts the next time you try to open it and it can't find the old file. I've had bad experiences trying to batch-rename files like that, so I always do it within the Project environment.
It's simple to just mark the old files as "deleted" in SVN, then add the new ones. This works for a few small unimportant VI's here and there, but I'm wondering if there's a better way. Note that I don't have SVN integrated into my project- is there some integration mechanism that would automatically notify SVN that I renamed a file from within the project? If so how might I set that up?
Solved! Go to Solution.
02-01-2018 06:45 PM
Right-click; \TortoiseSVN\Rename
Then Commit the Parent folder!
Cheers.
02-02-2018 01:40 AM
Hi Bert,
When I commit this change to SVN, it detects the new file as being added and the old one as missing. … LabVIEW project goes nuts the next time you try to open it
Never rename VIs (or other stuff) outside the corresponding LabVIEW project!
Solution: do the renaming inside LabVIEW project and live with "new"/"missing" commits. (I never had SVN troubles because of them; the sanity of my LabVIEW projects is more important than disk space of the SVN server…)
02-02-2018 03:48 AM
In the commit, select the two files, r-click -> Repair Move to get a correct log.
/Y
02-02-2018 10:47 AM
Jiminy crickets Yamaeda, didn't know that was an option.
For future reference to others, if you do an Add and then try this trick, it won't work- you need to leave the renamed file unversioned, then ctrl-click both elements, right click, and Repair Move.
Thanks so much. I figured there HAD to be a straightforward way to do this without screwing up my project references and relinking things.
02-02-2018 11:51 AM
Here are a couple of "rules" that will save you a lot of grief and worry when using SVN and LabVIEW Project.
So my set of Best Practices for moving/renaming files in TortoiseSVN (in the context of talking about a LabVIEW Project) is simple -- Never move or rename (LabVIEW) files in TortoiseSVN. Always move/rename LabVIEW Files within LabVIEW Project (the "Items" View), then Commit the changes to SVN.
Bob Schor
02-02-2018 12:27 PM - edited 02-02-2018 12:27 PM
Sorry for not reading your post carefully. I manage the source-tree without a LabVIEW project, but use a project (later) for creating EXEs and Installers. I just live with the occasional pain of relinking after SVN rename. It may not be a "best practice" (as defined by consensus) but it works for me!
02-02-2018 12:31 PM
Thanks Bob. I've been mainly doing that- anytime I tried to do something outside of the Project environment it ended in heartache.
Regarding the rename being a Delete + Add: is there a difference between a manual Add then a Delete, as opposed to doing the "Repair Move" (which I can see results in a Delete + Add)?
I would suspect that the Repair Move command would do a Delete/Add, but that it would "know" that "File A-2" is a renamed version of "File A" and could trace the previous versions that way. Is that correct?
02-02-2018 12:39 PM
Sorry, I wasn't clear.
Do everything to your LabVIEW Project and its files in LabVIEW using the Project Explorer. The only thing you do in Tortoise SVN is a Commit (when you have finished or want to "pause") and an Update (when you start).
You should not be doing an "Add" and "Delete", or a "Repair Move" (whatever that is) when dealing with LabVIEW and its Project Explorer. That way lies madness (and the risk of corrupting your Repository).
Bob Schor
02-02-2018 12:44 PM
Wow. Ever since the LabVIEW Project was introduced, I've been using it for everything except the "one-off" simple VIs to test something ("How do I do XXX in LabVIEW"), writing a piece of code for the Forum, or something similar that I'll almost immediately delete. Certainly anything that involves more than one VI + 3 sub-VIs and a TypeDef or two always gets a Project as the first step ... This has really simplified my LabVIEW Development effort, and is one of the first things I try to impress on those I advise ...
Bob Schor