Menu

getting_started

CH Instruments

Getting Started with the libec-vi Repository

How to download VI's from the Subversion repository


Abbreviations

  • svn = Subversion
  • repo = repository

How to upload (contribute) to the repo

  • Create a sourceforge.net account
  • Join the libec-vi-repo project (contact us, e.g., by PM)
  • Install Subversion (svn)
    • Linux
    • (Mac) OS X
    • Windows
      • Download and install one of many Subversion command-line clients. See the "Optional" section below for remarks on GUI clients.
      • Add Subversion to the path. One nice and non-invasive way to do this is a batch file:

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.

  • Initial repository checkout

command-line syntax

svn checkout --username=MY_USERNAME https://svn.code.sf.net/p/libec-vi-repo/code/trunk
cd trunk




Workflow: Modification

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
  • If the lock succeeded, then you will be listed as the lock owner.
  • If the lock failed, then the lock owner (not you) is currently modifying about.vi, and you will have to wait until the lock owner is finished.

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
  • This allows other contributors to lock about.vi, now that you are done with it.
  • Analogy: always flush the toilet in a public (or private!) restroom after you are done with it.

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...

Other useful commands

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"


Further Reading


Optional

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
  • untested
  • on a per-client basis, so this is less important than svn lock.
    • I'd rather minimize the learning curve for new users... They can opt into this (for convenience?) later if they want?
  • is this on a per-repo basis? probably - cf. svn:ignore... but again, I didn't test this

Rsync

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?

Subversion GUI client

The most popular Windows svn client is probably TortoiseSVN

  • Pros
    • nice and friendly GUI
    • Integration with LabVIEW?
    • Includes command-line client (must be manually enabled during installation)
  • Cons
    • No usage instructions in this wiki as of this writing
    • Modifies Windows Explorer for ALL directories, which can be annoying
    • You don't get used to using command-line svn, which is platform-independent

To-do


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.