Geeks With Blogs
Saif Khan { I am Saif } "Knowledge is power, information is free, share it!"
I deploy apps via ClickOnce. After each deployment we have to review the changes made and send out an email to the users with the changes. What I decided now to do is to use CodebaseHQ’s API to access a project’s SVN repository and display the commit notes so some users who download new updates can check what was changed or updated in an app. This saves a heck of a lot of time, especially when your apps are in beta and you are making several changes daily based on feedback.
You can read up on their API here
Here is a sample on how to access the Repositories API from a windows app
Public Sub GetLog()
        If String.IsNullOrEmpty(_url) Then Exit Sub
        Dim answer As String = String.Empty
        Dim myReq As HttpWebRequest = WebRequest.Create(_url)
        With myReq

            .Headers.Add("Authorization", String.Format("Basic {0}", Convert.ToBase64String(Encoding.ASCII.GetBytes("username:password"))))
            .ContentType = "application/xml"
            .Accept = "application/xml"
            .Method = "POST"
        End With


            Using response As HttpWebResponse = myReq.GetResponse()

                Using sr As New System.IO.StreamReader(response.GetResponseStream())
                    answer = sr.ReadToEnd()
                    Dim doc As XDocument = XDocument.Parse(answer)
                    Dim commits = From commit In doc.Descendants("commit") _
                                  Select Message = commit.Element("message").Value, _
                                                AuthorName = commit.Element("author-name").Value, _
                                                AuthoredDate = DateTime.Parse(commit.Element("authored-at").Value).Date
                    grdLogData.DataSource = commits.ToList()

                End Using
            End Using

        Catch ex As Exception
        End Try
    End Sub


Originally I was using myReq.Credentials = New NetworkCredential("username", "password") and then it stopped working after a few weeks. It looks like CodebaseHQ change their API access to Basic authorization.

The _url variable is basically the path to your repository e.g. You can find more information on the API here

Here is a list of available properties from the commits

     <message>add dev &amp; staging to reserved domains</message>
     <author-name>Adam Cooke</author-name>
     <authored-at type="datetime">2009-10-12T17:49:25+01:00</authored-at>
     <committer-name>Adam Cooke</committer-name>
     <committed-at type="datetime">2009-10-12T17:49:46+01:00</committed-at>


Here is what my change-log screen lools like in my app

4-3-2011 1-34-03 AM

Posted on Sunday, May 2, 2010 5:48 PM | Back to top

Comments on this post: Getting codebaseHQ SVN ChangeLog data in your application

# re: Getting codebaseHQ SVN ChangeLog data in your application
Requesting Gravatar...
Thanks for sharing:) I will come back here!
Left by pasmanteria on Oct 14, 2010 10:00 PM

# re: Getting codebaseHQ SVN ChangeLog data in your application
Requesting Gravatar...
This is the kind of info I am looking for sir. I have been stomped trying to figure out a way to get this codes and you just gave me an idea. many thanks.
Left by sunday press on Feb 10, 2011 8:41 AM

Your comment:
 (will show your gravatar)

Copyright © saifkhan | Powered by: