<2017 April>
SunMonTueWedThuFriSat
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

On this page...

Search

Links

Member of...


ASP Insiders

MVP Visual Developer ASP/ASP.NET

Enter CodeZone

Blog Categories

Microsoft

Blogroll

Deutsche Resourcen

Management

Sign In
 

#  Sunday, 19 April 2009

Sharding was introduced for FSFS repositories in Subversion 1.5, but only now I moved to a sharded repository (at time of this writing: Subversion 1.6.1). This meant - as usual - a dump / create / load dance. Followed by the pack operation:

svnadmin dump c:\subversion\sharpdevelop > c:\sd.dump
svnadmin create c:\subversion\sharpdevelop
svnadmin load c:\subversion\sharpdevelop < c:\sd.dump
svnadmin pack c:\subversion\sharpdevelop

Without svnadmin pack, you only get sharding. Executing svnadmin pack puts all the shards together into a single file. This makes certain operations such as svnadmin hotcopy way faster.

Categories: Subversion
Sunday, 19 April 2009 08:34:11 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Thursday, 16 August 2007

In my previous post FastCGI in IIS7 I mentioned that I am running WebSVN on this box to give FastCGI a real-world test run. Today, I upgraded to v2.0 of WebSVN. They sure do ship a good-looking template this time around:

The RSS functionality is enabled too in this version (I was running code directly from their repository last time around...). I have to say that WebSVN turned into a must-have tool for anyone using Subversion.

Link to WebSVN on iis7.chrison.net (feel free to play around)

Categories: IIS | Subversion
Thursday, 16 August 2007 15:22:40 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Friday, 19 January 2007

I just gave StatSVN a try, which compiles statistics for Subversion repositories. For my trial, I used the 2.1 branch of SharpDevelop - which, because only created a month ago - should create a small and manageable statistic to start out with.

What do you need to get up and running with StatSVN (except, of course, StatSVN itself)? Well, the Subversion command line client (get it here), as well as Java. Working with StatSVN is really easy - simply follow the steps outlined in the readme and you can't go wrong - it even works nicely on Windows Vista.

If you don't want to install StatSVN on your box just to see how a report might look like for a real-world project, I have packaged the report generated for our SharpDevelop 2.1 branch:

DemoReport.zip (1.27 MB)

Before looking at the report, check out the LOC and churn rate I have posted below:

This branch was created from /trunk to only contain bug fixes from Beta 2 to release candidates and RTW. That's why there are spikes of activity, with no activity at other days. Also, not all developers are working on the branch, many are concentrating on developing features for the new version which lives in /trunk.

Friday, 19 January 2007 11:46:42 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Thursday, 28 December 2006

I wrote about SVK in Mirror, mirror on the wall and Going local with SVK. Now the release of version 2 has been announced. Note: WIN32 binaries are not yet available.

What is SVK? A quote from the homepage: svk is a decentralized version control system built with the robust Subversion filesystem. It supports repository mirroring, disconnected operation, history-sensitive merging, and integrates with other version control systems, as well as popular visual merge tools.

Thursday, 28 December 2006 17:20:56 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Tuesday, 19 September 2006

Beta 1 of SharpDevelop2 2.1 is available for download. While I was putting together the annoucement for v2.1 yesterday, I realized that for a point release, we really managed to put in a lot of new cool features:

A couple of WOW features (for me, at least): Not only can you compile an application for different versions of .NET, you also get version-specific code completion support. Another cool one is that you can host SharpDevelop in your application, providing your application a "macro editor" (on steroids I might add) with full .NET support. And to pick a third, code analysis rounds out our professional offering in addition to code coverage as well as unit testing.

Two features did not make it for the Beta 1 announcement as they don't yet cover all the scenarios we are hoping for: integrated Subversion support (yeah!) and targetting the Compact Framework for Windows CE devices. Those slipped silently into this release.

As you can see, SharpDevelop is ever growing and the developers working on it can be rightly proud of their achievements!

Finally, a kind of "call to action": let us know what you think! Not only in our forums, but also in your blogs, communities, et cetera. We need your feedback regarding feature set, stability, and much more.

Categories: .NET | 2 Ohhhh | C# | Cool Download | Subversion | this | Use the source Luke
Tuesday, 19 September 2006 12:10:55 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Monday, 11 September 2006

Subversion 1.4 is available. The especially good news? Svnserve can now be run as a native Windows service (more).

Categories: Subversion
Monday, 11 September 2006 14:33:47 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Monday, 05 June 2006

The concept of shelving was made popular by Visual Studio Team System's source control system - it allows you to "shelve" your changes for a couple reasons, like:

  • You have to work on a bug fix immediately, but you are in the middle of implementing a new feature. You cannot check in those half-baked changes, only the bug fix. So you shelve your feature work. Once done with the bug fix, you unshelve the feature work and continue.
  • Sharing work. Another developer needs the changes you are currently working on, but you are not yet done. So you shelve your changes and the other dev unshelves them and can get productive immediately.
  • Code review. Instead of having someone come over to your office (or worse, email the files) to review the changes before checkin, you shelve them and the reviewer can unshelve them.
  • Backup. How many times do you leave your workplace with a feature not yet completed? What to do with this build-breaking half-baked work? Shelve it!

Now you get the idea why shelving is pretty neat. Even Subversion does support the concept although it is not explicitly there: the blog posts Shelving in Subversion and Shelving Subversion show how you can make shelving happen with Subversion.

Categories: Subversion | Team System
Monday, 05 June 2006 11:49:37 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Friday, 14 October 2005

Remember my call to action in Web applications and SMTP proxies don't mix well (it seems)? I mentioned that I am guilty as well - not only for Web applications as it turned out, but also for other server-based software, such as the Subversion post-commit hook I wrote.

You can already guess the contents of the change log (the last public version was 1.7):

  • SMTP authentication & SMTP server port options added

If you are running the hook today, all you need to do is copy the new post-commit.exe over your existing one (assuming you use 1.7), and add the following four lines to your post-commit.exe.config's <appSettings> section:

<add key="SMTPAuthentication" value="" />
<add key="SMTPServerPort" value="25" />
<add key="SMTPUsername" value="username" />
<add key="SMTPPassword" value="password" />

Those values default post-commit.exe to the 1.7 behavior. To use authentication, set SMTPAuthentication to BASIC, and provide username and password. Most of the time, you will not need to play with the server port.

Finally, here is the usual binary & source code archive:

SvnPostCommitHook1.8.0.51014.zip (424.24 KB)

Categories: Subversion | this | Use the source Luke
Friday, 14 October 2005 11:23:35 (W. Europe Daylight Time, UTC+02:00)  #    Comments [3]

 



#  Tuesday, 23 August 2005

I admit that I am not the sort of person who likes to go through long and winded installation instructions. However, I am willing to go to great lengths when it comes to security - still with certain limits though. And I hit such a brick wall today: trying to secure Subversion. From the documentation, I knew that the recommended path was SSH, so I set out to find out how to get this up and running on my Windows box.

Owning the black sock in Google fu, I came up with various articles, the most helpful being SVN+SSH+public key authentication on Windows Box as server. Most helpful because after reading the aforementioned recipe plus Subversion / TortoiseSVN SSH HowTo, I decided to scratch my efforts. Why?

For starters, I am not a big fan of Cygwin. That's just personal mischief of a Windows guy, I can swallow my pride when the tools that depend on it provide merit. What's more of a problem for me is installing a service for adding security to another service - especially if I need that new service just for the "security purpose", and not the other bells and whistles it can provide (plus the security issues that might be hidden in those unused parts). Call me paranoid, but I simply like to reduce "moving parts" in my setups, because: What's worse than malicious traffic? Right, encrypted malicious traffic.

Secondly, do you think - honestly - that developers love to jump through hoops to get access to the repository? (I am referring to the client side of things on Windows) Not really. From the top of my head, I fall short of naming a single developer I personally know that would love to follow those steps. But every single one of them would be more than willing to just replace svn:// for svns:// when accessing a repository.

Conclusion: yes, I am whining about the usability of an open source project. As I am participating on one myself, you very well can spare me the "usual" arguments of do-it-yourself-because-the-sourcecode-is-available-anyways. This is a rant. I want to be unreasonable. But it sure would be nice if security was in the box. Especially nowadays.

Categories: Administration | Security | Subversion
Tuesday, 23 August 2005 16:00:57 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Wednesday, 10 August 2005

This was a longer-planned upgrade to our Subversion server that happened today: moving from the 1.1 series to 1.2.1. It went smoothly, especially because I played it safe by doing a dump / load cycle (more details to be found in Migrating a Repository) with all repositories. Safety wasn't the only concern: as detailed in the release notes, I also wanted to move the repositories to a FSFS back end, and take advantage of xdelta compression. I was mostly after server-side features, I don't see many of our devs use the optional locking...

Categories: Administration | Subversion
Wednesday, 10 August 2005 17:29:57 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Monday, 08 August 2005

I finally got around to make a new version of SvnPostCommitHook. For one, it was about time to include Ben's changes, and secondly I wanted to roll a new version onto our Subversion box - it was still running on v1.3. So much for dogfooding...

With that, here is the change log. Note that the last public version was 1.5:

8/8/2005 - 1.7, Changes by Christoph Wille

  • LookInfo getter logs when _lookinfo is null
  • MailTextOnly & AppendDiffToMail properties added to .config file (text-only currently does not send diffs anyways)
  • UU case added to svnlook parser
  • Change SvnLookOutputParser.SkipBlanks method to return bool if StringCollection hasMoreLines

5/14/2005 - 1.6, Changes by Ben Lowery, ben AT blowery DOT org

  • <pre> blocks for code#
  • Updates CSS for new HTML
  • Logic for finding CSS updated
  • More logging

And here is the usual binary & source code archive:

SvnPostCommitHook1.7.zip (420.75 KB)
Categories: Subversion | this | Use the source Luke
Monday, 08 August 2005 17:39:49 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Wednesday, 27 July 2005

This post is again motivated by last week's Community Bootcamp on ASP.NET 2.0, the CBC05. I presented "Under the Covers - Exploring Internals, Page Lifecycle and the Compilation Mode" from TechEd, using the samples that Simon Calvert provided me with (special thanks fly out to Simon, Ben Miller and Rich Ersek @MS for providing us with material - I know I can be a royal pain in the posterior... sometimes at least).

The talk included a demo of a database-backed virtual path provider (files don't come from the file system but a database, dynamically). Somehow we started talking about how cool it would be if you could test your Web sites without checking them out from source control in the first place - by simply writing a virtual path provider that goes to the repository on demand. I wrote that idea down.

Actually, I didn't think I'd get around to doing that. But yesterday I decided to pester one of my devs on the #develop project, namely Daniel Grunwald. He has implemented the Subversion addin for our 2.0 version, so he had experience with NSvn, the managed API for talking to Subversion. I sent a stripped down version of the vpath provider to him, and asked him to replace database code with NSvn code where appropriate.

It didn't take long, and I had a command-line verified version back, and all I had to do was make sure that it works with ASP.NET 2.0. There were a few problems I ran into (like Subversion is case-sensitive and I didn't want that for the Web scenario). Some of the issues arose simply because client and Web developers have different backgrounds. Talk about path separators. Or directories where you have to drop assemblies.

Now, let's stop talking, let's take a look at the provider in action:

SvnVPathProvider.wmv (3.76 MB)

Want to get your hands on that DemoSiteSvn directory with the current rendition of the SubversionVirtualPathProvider? No problem, just a couple of notes up front on what you should be aware of:

  • Only file names are currently treated specially for casing. Ie directories still do react in a case sensitive way.
  • The file name cracking code needs to be reviewed. Currently, this is a quick hack.
  • appSettings need to be placed in a separate .config file. Reason is that web.config cannot be obtained via a VirtualPathProvider, and thus this file has to be checked out separately. And I don't want to get in the way of automating this by requiring entries in web.config.
  • Package it as an assembly, so only the \bin folder needs to be copied to get up and running.
  • The VirtualPathProvider requires (at the very least) anonymous access to the repository. Passing security tokens is not implemented.

With those notes out of the way, thanks fly out to the ASP.NET team for providing me with the sample of their virtual path provider in the first place. It has been a tremendous help to get this thing off the ground. And maybe in turn this sample will help others to get started:

SvnVppDemo.zip (972.37 KB)

Installation note: the two DLLs in the system32 folder need to be dropped in the respective folder of your system. Do not place them into \bin. Unless you want to get into trouble, that is.

What is left to say? Oh, the source code, of course! I thought you might be interested in reading it online instead of having to download an almost 1MB-size file first. Here it is (App_Code\SubversionVirtualPathProvider.cs):

using System;
using System.IO;
using System.Collections;
using System.Globalization;
using System.Configuration;
using System.Text;
using System.Web;
using System.Web.Util;
using System.Web.Hosting;
using System.Web.Caching;
using NSvn.Core;
using NSvn.Common;

namespace ICSharpCode.Web.Providers
{
public class SubversionVirtualPathProvider : VirtualPathProvider
{
#region class HashCodeCombiner
internal sealed class HashCodeCombiner
        {
            // Start with a seed
            private long _combinedHash = 5381;
            
            internal void AddLong(long l)
            {
                _combinedHash = ((_combinedHash << 5) + _combinedHash) ^ l;
            }
            
            internal string CombinedHashString
            {
                get
                {
                    return _combinedHash.ToString("x", CultureInfo.InvariantCulture);
                }
            }
}
#endregion

#region class SubversionVirtualFile
internal class SubversionVirtualFile : VirtualFile
    {
        string fullPath;
        DirectoryEntry entry;
            
        public SubversionVirtualFile(string virtualPath, string fullPath, DirectoryEntry entry)
                : base(virtualPath)
        {
            this.fullPath = fullPath;
            this.entry = entry;
        }
            
        public override bool IsDirectory {
            get {
                return entry.NodeKind == NodeKind.Directory;
            }
        }
            
        public override Stream concat()
        {
            Client client = new Client();
            MemoryStream ms = new MemoryStream();
            client.Cat(ms, fullPath, Revision.Head);

            // .Cat closes the stream, so we have to copy it
            MemoryStream ms2 = new MemoryStream(ms.GetBuffer());
            ms2.Position = 0;
            return ms2;
        }
}
#endregion

public static void AppInitialize()
    {
        SubversionVirtualPathProvider provider = new SubversionVirtualPathProvider();
        HostingEnvironment.RegisterVirtualPathProvider(provider);
    }
        
    string GetSvnFullpath(string virtualPath)
    {
        if (bool.Parse(ConfigurationManager.AppSettings["svnvppStripVdir"]))
        {
            // this will break root Webs, StripVdir should be the default however
            int pos = virtualPath.IndexOf('/', 1);
            virtualPath = virtualPath.Substring(pos, virtualPath.Length - pos);
        }

        return ConfigurationManager.AppSettings["svnvppRepositoryUrl"]
            + virtualPath;
        }

    string GetSvnFullpath(string virtualPath, string fileName)
    {
        return FixupSvnFullpath(GetSvnFullpath(virtualPath), fileName);
    }

    // Subversion is case sensitive, this we switch the filename here
    string FixupSvnFullpath(string svnPath, string fileName)
    {
        int pos = svnPath.LastIndexOf('/');
        string parentDirectory = svnPath.Substring(0, pos + 1);
        return parentDirectory + fileName;
    }
        
    DirectoryEntry GetEntry(string virtualPath)
    {
        Client svnClient = new Client();
        string fullPath = GetSvnFullpath(virtualPath);
        int pos = fullPath.LastIndexOf('/');
        string parentDirectory = fullPath.Substring(0, pos);
        string entryName = fullPath.Substring(pos + 1);

        try
        {
            DirectoryEntry[] entries = svnClient.List(parentDirectory, Revision.Head, false);
            foreach (DirectoryEntry entry in entries) 
            {   
                if (0 == String.Compare(entry.Path, entryName, true))
                        return entry;
            }

            return null;
        }
        catch (SvnClientException ex)
        {
            if (ex.ErrorCode == 160013) // parent directory not found
                return null;

            throw;
        }
    }
        
        public override bool FileExists(string virtualPath)
        {
            DirectoryEntry e = GetEntry(virtualPath);
            if (e != null)
                return e.NodeKind == NodeKind.File;

            return Previous.FileExists(virtualPath);
        }
        
        public override bool DirectoryExists(string virtualDir)
        {
            DirectoryEntry e = GetEntry(virtualDir);
            if (e != null)
                return e.NodeKind == NodeKind.Directory;
            return Previous.FileExists(virtualDir);
        }
        
        // Obtain the file. This will only be called if the hash that we return is
        // different than that the runtime holds on to as a cached indicator.
        public override VirtualFile GetFile(string virtualPath)
        {
            DirectoryEntry e = GetEntry(virtualPath);
            if (e != null)
                return new SubversionVirtualFile(virtualPath, GetSvnFullpath(virtualPath, e.Path), e);
            // Default to the previous implementation
            return Previous.GetFile(virtualPath);
        }
        
        /// ///////////////////////////////////////////////////////////////
        /// Return a hash value indicating a key to test this file and dependencies have not been
        /// modified
        public override string GetFileHash(string virtualPath, IEnumerable virtualPathDependencies)
        {
            HashCodeCombiner hashCodeCombiner = new HashCodeCombiner();
            
            ArrayList unrecognizedDependencies = new ArrayList();
            
            foreach (string virtualDependency in virtualPathDependencies)
            {
                DirectoryEntry e = GetEntry(virtualDependency);
                if (e != null) {
                    hashCodeCombiner.AddLong(e.Size);
                    hashCodeCombiner.AddLong(e.CreatedRevision);
                } else {
                    unrecognizedDependencies.Add(unrecognizedDependencies);
                }
            }
            
            string result = hashCodeCombiner.CombinedHashString;
            
            if (unrecognizedDependencies.Count > 0)
            {
                result += Previous.GetFileHash(virtualPath, unrecognizedDependencies);
            }
            
            return result;
        }
        
        /// ///////////////////////////////////////////////////////////////
        /// The cache dependency is a specialized object that means that the runtime
        /// can perform file monitoring and change notifications directly
        public override CacheDependency GetCacheDependency(string virtualPath, IEnumerable virtualPathDependencies, DateTime utcStart)
        {
            // This VPP does not create CacheDependencies
            DirectoryEntry e = GetEntry(virtualPath);
            if (e != null)
                return null;
            
            return Previous.GetCacheDependency(virtualPath, virtualPathDependencies, utcStart);
        }
    }
}

 

Categories: 2 Ohhhh | ASP.NET | Community | Subversion
Wednesday, 27 July 2005 08:18:56 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Friday, 13 May 2005

Another release based on contributions by Ben Lowery:

  • Colorized diff support
  • CSS uses an external CSS file.  No longer in the code.
  • Added configuration setting for CSS file to use
  • Added "svnlook changes" parsing support for _U (property updates)

SvnPostCommitHookv1.5.zip (420.62 KB)

Categories: Cool Download | Subversion
Friday, 13 May 2005 10:10:03 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Monday, 02 May 2005

Ben Lowery sent me changes for the SvnPostCommitHook application. From his email: Here's my version of the code.  I updated it to be able to use DotNetOpenMail, as I sometimes have problems using CDO through System.Web.Mail. I also updated it to support a pluggable mail formatter, with a text and an HTML formatter in the current code.  At the moment, it's up to the mailer to decide how mail is sent, but that could be easily pulled out into a config file at some point, as could the format of the html or the css that I'm using.

Change log details:

  • Added abstract base for mailing
  • Moved System.Web.Mail based mailer to CdoMailer
  • Added option to send mail with DotNetOpenMail
  • Added MessageFormatter hierarchy for message formatting
  • Added HtmlMessageFormatter for html change messages
  • Moved text message formatting into TextMessageFormatter
  • Added package batch script to rename exe to post-commit.exe
  • Added Library directory for references
  • Added log4net to the Library directory
  • Made SilentCmdLineApplication::Execute simpler
  • Moved parsing logic into SvnLookOutputParser

SvnPostCommitHookv1.4.zip (417.83 KB)

Monday, 02 May 2005 19:09:01 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Tuesday, 26 April 2005

In the second installation of my SVK article series, I'm taking my Subversion repository offline on my notebook, do some work, reconnect and merge my changes with the central Subversion repository.

To work with SVK, you don't need the Subversion service (svnserve) running. Another bonus is that SVK doesn't create the (dreaded, I might say) .svn folders, which (a) roughly double the disk size of your project, (b) get you into hot water with VS.NET, which is why there is a TortoiseSVN build that names the .svn folders differently. But I digress.

First, we have to create a local copy (the one created in the previous article is directly linked to the remote repository):

svk cp //SharpDevelop/trunk //SharpDevelop/local

This will also prompt you in Notepad for a commit message. Alternatively, you could have passed the commit message as part of the cmd line:

svk cp -m "initial import" //SharpDevelop/trunk //SharpDevelop/local

Now, check out the local branch to a directory on disk (note: this directory will be auto-created).

svk checkout //SharpDevelop/local c:\workingcopy

You will be positively surprised how fast this is. And there are no .svn directories in sight. So let's change a file and commit it back to our local repository:

svk commit -m "v2.06 note" readme.txt

This file is only changed in the local repository, not the remote one. But this is the intention of working offline (during travel, at home, you name it).

How do we get the changes back into the central repository? First, sync the trunk with the remote repository:

svk sync //SharpDevelop/trunk

If you have multiple repositories on your computer that you want to sync in one go, use:

svk sync -a

So, let's see if our changes conflict with changes in the central repository:

svk smerge -C //SharpDevelop/local //SharpDevelop/trunk
Auto-merging (0, 1900) /SharpDevelop/local to /SharpDevelop/trunk (base /SharpDevelop/trunk:1897).
Checking locally against mirror source svn://glumpatweri.emailgwiax.com/Fidalgo/trunk.
U   SharpDevelop/setup/readme.txt
New merge ticket: 4c8874e7-0e9e-2041-95c6-598e77699a82:/SharpDevelop/local:1900

If there are no problems (as is the case here), go ahead and perform the merge:

svk smerge //SharpDevelop/local //SharpDevelop/trunk

You are again prompted for the commit message, however, this time remember this is for the total of your changes (unless you use -I). Depending on your Subversion setup, you will be prompted to provide a password:

Password for 'Administrator':

Well, most likely you are not known by this account in Subversion... simply press Enter, and you will be prompted for a different username. A tad counterintuitive at first, but it works. The change is now in the central repository.

There is one thing left to do - merge the changes from the trunk (which you synced previously) into the local copy:

svk smerge //SharpDevelop/trunk //SharpDevelop/local

And finally update your checked out working directory:

svk up c:\workingcopy

Now that wasn't too bad at all. Especially given the fact that you were working offline from a central repository. Oh, and the procedure is for real: revision 1909 in the #develop repository resulted from me writing this step list.

Categories: Subversion
Tuesday, 26 April 2005 12:57:07 (W. Europe Daylight Time, UTC+02:00)  #    Comments [2]

 



#  Monday, 25 April 2005

Beauty is not tonights topic, neither a talking mirror - Subversion repository mirrors are. There are a couple of ways to mirroring your repository, one being SVN::Mirror. With my pronounced distaste for the make install dance, I was on the prowl for some solution with a more Windowsy touch to it.

Not too long into Google-Fu I stumbled across SVK, which has (a) a WIN32 setup, (b) loads of features which will be the topic of future blog posts:

  • Trans-backend mirror and sync for Subversion, CVS, Perforce (not on Windows currently if I gather correctly)
  • All operations can be performed while offline. Now that is way cool if you are working while travelling!

SVK uses Subversion FSFS for local storage, which means prior to installing SVK you need to install Subversion. With both packages on your machine, you can start exploring. All you need is a command prompt and Windows Explorer.

svk depot --init

This will initialize the // (default) depot. Create c:\svkroot, we will relocate the default repository there next.

svk depot --relocate // c:\svkroot

I am not really interested in hosting a read-only copy of a Subversion repository in my user profile. Thus for this relocation to proceed, you also need to copy the contents of C:\Documents and Settings\Administrator\.svk\local (which is a bare bones SVN repository) into the c:\svkroot directory.

svk mirror svn://glumpatweri.emailgwiax.com/Fidalgo/trunk //SharpDevelop/trunk

Now the mirroring can begin - svk mirror is used to set up a link to an existing Subversion repository.

svk sync //SharpDevelop/trunk

Depending on the repository, grab a cup of coffee. This sync operation will take some time. Oh, and for keeping a mirrored repository in sync with the master, create a scheduled task with this command.

svnserve -d -r c:\svkroot

Testing, testing. Fire up svnserve and use TortoiseSVN to check out the read-only mirror:

Done. You have successfully mirrored a Subversion repository. Read-only. Working offline and other features of SVK will be covered later.

Monday, 25 April 2005 19:40:50 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Monday, 11 April 2005

The post commit hook for Subversion now has reached a stage where I consider it feature complete. Newly added for this release:

  • log4net for logging important information (ie exceptions) necessary for debugging a hook that is supposed to run automatically. Note that it uses v1.2.9 of log4net, which is a Beta release. The log file name is post-commit.log (you can change this in post-commit.exe.config)
  • Nicely formatted commit mail. The change log line items are parsed, the A, U & D information is used to build Added, Modified & Deleted sections in the message.

Here is an example of the message format (from the #develop commit mailing list):

Author: mattward
Date: 2005-04-10 20:06:25 +0200 (So, 10 Apr 2005)
New Revision: 1840
Log Message:
Added basic .manifest schema.  Schema annotation displayed alongside
auto-completion list. Mixed namespaces and simple content types
now supported.  Added attribute value auto-completion.

Added:
trunk/SharpDevelop/data/schemas/manifest.xsd
....
trunk/SharpDevelop/src/AddIns/.../SimpleContentWithAttributeTestFixture.cs
Modified:
trunk/SharpDevelop/data/resources/StringResources.dk.resources
...
trunk/SharpDevelopResources/LanguageResources/LocalizeDb.mdb
Deleted:
trunk/SharpDevelop/src/AddIns/.../ActiveElementPathTestFixture.cs

 -- SvnPostCommitHook 1.2.0.50410 --

Installation Take all three files from \Hook and place them in your repository's hooks directory. Open post-commit.exe.config and modify the entries in the appSettings section to match your installation and needs.

Test it Run post-commit.exe once interactively from the command line to see if your installation is ok. Potential errors are only logged to post-commit.log, not to the Console. So be sure to check it!

Finally, the download:

SvnPostCommitHook1.3.0.50411.zip (105.82 KB)
Categories: .NET | Subversion | Use the source Luke
Monday, 11 April 2005 12:06:49 (W. Europe Daylight Time, UTC+02:00)  #    Comments [1]

 



#  Sunday, 10 April 2005

I updated the post commit hook application, however, installation advice from the original blog entry Post Commit Hook for Subversion, the .NET way still applies. What's new? The revision info is parsed and more nicely presented in the commit mail message. Because of info parsing, one call to svnlook could be saved.

SvnPostCommitHook1.1.0.50410.zip (14.08 KB)

Categories: .NET | Subversion | Use the source Luke
Sunday, 10 April 2005 11:13:31 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Saturday, 09 April 2005

In the entry Subversion on Windows as a Service, plus Commit Hook and Backup Script I showed a batch file for hooking into the post commit event of a repository. This batch file annoyed me from the very beginning. During the Indigo Community Day on Thursday in Munich I decided that it was about time to get rid of it, and after yesterday's party, I thought it might be a nice pinky exercise to do the basic port to C# today.

And yes, it is very basic at the moment. All you need to do is take post-commit.exe and post-commit.exe.config from the \SvnPostCommitHook\Hook directory in the downloadable zip file and drop those two into the hooks directory of your repository. The .config file is your ticket to customization:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
 <appSettings>
  <add key="SvnLookPath" value="C:\Program Files\Subversion\bin\svnlook" />
  <add key="MailTo" value="commitlist@yourdomain.com" />
  <add key="MailFrom" value="commithook@yourdomain.com" />
  <add key="MailSubject" value="Your project name rev {0}, {1}" />
  <add key="MailServer" value="localhost" />
 </appSettings>
</configuration>

Just as the batch file, post-commit.exe's task is to read the change log and commit message, and post it to a mailing list that distributes the information to the project stakeholders. Therefore, you need to configure the four Mail* settings to match your configuration and preferences. The SvnLookPath needs to point to your Subversion installation, however, most installations should be fine with this default.

How can you test the operation of post-commit.exe? This is the syntax:

post-commit <repository> <revision>

For example:

post-commit e:\subversion\fidalgo 1830

In the current version, testing is highly recommended as no logging or exception handling is implemented.

SvnPostCommitHook1.0.0.50409.zip (12.07 KB)

The source code is BSD-licensed. Future plans are to fully parse the svnlook output, as well as add a logging infrastructure to easily find configuration problems during normal operations of your Subversion server.

Saturday, 09 April 2005 19:34:45 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Thursday, 13 January 2005

Basically, this job is as easy as:

  1. Dump the repository on the old server
  2. Load the dump into a new repository on the new server

Dumping is explained here, and I won't go into detail because I wasn't the one doing it, Roman did it (I ain't touching a BSD box, more harm than good would result).

However, step two is in my ballpark, because the repository is moving to a Windows box. Two commands and you are up and running again (it can take quite some time, especially if your dump is like mine - a little over 528 MB!)

svnadmin create c:\repositories\fidalgo
svnadmin load c:\repositories\fidalgo < "e:\fidalgo.dump"

All that is left to do now is to restore the configuration and hooks (details in my last blog post on Subversion)

In closing, credit where credit is due: I gathered some inspiration from the following blog entry: A Rank Amateur Upgrades His Subversion Repository

Categories: Administration | Subversion
Thursday, 13 January 2005 21:31:15 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Monday, 03 January 2005

Following is an installation recipe for Subversion (a free and very powerful source code control system) plus additional files for a post commit hook (so you know immediately when someone else checked something in; currently implemented as a batch file) and a backup script (so there are no excuses for not backing up your installation!). Assumptions for this recipe:

  • We are creating a new repository named Corsavy
  • c:\repositories is your repository root
  • Backups will be located in d:\subversionbackups

Now for the recipe:

1) Install Subversion (WIN32 download). Modify the PATH environment variable so that it contains the path to your Subversion installation (usually c:\Program Files\Subversion\bin).

2) Create a repository

mkdir c:\repositories
svnadmin create c:\repositories\corsavy

Details can be found here.

3) Edit svnserve.conf (do not forget to uncomment [General]). Details see previous link, however, svnserve.conf does come with plenty of instructions itself.

4) Install Subversion as a service using the SVN Service Wrapper (Note: you have to place it in the bin directory where svnserve.exe is located)

SVNService -install -d -r c:\repositories

5) Optional: a commit hook, post-commit.bat

Put it into c:\repositories\corsavy\hooks, it will be picked up automatically

SET REPOS=%1
SET REV=%2

