For Windows only, paste the following code inside a text file, and change the extension to bat.
@echo off echo Adding Subversion (svn) to the path... set SVNPATH=%PROGRAMFILES%\SlikSvn\bin set PATH=%PATH%;%SVNPATH% set SVN_EDITOR=%WINDIR%\notepad.exe echo Default text editor for svn commit messages, etc. set to %SVN_EDITOR%
Change the "SVNPATH" variable to the location of svn.exe on your system. Double-click the batch file and type "svn" to check your installation.
command-line syntax
svn checkout --username=MY_USERNAME https://svn.code.sf.net/p/libec-vi-repo/code/trunk cd trunk
Suppose that we want to change the repo's copy of about.vi.
svn update svn lock -m "A short message why and for how long I am locking this file" about.vi svn info about.vi
Do not modify about.vi in LabVIEW until you have become the lock owner.
Committer's Checklist
- You are the lock owner, right?
- Is the VI compatible with LabVIEW 8.2?
- This is the earliest version supporting an external input path for Call Library Function
- We want to make the libec VI's available to as many users as possible!
- Did you remember to commit/unlock all the files you locked? (use 'svn status')
To save your changes to the repo
svn commit -m "message describing changes"
Alternatively, to discard your changes
svn unlock about.vi
Note that this doesn't change the Files section. You can:
- wait for an admin to push the file up
- upload using the web interface
- upload using rsync from command line (see Optional section below)
To make a new release
See "Rsync" section below
Some remarks
The lock-modify-unlock paradigm is used because VI files are binary, non-plaintext files - the classic example for which Subversion supports locking in addition to copy-modify-merge.
Now, you can always modify a locked file locally to your heart's content, but once the file becomes unlocked (and has probably undergone modification), it will be your responsibility to merge your changes in:
- using LabVIEW's diff (Tools > Compare > Compare VI's) and merging by hand
- using LVCompare.exe and LVMerge.exe (LabVIEW 8.5 and up? reference?)
- hook
- crook
This article's original author is not familiar with how to use LVDiff.exe or LVMerge.exe. He is also quite fearful of merging VI's by hand, so he chose instead to hide behind svn locks...
To add a new file to the repo
svn add new.vi svn commit -m "Added new.vi"
To delete a file from the repo
svn rm new.vi svn commit -m "Deleted new.vi"
How to exclude files from "svn status" (cf. .gitignore)
svn propedit svn:ignore .
How to ensure files are read-only in the filesystem unless you have locked them (untested)
svn propedit svn:needs-lock
Installation (Windows only)
- cwRsync - Free Edition
- add the folder containing rsync.exe to your path, like you did for svn above.
To make a new release (from Windows)
(assuming svn, winrar, and rsync are all on the path)
@echo off copy README_HEAD.txt README.txt svnversion >> README.txt winrar a -m5 libec-vi.zip about.vi chi.llb demo.vi COPYING.txt README.txt rsync -e ssh libec-vi.zip README.txt USER@frs.sourceforge.net:/home/frs/project/libec-vi-repo
References
- https://sourceforge.net/apps/trac/sourceforge/wiki/Release%20files%20for%20download
- http://www.zorched.net/2006/07/20/getting-the-revision-number-of-your-subversion-working-copy/
To back up the entire svn repo
rsync -av libec-vi-repo.svn.sourceforge.net::svn/trunk/* .
I think this works...? Where are all the revisions?
The most popular Windows svn client is probably TortoiseSVN