free hit counter

Monday, May 11, 2009

SVN Issue 3119

I want to track this windows only Subversion bug. It's a total PITA, making branching and tagging more frustrating than they should have to be.

subversion: Issue 3119

Labels:

Tuesday, August 12, 2008

svn: tsvn autoprops

TortoiseSvn latest release has a way to propagate autoprops to all compatible TSVN clients. Way cool. Here's my list of autoprops:


# Code formats
*.a51 = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn:mime-type=text/plain
*.s = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn:mime-type=text/plain
*.c = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn:mime-type=text/plain
*.cpp = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn:mime-type=text/plain
*.h = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn:mime-type=text/plain
*.hpp = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn:mime-type=text/plain
*.java = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn:mime-type=text/plain
*.as = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn:mime-type=text/plain
*.cgi = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn-mine-type=text/plain
*.js = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn:mime-type=text/javascript
*.php = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn:mime-type=text/x-php
*.pl = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn:mime-type=text/x-perl; svn:executable
*.pm = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn:mime-type=text/x-perl
*.t = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn:mime-type=text/x-perl; svn:executable
*.py = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn:mime-type=text/x-python; svn:executable
*.sh = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn:mime-type=text/x-sh; svn:executable


# Image formats
*.bmp = svn:mime-type=image/bmp
*.gif = svn:mime-type=image/gif
*.ico = svn:mime-type=image/ico
*.jpeg = svn:mime-type=image/jpeg
*.jpg = svn:mime-type=image/jpeg
*.png = svn:mime-type=image/png
*.tif = svn:mime-type=image/tiff
*.tiff = svn:mime-type=image/tiff

# Data formats
*.pdf = svn:mime-type=application/pdf
*.avi = svn:mime-type=video/avi
*.doc = svn:mime-type=application/msword
*.eps = svn:mime-type=application/postscript
*.gz = svn:mime-type=application/gzip
*.mov = svn:mime-type=video/quicktime
*.mp3 = svn:mime-type=audio/mpeg
*.ppt = svn:mime-type=application/vnd.ms-powerpoint
*.ps = svn:mime-type=application/postscript
*.psd = svn:mime-type=application/photoshop
*.rtf = svn:mime-type=text/rtf
*.swf = svn:mime-type=application/x-shockwave-flash
*.tgz = svn:mime-type=application/gzip
*.wav = svn:mime-type=audio/wav
*.xls = svn:mime-type=application/vnd.ms-excel
*.zip = svn:mime-type=application/zip

# Text formats
.htaccess = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn:mime-type=text/plain
*.css = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn:mime-type=text/css
*.dtd = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn:mime-type=text/xml
*.html = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn:mime-type=text/html
*.ini = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn:mime-type=text/plain
*.sql = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn:mime-type=text/x-sql
*.txt = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn:mime-type=text/plain
*.xhtml = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn:mime-type=text/xhtml+xml
*.xml = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn:mime-type=text/xml
*.xsd = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn:mime-type=text/xml
*.xsl = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn:mime-type=text/xml
*.xslt = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn:mime-type=text/xml
*.xul = svn:eol-style=native; svn:keywords="ID URL LastChangedRevision LastChangedBy"; svn:mime-type=text/xul

Labels:

Wednesday, May 21, 2008

find your php version

Ya, so I'm totally clued out on this PHP stuff, but I do know that I want to use a Subversion module that requires PHP version 4.3 or later.

So throw this bit of code

< ?php phpinfo(); ? >



into a page named info.php (or whatever) in your /var/www/html directory and point your browser at it and it will let you know more than you ever wanted to know about your PHP installation.

source linkage

Labels:

Monday, May 19, 2008

SVN's future

The conflict over the future of SVN seems to be: support the average Joe programmer who has flocked to SVN, or try and out do the existing distributed version control systems? The full post makes for interesting reading.

Apparently he and his co-developers were surprised when they developed SVN that the great masses of regular Joe programmers would adopt SVN,