SET LOG_FILE=%TEMP%.\svnfileR-%REV%
SET LOG_FILE1=%TEMP%.\svnfileR1-%REV%
SET LOG_FILE2=%TEMP%.\svnfileR2-%REV%
SET AUT_FILE=%TEMP%.\svnfileA-%REV%

svnlook info -r %REV% %REPOS%>%LOG_FILE1%
svnlook changed -r %REV% %REPOS%>%LOG_FILE2%
copy %LOG_FILE1%+spacer.txt+%LOG_FILE2%+spacer.txt+%LOG_FILE%

svnlook author -r %REV% %REPOS%>%AUT_FILE%

REM SET THE AUTHOR FROM THE FILE.
FOR /F %%A IN (%AUT_FILE%) DO SET AUTHOR=%%A

blat "%LOG_FILE%" -to "toaddr" -f "fromaddr" -server localhost -s "[svn-corsavy] rev %REV%, %AUTHOR%"

DEL %LOG_FILE%
DEL %LOG_FILE1%
DEL %LOG_FILE2%
DEL %AUT_FILE%

Note that I did remove toaddr and fromaddr in this script (put in the ones you'd like to use instead), and you need a file named spacer.txt (mine simply contains four newlines). For mailing out the change log, blat is used (Note: the line with blat must not wrap). I placed blat into the bin folder of my Subversion installation, so it is automatically in the search path.

6) Optional: backup, a VBS script

Set objWsh = WScript.CreateObject("WScript.Shell")

strCmdLine = "cmd /c rmdir d:\subversionbackups\current /s /q"
nRetVal = objWsh.Run(strCmdLine, 1, True)

strCmdLine = "cmd /c mkdir d:\subversionbackups\current"
nRetVal = objWsh.Run(strCmdLine, 1, True)

strCmdLine = "svnadmin hotcopy c:\repositories\corsavy d:\subversionbackups\current --clean-logs"
WScript.Echo strCmdLine
nRetVal = objWsh.Run(strCmdLine, 1, True)

strFilename = """d:\subversionbackups\"
strFilename = strFilename &  Year(Date) & Month(Date) & Day(Date) & ".zip"""
strCmdLine = "zip -r " & strFilename & " ""d:\subversionbackups\current\*.*"""
WScript.Echo strCmdLine
nRetVal = objWsh.Run(strCmdLine, 1, True)

The Zip component in use is Info-ZIP, which is free. The VBS file is run from a scheduled task each night.

That concludes the recipe for installing Subversion - well, almost: the port used by svnserve is 3690 (TCP as well as UDP), so you might need to change the IPSec policy of your server to allow those incoming ports. Same thing client-side, but this time outgoing.

Monday, 03 January 2005 08:22:37 (W. Europe Standard Time, UTC+01:00)  #    Comments [1]

 



#  Wednesday, 03 November 2004

I think I can safely assume that everyone knows about SourceForge.net, where first-class .NET projects such as NUnit, NAnt, NProf as well as many others are hosted. Much less known is GForge, which is a fork that you can host yourself based on the GPL version of SourceForge before it was made closed-source by VA Linux in 2001.

Since that time GForge was improved, and it has reached version 4 just recently. To give you a really high-level idea of what it is, a short quote from the project page itself:  GForge has tools to help your team collaborate, like message forums and mailing lists; tools to create and control access to Source Code Management repositories like CVS and Subversion. GForge automatically creates a repository and controls access to it depending on the role settings of the project.

Additional Tools:

  • Manage File Releases
  • Document Management
  • News announcements
  • Surveys for users and admins
  • Issue tracking with "unlimited" numbers of categories, text fields, etc
  • Task management

Tool-wise, this package can come in handy when you want to get started on a development process in your company, covering the entire lifecycle. For free.

Wednesday, 03 November 2004 12:04:15 (W. Europe Standard Time, UTC+01:00)  #    Comments [1]

 



#  Saturday, 30 October 2004

Note to self: need to grab a copy of Version Control with Subversion. We have been using Subversion even while it still was in Alpha and Beta stages - and I am really convinced that it is more than up to its commercial counterparts, especially when it comes to platform and tool support!

Categories: Books | Subversion
Saturday, 30 October 2004 20:30:27 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



© Copyright 2017 Christoph Wille

newtelligence dasBlog 2.3.9074.18820
Subscribe to this weblog's RSS feed with SharpReader, Radio Userland, NewsGator or any other aggregator listening on port 5335 by clicking this button.   RSS 2.0|Atom 1.0  Send mail to the author(s)

 
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.