Getting codebaseHQ SVN ChangeLog data in your application
- by saifkhan
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
Try
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.BeginUpdate()
grdLogData.DataSource = commits.ToList()
grdLogData.EndUpdate()
End Using
End Using
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub