Wednesday, August 20, 2014 Register   Login

This site uses DNS Made Easy. Use it for reliable and professional DNS services.

RSS Feeds
Blog

Entries for June 2007

Jun
28

The latest preview has now been uploaded and is ready for testing. I made this a public download, because I'm hoping more people will download and test it. I haven't gotten as much feedback as I have wanted.

This will be the last preview. I have all of the major features slated for version 1.0 done. I have tested the install in my VMWare VMs, but now I need to get people banging on the install and the use it on a daily basis. I will probably have one beta before releasing version 1.0.

I'm dogfooding this, and loving it! I really like not having to remember the command line for this sort of stuff. It makes Subversion feel like a first class Windows citizen.

posted @ Thursday, June 28, 2007 9:38 PM by Hector Sosa, Jr

Posted in: PainlessSVN

Actions: Tweet This  Share on Facebook  Share on LinkedIn  Emakl  Permalink  del.icio.us
Jun
27

I got a report from a tester that they couldn't figure out where to set the information for the Subversion server. So I came up with a little tweak to make this more obvious. Here's a quick screenshot to show this tweak:



In retrospect, this should have been obvious to me as a developer. The interesting part of this whole episode is how I was able to get into the mind of the user. I have found that I can simulate how a new user looks at my software, by testing stuff like this only when I'm extremely tired. A long day at my day job does wonders for this sort of testing.

The opposite is true for fixing bugs. I make a habit of not fixing bugs when I'm tired. It leads to creating all kinds of funky code. I don't drink alcohol, or even drink sodas, so if I really need to pep up, I drink Sobe No Fear. I hate the diet stuff, so I don't bother about the sugar content. No caffeine for me!

posted @ Wednesday, June 27, 2007 10:56 PM by Hector Sosa, Jr

Posted in: PainlessSVN

Actions: Tweet This  Share on Facebook  Share on LinkedIn  Emakl  Permalink  del.icio.us
Jun
27

I finally nailed the bug where repositories with spaces in the name were not handled at all. Got this working last night.

Since I didn't get as much feedback as I wanted, the next release will be the first public beta. This means that Beta 1 will be coming out late Thursday night, or early Friday morning. Remember that I'm on Mountain Standard time.

I'm making a minor UI tweak. I'm going to add a new root node to represent the server. I think that the current setup makes it a bit confusing as to where to register servers. This version will only handle one server at a time.

Don't be shy, and please report any problems that you encounter.

posted @ Wednesday, June 27, 2007 5:14 PM by Hector Sosa, Jr

Posted in: PainlessSVN

Actions: Tweet This  Share on Facebook  Share on LinkedIn  Emakl  Permalink  del.icio.us
Jun
22

Here's a preliminary of the text file splitter's UI:



This will probably change just a tad, but not much. I'm finishing integrating the code from other projects. You should see the download for this shortly.

posted @ Friday, June 22, 2007 2:57 PM by Hector Sosa, Jr

Actions: Tweet This  Share on Facebook  Share on LinkedIn  Emakl  Permalink  del.icio.us
Jun
21

One problem that I encounter quite often is splitting large text files. There's plenty of binary splitters out there. I needed something that did specific things for text files. I grew quite annoyed at not finding something, so I created a utility to help me at my day job.

This little program does the following:

  • Split by number of lines
  • Split by size
  • Keep the first line for each new file chunk
  • Has a Winforms UI
  • Works on the command line

I just couldn't believe that there wasn't something out in the public that did this. The utility is done, and I use it at work regularly. I'm in the process of cleaning up the UI and finalizing the command-line parameters.

I'll make another post once I am done cleaning it up. This will be free!

posted @ Thursday, June 21, 2007 10:30 PM by Hector Sosa, Jr

Actions: Tweet This  Share on Facebook  Share on LinkedIn  Emakl  Permalink  del.icio.us
Jun
12
 2523 Views ::  2 Comments RSS comment feed

I finally got to play with the svn:externals property. This works similarly to the shared project in Visual Source Safe and JEDI VCS.

The usage for this property is a bit awkward, and took me a few tries to get it right. Basically, you have to set this property on the directory above where you want to use it. Here are the steps I took to get this working:

I'm assuming that you have TortoiseSVN installed. Right-click on the folder that will be the parent for the external linked repository. Then Select Properties. Select the Subversion tab.



Click on the Properties button. You should get this:


Click on the Add button. You should get this dialog:


I took this screenshot with the combo box list open so that you can see what's in it.

Make sure that you select svn:externals in the drop down:


The value for this property is basically a two part string. The first part is the name of the physical child directory. The second part is the actual URL to the Subversion repository. These parts are separated by a space.

You are supposed to be able to enter more than one external definition, but I haven't tested it.

Hope you find this useful, as I sure did!

posted @ Tuesday, June 12, 2007 11:50 PM by Hector Sosa, Jr

Actions: Tweet This  Share on Facebook  Share on LinkedIn  Emakl  Permalink  del.icio.us
Jun
10

I had an interesting time with the output of the "svnadmin dump" command.  My original implementation looks like this:

  189         public static bool ExecuteSvnCommand( string command, string arguments, out string result, out string errors )

  190         {

  191             bool retval = false;

  192             string output = string.Empty;

  193             string errorLines = string.Empty;

  194             Process svnCommand = null;

  195             ProcessStartInfo psi = new ProcessStartInfo( command );

  196 

  197             psi.RedirectStandardOutput = true;

  198             psi.RedirectStandardError = true;

  199             psi.WindowStyle = ProcessWindowStyle.Hidden;

  200             psi.UseShellExecute = false;

  201             psi.CreateNoWindow = true;

  202 

  203             try

  204             {

  205                 Process.Start( psi );

  206                 psi.Arguments = arguments;

  207                 svnCommand = Process.Start( psi );

  208 

  209                 StreamReader myOutput = svnCommand.StandardOutput;

  210                 StreamReader myErrors = svnCommand.StandardError;

  211                 svnCommand.WaitForExit();

  212 

  213                 if ( svnCommand.HasExited )

  214                 {

  215                     output = myOutput.ReadToEnd();

  216                     errorLines = myErrors.ReadToEnd();

  217                 }

  218 

  219                 // Check for errors

  220                 if ( errorLines.Trim().Length == 0 )

  221                 {

  222                     retval = true;

  223                 }

  224             }

  225             catch ( Exception ex )

  226             {

  227                 string msg = ex.Message;

  228                 errorLines += Environment.NewLine + msg;

  229             }

  230             finally

  231             {

  232                 if (svnCommand != null)

  233                 {

  234                     svnCommand.Close();

  235                 }

  236             }

  237 

  238             result = output;

  239             errors = errorLines;

  240 

  241             return retval;

  242         }


This code works for all the other commands just fine.  The culprit ended up being line 211. I created a new function to handle this. The code is below:

  253         public static bool ExecuteWritesToDiskSvnCommand( string command, string arguments, string destinationFile, out string errors )

  254         {

  255             bool retval = false;

  256             string errorLines = string.Empty;

  257             Process svnCommand = null;

  258             ProcessStartInfo psi = new ProcessStartInfo( command );

  259 

  260             psi.RedirectStandardOutput = true;

  261             psi.RedirectStandardError = true;

  262             psi.WindowStyle = ProcessWindowStyle.Hidden;

  263             psi.UseShellExecute = false;

  264             psi.CreateNoWindow = true;

  265 

  266             try

  267             {

  268                 Process.Start( psi );

  269                 psi.Arguments = arguments;

  270                 svnCommand = Process.Start( psi );

  271 

  272                 StreamReader myOutput = svnCommand.StandardOutput;

  273                 StreamReader myErrors = svnCommand.StandardError;

  274 

  275                 File.AppendAllText( destinationFile, myOutput.ReadToEnd() );

  276                 svnCommand.WaitForExit();

  277                 File.AppendAllText( destinationFile, myOutput.ReadToEnd() );

  278 

  279                 if ( svnCommand.HasExited )

  280                 {

  281                     errorLines = myErrors.ReadToEnd();

  282                 }

  283 

  284                 // Check for errors

  285                 if ( errorLines.Trim().Length == 0 )

  286                 {

  287                     retval = true;

  288                 }

  289             }

  290             catch ( Exception ex )

  291             {

  292                 string msg = ex.Message;

  293                 errorLines += Environment.NewLine + msg;

  294             }

  295             finally

  296             {

  297                 if ( svnCommand != null )

  298                 {

  299                     svnCommand.Close();

  300                 }

  301             }

  302 

  303             errors = errorLines;

  304 

  305             return retval;

  306         }


The key to solving this was surrounding the call to WaitForExit() with file operations. Also needed to make sure to write the output to disk. Here are the relevant lines:

  275 File.AppendAllText( destinationFile, myOutput.ReadToEnd() );

  276 svnCommand.WaitForExit();

  277 File.AppendAllText( destinationFile, myOutput.ReadToEnd() );


Notice that I make a call to File.AppendAllText() twice. I have found that the output stream does not write everything during the first call to File.AppendAllText() on some occasions.

This will be obvious to people that are used to doing this in C and C++ and using stdoutpu and stderror. It's been a LONG time since I had to do anything like this. I had to dig for this information quite deep, as MSDN does not tell you about this, or my Google-Fu was not up to par.

This code can be found in the open sourced library called SVNMangerLib. You can find it here:

SVNManagerLib

I formatted my source code in Visual Studio 2005 using this little gem:

CopySourceAsHtml for Microsoft Visual Studio 2005

posted @ Sunday, June 10, 2007 6:36 PM by Hector Sosa, Jr

Posted in: Code

Actions: Tweet This  Share on Facebook  Share on LinkedIn  Emakl  Permalink  del.icio.us
Jun
01

I got this little utility done early. I really wanted to get this done, so that I could start using it myself.



Go get it at the Free Downloads page.

posted @ Friday, June 01, 2007 7:15 PM by Hector Sosa, Jr

Posted in: SVNBackup

Actions: Tweet This  Share on Facebook  Share on LinkedIn  Emakl  Permalink  del.icio.us
  
Terms Of Use | Privacy Statement | SystemWidgets
Copyright 2002-2014 by SystemWidgets
Google Analytics Alternative