Follow Me On...

Entries in SVN (3)

Monday
Jul272009

Workaround for post-commit.bat failing to svnsync due to ssl certificate. 

 

My company has it’s svn server on a windows box which makes things like 30x more of a pain.  We use svnsync to synchronize a local repo with a repo one. 

Adding a post-commit.bat to call svnsync failed because it would hang waiting for user input to accept the SSL Certificate.

Error validating server certificate for 'https://someserver.com:443': 
- The certificate is not issued by a trusted authority.
Use the fingerprint to validate the certificate manually!
Certificate information:
- Hostname: someserver.com
- Valid: from Tue, 09 Dec 2008 01:49:41 GMT until Sun, 09 Jan 2011 01:49:41 GMT
- Issuer: Equifax Secure Inc., US
- Fingerprint: b1:4e:2d:b8:7f:27:96:ba:21:ef:46:fc:12:43:b5:4c:83:3b:dd:b9
(R)eject, accept (t)emporarily or accept (p)ermanently? svnsync: PROPFIND request failed on '/somefolder'
svnsync: PROPFIND of '/somefolder': Server certificate verification failed: issuer is not trusted
(https://someserver.com)

When svnsync was being run from post-commit it was being run as some system user which hasn’t already accepted the certificate to have it in it’s certificate store.  I began looking into how I would add it when I realized that I had a scheduled task for which I could specify the user to run as.  So, the simple solution is… create a scheduled task which invokes svnsync. 

Then add to your post-commit.bat

@echo Running from postcommit hook! >> C:\sync_serverupdatessvn.log 2>&1
call SCHTASKS /Run /TN >> C:\sync_serverupdatessvn.log 2>&1


Just replace <YOURTASKNAME> with the name you gave to your scheduled task you created.  You’ll also probably want to update the logfile name and path.

 

 

Wednesday
Sep202006

Windows SVN Repo Backup Script

Heres a simple windwos svn repo backup script i wrote. It makes a safe copy of three different svn repos i had. Each repository is backed up to a folder which has a date prefix and is located in the path specified by BACKUP_FOLDER.

REM —————————————————+
REM |SVN REPO BACKUP BATCH FILE |
REM |Created 9/20/06 - Blake Robertson|
REM —————————————————+

SET DATE_STR=%Date:/=%

SET BACKUP_FOLDER=R:\svn_backups

SET MIDDLEWARE_REPO=R:\svn_repo1
SET FW_REPO=R:\svn_repo2
SET DOCS_REPO=R:\svn_repo3

echo ——[ Middleware Backup ]————
SET DEST_PATH=”%BACKUP_FOLDER%\%DATE_STR%_middleware-svn_repo”
svnadmin hotcopy MIDDLEWARE_REPO DEST_PATH

echo ——[ Firmware Backup ]————
SET DEST_PATH=”%BACKUP_FOLDER%\%DATE_STR%_firmware_svn_repo”
svnadmin hotcopy FW_REPO DEST_PATH

echo ——[ DOCS Backup ]————
SET DEST_PATH=”%BACKUP_FOLDER%\%DATE_STR%_docs_svn_repo”
svnadmin hotcopy DOCS_REPO DEST_PATH
Wednesday
Sep202006

Fixing SVN Issues

When using tortoiseSVN you’re bound to eventually run into some of the issues below.  (Note: most of them can be avoided by right clicking and dragging when moving files etc.)

After 8 months or so of using SVN i’ve finally learned how to resolve them instead of working around them.  I intend to post fixes as i encounter them from now on.

Situation 1

Error Message:
Error    Commit failed (details follow):
Error    ‘xxxx’ is not under version control  

SOLUTION: IF YOU ACTUALLY DON’T WANT THIS FILE OR FOLDER.

Steps:
1) Do an SVN Update.
2) Commit any changes from this directory except for the file(s) that give you the error (uncheck those).
3) On the parent folder do an SVN revert.
4) It will report that there were no changes, click okay anyway and hopefully your problem is gone.

Here are some screenshots of an example problem i had.

 910-477206-thumbnail.jpg

 910-477218-thumbnail.jpg

910-477222-thumbnail.jpg 910-477224-thumbnail.jpg