Now distributed version control systems like Mercurial and GIT are all the buzz right now with those on the bleeding edge of tools. That these systems are supposed to make branching and merging trivial situations sounds like a great idea to me.

Labels: ,

Monday, May 05, 2008

svn: change log messages

Fixing mistakes in SVN log messages isn't something it offers right out of the box.

As an admin you can change any log message you want:

svnadmin setlog --bypass-hooks c:/svn/myrepo -r 1234 1234-new-log-msg.txt


As a regular user your admin has to setup certain things so you can do it. Full details are on the SVN faq.

Labels:

Friday, March 07, 2008

svn autoprops

I was looking for my standard TortoiseSvn autoprops file and couldn't find it. So for future reference here it is:


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Tigris.org]

[HKEY_LOCAL_MACHINE\SOFTWARE\Tigris.org\Subversion]


[HKEY_LOCAL_MACHINE\SOFTWARE\Tigris.org\Subversion\Config]

[HKEY_LOCAL_MACHINE\SOFTWARE\Tigris.org\Subversion\Config\auto-props]
"*.doc"="svn:mime-type=application/msword"
"*.xls"="svn:mime-type=application/msexcel"
"*.ppt"="svn:mime-type=application/mspowerpoint"
"*.pdf"="svn:mime-type=application/pdf"
"*.png"="svn:mime-type=image/png"
"*.jpg"="svn:mime-type=image/jpeg"
"*.m"="svn:keywords=ID URL LastChangedRevision LastChangedBy"
"*.c"="svn:keywords=ID URL LastChangedRevision LastChangedBy"
"*.h"="svn:keywords=ID URL LastChangedRevision LastChangedBy"
"*.cpp"="svn:keywords=ID URL LastChangedRevision LastChangedBy"
"*.hpp"="svn:keywords=ID URL LastChangedRevision LastChangedBy"
"*.A51"="svn:keywords=ID URL LastChangedRevision LastChangedBy"
"*.pro"="svn:keywords=ID URL LastChangedRevision LastChangedBy"
"Makefile"="svn:keywords=ID URL LastChangedRevision LastChangedBy"
"Makefile.*"="svn:keywords=ID URL LastChangedRevision LastChangedBy"


[HKEY_LOCAL_MACHINE\SOFTWARE\Tigris.org\Subversion\Config\Miscellany]
"enable-auto-props"="yes"


Labels:

Thursday, February 07, 2008

SVN email on commit

So getting SVN to email on commit was way harder than it should have been, but it was mostly this was because I'm running my SVN server under Windows.

I was running around in circles with the usual \r\n differences, but the real problem was finding a compliant command line email utility. mailsend was the first one that worked not just when I was logged in and testing, but more importantly when the Apache service kicked off the job.

My post-commit.bat file in the hooks directory:

@echo off
::
:: emails out the log message after a commit
::
perl d:\svn\email-on-commit.pl %1 %2 testing


My full perl script (which isn't working without the testing flag being set):

#!/bin/perl
#
# Rian Sanderson
# Feb 7 2008
#
# First two inputs are standard issue from SVN
# Last argument is optional, and modifies the send to address so you
# don't start spamming your group with half baked emails
#
# Have users include a tilde (~) in their log messages for a quiet
# mode
#
# broken: does not work without testing flag
#
$repos=$ARGV[0];
$repos=~ s/\\/\\\\/g;
$rev=$ARGV[1];
$testingFlag=$ARGV[2];

if ($testingFlag) {
$debugLogName= "$repos/hooks/debug-log-post-commit-hook.txt";
open(DEBUGLOG,">>$debugLogName");

$theTime= localtime time;
print DEBUGLOG "\n\n--$theTime\n";
print DEBUGLOG " $repos $rev\n";
}

$quietModeFlag=`svnlook log -r $rev $repos | grep '~'`;

if ($quietModeFlag ) {
if ($testingFlag){
print DEBUGLOG " not generating an email per the user's request.\n";
exit 0;
}
}

#create the subject
$numFiles=`svnlook changed -r $rev $repos | wc -l`;
chomp($numFiles);
$synopsis=`svnlook log -r $rev $repos | head -c 42`;
$synopsis=~ s/\s*$//;
$subject="\"[$rev] $numFiles files: $synopsis...\"";
#$subject="\"[$rev]: $synopsis...\"";
if ("$testingFlag") {
print DEBUGLOG " numFiles: $numFiles\n";
print DEBUGLOG " subject: $subject\n";
}

# create the body of the message
$bodyFile= "$repos/hooks/$rev.txt";
`echo >> "$bodyFile"`;
system("svnlook log -r $rev $repos > $bodyFile");
`echo >> "$bodyFile"`;
`echo >> "$bodyFile"`;
`echo "files changed:" >> "$bodyFile"`;
system("svnlook changed -r $rev $repos >> $bodyFile");
`echo "." >> "$bodyFile"`;


#ship it off
if ("$testingFlag") {
$toAddr='me@mydomain.com';
}
else {
$toAddr='team@mydomain.com';
}
$fromAddr= 'svn@mydomain.com';
#$mailCmd="blat $bodyFile -server mail.mydomain.com -to $toAddr -from $fromAddr -subject $subject ";
$mailCmd="-d mydomain.com -smtp mail.mydomain.com -t $toAddr -from $fromAddr -sub $subject -m $bodyFile,text/plain +cc +bc";
if ("$testingFlag") {
print DEBUGLOG " mailsend $mailCmd";
}
close DEBUGLOG;

system("mailsend $mailCmd >> $debugLogName");

#dispose of the body
if (! $testingFlag) {
unlink($bodyFile)
}

Labels:

Monday, December 10, 2007

need to visualize SVN repo

I'm really feeling the need to visualize our SVN repository.

I start thinking that mostly I'd like a nice, color coded, browseable web interface, then I would like emails on commits, well, then I'd like continuous builds.

But here's the list of SVN web enablers:

  • Fisheye

  • P4Web

  • Trac

  • ViewVC

Labels: ,

Monday, July 17, 2006

SVN: adding a user

it's easy to add a user to subversion:


"C:\Program Files\Apache Group\Apache2\bin\htpasswd" -m C:\etc\svn-auth-file sally

Labels:

Friday, March 24, 2006

subversion: keyword substitution registry entries

To get automatic keyword substitution set for files as you add them you have to setup your client machine. I figured this out a while back, but as I setup TortoiseSvn on a new machine I forgot all about it.

Here's the registry hive you need:


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Tigris.org]

[HKEY_LOCAL_MACHINE\SOFTWARE\Tigris.org\Subversion]
"Version"="1.2.3"
"Revision"="15833"

[HKEY_LOCAL_MACHINE\SOFTWARE\Tigris.org\Subversion\Config]

[HKEY_LOCAL_MACHINE\SOFTWARE\Tigris.org\Subversion\Config\auto-props]
"*.doc"="svn:mime-type=application/msword"
"*.xls"="svn:mime-type=application/msexcel"
"*.ppt"="svn:mime-type=application/mspowerpoint"
"*.pdf"="svn:mime-type=application/pdf"
"*.png"="svn:mime-type=image/png"
"*.jpg"="svn:mime-type=image/jpeg"
"*.c"="svn:keywords=ID URL LastChangedRevision LastChangedBy"
"*.h"="svn:keywords=ID URL LastChangedRevision LastChangedBy"
"*.cpp"="svn:keywords=ID URL LastChangedRevision LastChangedBy"
"*.hpp"="svn:keywords=ID URL LastChangedRevision LastChangedBy"


[HKEY_LOCAL_MACHINE\SOFTWARE\Tigris.org\Subversion\Config\Miscellany]
"enable-auto-props"="yes"

Labels:

Thursday, January 12, 2006

