Showing posts with label SVN. Show all posts
Showing posts with label SVN. Show all posts

Sunday, February 5, 2017

Raspberry Pi SVN server

These instructions worked perfectly:

https://www.jeremymorgan.com/tutorials/raspberry-pi/raspberry-pi-how-to-svn-server/

Probably copied from the first link:

http://www.calumtomeny.co.uk/wordpress/simple-svn-server/



Thursday, November 13, 2014

command line SVN in Windows

I have a system with TortoiseSVN installed, and a windows program that is running python that can make DOS system calls. I needed a way to do an SVN checkout from our repository from a python script.

TortoiseSVN has a command line interface, but it turns out that what this interface actually does is control the Tortoise GUI, not directly issue SVN commands. What I needed was to perform checkouts of specific files from a list of repository locations and revision levels. It turns out that using the Tortoise command line interface it is possible to check out folders, but not individual files. Also, the GUI pops up and you have to his OK or CANCEL, etc.

In the end, I installed a different SVN client. I recall that there weren't all that many options; I chose "Slik Subversion" despite it's lack of documentation.

https://www.sliksvn.com/en/support/using-subversion/basic-subversion-usage

I had a ton of problems getting the command line for performing the SlikSvn export to work, I was getting a message 'C:\Program' is not recognized as an internal or external command, operable program or batch file.' As one forum thread I consulted noted, this is obviously because "Program Files" has a space. By now, I am not sure exactly why this was a problem now and not with any of the other GNU routines that I am command-line calling from other parts of my python code. However, I did use the "shortened" version of Program Files in the final code. The final code also had a bunch of nice neatening and trimming of the SVN location pointer from each line of the configuration file. Here is the result:

svn_command = "C:/Progra~1/SlikSvn/bin/svn.exe export --force -r %s %s %s" % (svn_level, checkout_url, buildDir)
status = 0
try:
status = os.system('"C:/Progra~1/SlikSvn/bin/svn.exe" export --force -r %s %s %s' % (svn_level, checkout_url, buildDir) )
except:
print "Svn checkout command %s failed. Exiting." % svn_command
manifest_file.close()
return
if (status != 0):
print "Svn checkout command %s failed. Exiting." % svn_command
manifest_file.close()
return


Here is a forum thread about using alternatives to os.system to get status back from system calls. Again, I am not sure why I was over on this page, since os.system ended up verifiably returning status very nicely in my final code.

http://stackoverflow.com/questions/3503879/assign-output-of-os-system-to-a-variable-and-prevent-it-from-being-displayed-on

Here is the Wikipedia page listing all the SVN clients available. There's plenty of Windows ones here even after the Linux clients are ruled out. Not sure why I picked SlikSVN except that somebody must have mentioned it favorably in a forum thread somewhere.

http://en.wikipedia.org/wiki/Comparison_of_Subversion_clients


Here's the "money link" where it states that there is no way to do a single file checkout from the TortoiseSVN command line controller
http://subversion.1072662.n5.nabble.com/Ask-question-gt-Can-checkout-only-single-file-td138991.html


Links to the TortoiseSVN Command Line controller documentation:
http://stackoverflow.com/questions/1625406/using-tortoisesvn-via-the-command-line
http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-automation.html
Note: I checked out using Export instead of Checkout, but that GUI control for this command is even less helpful:
http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-dug-export.html
However, knowing that single-file checkouts just don't happen in SVN (from the below link) was the knowledge that enabled me to format my SlikSubversion command as an Export:
http://stackoverflow.com/questions/122107/checkout-one-file-from-subversion

When I was thrashing about with the "C:\Program is not recognized as an internal or external command" error, I found a few links about something called the Command Processor AutoRun setting. This turned out to not have anything to do with my problem, but was interesting anyways:
http://www.donationcoder.com/forum/index.php?topic=33462.0;prev_next=prev
http://blogs.msdn.com/b/oldnewthing/archive/2007/11/21/6447771.aspx
http://www.herongyang.com/Windows-Security/PWS-Command-Processor-AutoRun-Registry-Value.html



Tuesday, September 11, 2012

Unix Subversion get SVN level for a directory

Randomly trying variations on svn log weren't working for me, so I found out that there is a stand-alone utility to do this task: svnversion .

From here:

http://www.zorched.net/2006/07/20/getting-the-revision-number-of-your-subversion-working-copy/

Thursday, August 16, 2012

How to tell what process is preventing my USB drive from ejecting

Results from the above query actually led to an answer, finally.

First of all, I found, downloaded, and tried DevEject, which has a nice GUI that identifies the reason why the "cannot eject xxxxx right now, try again later" message is coming up.

http://www.technostarry.com/windows/how-to-solve-usb-drive-is-in-use-problem-prevent-usb-locking/

http://deveject.com/

In my case, this led to the discovery, obvious in retrospect, that the TortoiseSVN cacheing process (tsvncache.exe) was the process grinding away in the directories on my USB backup drive. Further queries revealed that it's pretty easy to curtail this cacheing to just the directories on my main drive that I need it to show the SVN status of. This has the fortunate side effect of eliminating a lot of unnecessary system load as well. I am far from the first person to have had this problem, and there are lots of forum threads and web pages discussing how to do this:

http://assorted-experience.blogspot.com/2008/03/optimizing-tsvn-cache.html

Note that the above link hints that Process Explorer might have accomplished what DevEject does.

http://superuser.com/questions/69699/prevent-tsvncache-from-running

http://www.paraesthesia.com/archive/2007/09/26/optimize-tortoise-svn-cache-tsvncache.exe-disk-io.aspx





Tuesday, August 7, 2012

unix svn show log

Still getting the hang of command line svn, had to look up show log. This page answered my question and more:

http://stackoverflow.com/questions/4881129/how-do-you-see-recent-svn-log-entries

Most useful was show log -v !!!!

Thursday, December 15, 2011

SVN options ci

I find it interesting that we are using both Tortoise and "plain" SVN to access our SVN repository, depending on the system being used. For our unix boxes, plain SVN must be used at the command line.

From a recent search for the proper syntax for SVN command line options, here is a nice page:

http://www.yolinux.com/TUTORIALS/Subversion.html

Thursday, June 23, 2011

TortoiseProc Launch Failed The directory name is invalid

It looks like my installation of TortoiseSVN is becoming unravelled and I can no longer perform a checkout into a fresh directory. Doing things in directories that have already been checked out still seems to work.

There are many hits on Google for this problem:

http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&viewType=browseAll&dsMessageId=2329509
http://www.webtechquery.com/index.php/2010/11/tortoiseproc-launch-failed/
http://groups.google.com/group/tortoisesvn/browse_thread/thread/506470578048be52?pli=1

All of which lead to the same solution of just doing a reinstall, apparently a reinstall with a laborious cleanup.

However, nobody mentioned an obvious workaround which I tried successfully:

From one of my checked out directories where Tortoise still works, I called up the repo-browser. From that directory, I selected the folder that I wanted to check out and from a right-click selected "Check out" from there it let me enter the location that I was trying to put the new checkout into and it worked fine. This keeps me going for now until the unlikely day that I have time to wipe TortoiseSVN's butt for it.

Tuesday, June 14, 2011

How to exorcise the demon of saved authentication from Tortoise SVN

Working in an evironment where multiple SVN users should be able to edit files in a checked-out folder, update, and commit changes. It took FUCKING FOREVER to figure out what we were doing wrong. No matter what, whenever anybody tried to do an SVN update, commit, or even diff, it would ask the the password of a particular user rather than prompt for both user id and password.

Web site after web site advised how to clear the saved authentication data from the "Settings" dialog, which I did. I even did the nuclear clear-out option of clearing subdirectories from the "auth" folder in Documents and Settings.

What is not explained is that no matter what you do, if a folder has been checked out by a particular SVN user with "Authentication Saved", there is no way to make it forget what user checked it out.

The solution was to move the folder checked out by the previous user, then check it out again after having cleared the saved authentiation. This time, during the checkout, it asked for the user id, and I didn't check "save authentication". Now everybody can use Tortoise on the files in this folder, and it will ask for their user name for every operation.