IT guy kills Subversion server, mild mannered SW Eng. recovers to new machine within the hour

Subversion works way better than I had imagined.

Since I was using the straight filesystem storage method, I just pulled my backups out of the freezer and onto the new server, reinstalled SVN and Apache 2 there, and copied in the old config files.

The most delicate part was making sure I moved all my orphaned local machine checkouts over to the new checkout dir.

Labels:

Wednesday, December 07, 2005

Rolling back changes in Subversion

Ok, so here's where ClearCases's config specs and dynamic views are nice. Once you grok them its a pretty simple matter to work with older files.

In SVN I used the merge tool to roll back some changes on two semi isolated filees. It would have been just as easy to grab copies of those revisions and paste them in by hand.

Hmph, still learning...

Common Use-Cases

Labels:

Tuesday, November 29, 2005

subversion: traditional version control locks

So we want to disallow concurrent editing on binary files like word docs, PDFs, and powerpoint slides. To do this you need to add the following to the server's windows registry (can just cut/paste to a file named subversion.reg and double click to merge it in), then reboot your client machines (and for good measure restart apache on the server)


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Tigris.org\Subversion\Config]

[HKEY_LOCAL_MACHINE\SOFTWARE\Tigris.org\Subversion\Config\auto-props]
"*.doc"="svn:needs-lock=yes;svn:mime-type=application/msword"
"*.pdf"="svn:needs-lock=yes;svn:mime-type=application/pdf"
"*.png"="svn:mime-type=image/png"
"*.jpg"="svn:mime-type=image/jpeg"
"*.vsd"="svn:needs-lock=true"
"*.ppt"="svn:needs-lock=true;svn:mime-type=application/mspowerpoint"


[HKEY_LOCAL_MACHINE\SOFTWARE\Tigris.org\Subversion\Config\Miscellany]
"enable-auto-props"="yes"

Labels:

Monday, November 28, 2005

Subversion- adding a new repository

First create the repository and import in files to it (don't forget to add branches, tags, and trunks dir to the pre imported structure)

cd c:\svn
svnadmin create --fs-type fsfs newProject
cd c:\temp
svn import existingSrc file:///c:/svn/newProject -m "initial add"


Then make the repository live by editing subversion.conf

< Location /newProject\>
DAV svn
SVNPath C:/svn/newProject

AuthType Basic
AuthName "Subversion newProjectrepository"
AuthUserFile c:/bin/svn-auth-file

Require valid-user

AuthzSVNAccessFile c:/bin/svn-acl
</Location>



Then make the repository visible by appending to the access control list - svn-acl

# newProject
#
# on all subdirectories
# specialUsers group has full access, all others have read access only
#
[newProject:/]
@specialUsers= rw
* = r

Finally, restart the Apache service

Labels:

Tuesday, November 22, 2005

Subversion is up and running

Well it took me 2 hours and 10 minutes, rather than the 1 hour I was going to allow myself, but I now have Subversion up, a repository created, and a checkout on my local machine.

I have it integrated with Apache, and its running on a machine with Windows XP Media Center Edition. No small part of me doubted that I would be able to get it to work on this machine.

To start with I'm going with a single repository, stored in the native FS filesystem, with the recommended trunk, branch, and tags directories.

I used the excellent tutorial which I blogged about earlier. The only real exception was how I made the repository and imported files:

cd c:
mkdir svn
cd svn
mkdir tools
svnadmin create --fs-type fsfs tools
cd \temp\existingSrc
mkdir trunk
mv exisitingSrc/* trunk
mv trunk existingSrc
mkdir existingSrc/branches
mkdir existingSrc/tags
svn import existingSrc file:///c:/svn/tools

Labels:

Friday, November 11, 2005

Subversion Setup

The book: http://svnbook.red-bean.com/

The main page: http://subversion.tigris.org/

A great tutorial:http://svn.spears.at

A good example of an andvanced config: http://www.scons.org/cgi-bin/wiki/AdvancedBuildExample

Labels: