Sublime Subversion Subscribe to RSS feed

Tag: Subversion

We’re still a ways away from the release of Sublime 1.3 but I thought it would be a good idea to provide a sneak peak into what we have in the works.

Apache Support

Although Sublime currently supports Active Directory authentication with Apache it requires you to install and configure Apache manually.  Starting in Sublime 1.3 we will manage the installation and configuration process automatically.  No more mucking around in configuration files – Sublime 1.3 will provide the same easy-to-use management interface that we do for the rest of Sublime’s features.

Hook Script Management

Sublime 1.3 will support hook script management for repositories.  Administrators will be able to make certain hook scripts available and even enforce that all repositories use certain scripts.  This is useful for enforcing policies or integrating with other systems such as bug trackers.  Once these scripts are available repository owners will be able to easily enable or disable them for their repositories.

Minor Features and Updates

Sublime 1.3 will also include the following minor updates:

  • Delete a Repository – administrators and (optionally) repository owners will now be able to delete a repository directly within Sublime
  • Require Commit Messages – owners will be able to enforce commit messages per-repository
  • Bug Fixes and other minor features we can sneak into the development schedule

As always, please leave us feedback on our feedback forum.  This is one of the primary methods we use when planning features for Sublime.

Sublime’s powerful Repository Template feature allows you to create templates that users can select when creating new repositories.  These templates can include folder structures and files that should be created for each new repository.  Creating a basic template is as easy as creating the folders and files, and then editing a few lines in a text file.  However, one of the more powerful features of Sublime is to create templates customized to each new repository.  This, can take a bit more work.

A customized template is one where repository details (name, description or owner) are used when the new repository is populated from the template.  Typically this is used to simply rename files or folders to match the name of the new repository.  But what if you wanted to go farther?  In this post I’ll show you how to create a template containing full Visual Studio solution including multiple projects, all of which will be customized to each new repository.

1. Create a new Visual Studio Solution

Start up Visual Studio and create a solution to be used as your template.  You can create multiple projects, default classes, etc.

New Visual Studio project

New Visual Studio project

2. Rename Files and Folders

Next, close Visual Studio and navigate to the folder containing your solution.  Rename your files and folders using the placeholders below so that they will be renamed when your new repository is created.

  • %name% – name of the new repository
  • %name-formatted% – name of the new repository formatted for a file system (removed spaces and special characters)
  • %description% – description of the new repository
  • %description-formatted% – description, formatted for a file system
  • %owner% – owner of the new repository
  • %owner-formatted% – owner, formatted for a file system
  • %guid[0]%%guid[100]% – unique guids which will be generated when the new repository is generated

Be sure to remove any unwanted files and folders such as bin, obj, or .suo and .user files.

Renamed files and folders

Renamed files and folders

3. Modify Solution Files

The next step is a bit tricky.  Open your Solution File (.sln) in a text editor such as Notepad.  Locate the project names and again, use the placeholders above to rename the names and paths.

Modify project names and paths

Next you must replace the solution GUID and project GUIDs with placeholders so that new GUIDs will be generated for each new repository.  Start with the solution GUID used for each project and replace it with %guid[0]% (leave the GUID braces).

Replaced solution GUIDs

Next you must replace the GUIDs for each project.  Assign numbers to each project starting with 1 and keep a note of which project has been assigned what number.  In my case I chose to use alphabetical order.  Now, select the GUID for the first project, and using Find and Replace, replace it with %guid[1]% (again, leaving the braces).  Do the same for each project, each time using a new guid.

Project GUIDs replaced

Save and close the modified solution file.

4. Modify Project Files

Next, open each project file (.csproj, .vbproj, etc) in a text editor such as Notepad.

First, replace the GUID in the <ProjectGuid> tag with the guid that you assigned in the last step (i.e. %guid[1]%).  If you set up project dependencies when you created your solution, you may need to update those as well.

Next, update the <AssemblyName> and <RootNamespace> tags to use the placeholder names for your new repository.

Modified project file

5. Modify Code Files

Next you may need to modify your source code files to replace namespaces with placeholders.  For example, in this example we replaced the namespaces within the Global.asax and Global.asax.cs files.

Renamed Namespace in Global.asax.cs

6. Finalize Repository Template

Next build out the rest of your repository template structure.  Remember that the files and folders you create will populate the entire repository, so you must create the “tags”, “branches” and “trunk” folders as well.

Complete repository template structure

7. Register the new Template on your Sublime Server

Finally, copy the entire template structure to the Templates folder on your Sublime server (typically C:\Program Files\Sublime\Templates).

New Template copied to Templates folder on Sublime server

Then open the “templates.txt” file and add the details for your new repository template.  See the administrator guide for details on modifying the “templates.txt” file.  Be sure to include the “replaceTokens = true” line for this new template.  Otherwise the placeholders you created will not be replaced with actual values.

Add the new template to templates.txt

Save “templates.txt” and perform an IISRESET.

8. Test the Template

Finally, create a new repository using the new template to ensure it is working properly.  It is a good idea to create a repository, check it out, and open the solution in Visual Studio to ensure that the project builds and that all names are being replaced properly.  If you missed any files or namespaces you can simply edit the template on the server and try again.

Create a repository from the new template

Download the Sample

You can download the sample repository template created for this walkthrough from the link below.

Download the sample Template

Sublime is proud to announce its decision to sponsor the next few episodes of This Developer’s Life, a podcast featuring stories about technology, technologists, and what it’s like to live and work in this field. Inspired by the storytelling format of This American Life, Rob Conery and Scott Hanselman have created this podcast filled with interesting perspectives, and a compelling behind the scenes look into the more intimate and personal nuances of the developer’s world.

Of course we wish to spark interest in Sublime, and promote it to a relevant and growing audience, but more importantly, we are thrilled to support such a quality independent production. The media landscape is changing, and as consumers we play an integral role in this change. There are more avenues than ever before to find compelling, interesting, and stimulating content, be it independent movies, animated shorts, online comics, blogs, games, music or podcasts. More and more we are not limited to the safe, watered down programming which is chosen by the large corporations for its appeal to the masses. Instead we may be guided by our passions, our interests, our particular (or even peculiar) tastes.

However, if we value this trend and want it to continue, we can’t rely solely on the good will and creative energy of the people behind these productions. When we find products that we enjoy and value we need to show our support. We believe in the product that Rob and Scott are producing, we want to see it continue, and we’re excited to be a small part of that.

Many organizations use SharePoint for team and project collaboration.  SharePoint is an ideal location to store project documents, issues lists, and other project artifacts.  However, without a view into the actual development progress for your project you won’t have a complete picture.  With Sublime 1.2 it is very easy to view your repository commit history directly within your SharePoint team sites or even your My Site.

Viewing Project Progress in a SharePoint Team Site

Having a SharePoint site per project is a very common model for organizations who rely on SharePoint for collaboration.  With Sublime’s RSS feeds it is possible to display the commit history for a single repository right within your SharePoint project sites.

  1. First, navigate to your project site.
  2. Next, under the “Site Actions” menu, choose “Edit Page”
  3. Once the page is in edit mode, choose a web part zone and click “Add Web Part”
  4. In the Add Web Parts dialog, choose the “RSS Viewer” web part and click “Add”
  5. Once the web part is added, click the “Open the tool pane” link to edit the web part properties
  6. Next, open a new browser window and navigate to Sublime
  7. Click on the Browse Repositories tab, locate the repository for your project, and click the repository to view repository details.
  8. In the “History” section at the bottom of the repository details page, locate the orange RSS feed icon.  Right-click on this icon and choose “Copy Shortcut”.
  9. Switch back to your My Site and in the RSS Feed URL textbox for the RSS Feed web part, paste the shortcut you copied in step 7.*
  10. Click “OK” to save your settings.  You should now see the activity feed for your repository on the project team site.

    Subversion history on a SharePoint project site

View your Activity Stream in your My Site

One of the best features in Sublime 1.2 is the personalized activity stream.  This activity stream shows you all activity on any repository you are a member of so you can easily stay up to date with all your projects.  And because this view is personalized it is an ideal candidate for your SharePoint My Site.

  1. First, navigate to your My Site.
  2. Next, under the “Site Actions” menu, choose “Edit Page”
  3. Once the page is in edit mode, choose a web part zone and click “Add Web Part”
  4. In the Add Web Parts dialog, choose the “RSS Viewer” web part and click “Add”
  5. Once the web part is added, click the “Open the tool pane” link to edit the web part properties
  6. Next, open a new browser window and navigate to the Sublime home page
  7. On the right-hand side, next to the activity stream there should be an orange RSS feed icon.  Right-click on this icon and choose “Copy Shortcut”
  8. Switch back to your My Site and in the RSS Feed URL textbox for the RSS Feed web part, paste the shortcut you copied in step 7.*
  9. Click Okay to save your settings.  You should now see your activity stream on your My Site home page.

* RSS Feed Permissions

Depending on how you have configured your Sublime security settings, you may need to modify the RSS Feed URLs slightly.

  • If you have turned off RSS Authentication in Sublime (available from the Administrative Security page) then you don’t need to make any changes.
  • If you require RSS Authentication then you must specify a username and password in the query string for the RSS feed.  The username and password are added to the end of the feed URL as follows:

http://myserver/Feed.aspx?f=repo&r=/path&username=myusername&password=myurlencodedpassword

Let me paint you a picture.  It’s 5 minutes till 5 at the end of a long work week and you’ve just wrapped up a new feature on your current project.  It’s time to commit those changes and head out for the weekend.  You pull up TortoiseSVN, write a helpful and descriptive commit message (feeling vastly superior to your less-than-thorough colleagues with their randomly generated commit messages), and hit the Commit button.

AAAAAAAARRRRRRGGGGHHH!!!!

AHHHH!  The last thing you want to do is spend the next hour picking through other people’s changes to make sure your code still works.

Now here’s a little secret about developing software with a team.  Merging is just a fact of life.  Unless you want to go back to the old lock/modify/unlock model you’re going to have to merge your changes with someone else’s at some point.  But with today’s software, most merges can be handled automatically by our development tools.  The only real problem arises when you have to merge lots of changes all at once across many different parts of your code-base.  Resolving conflicts (deciding what code to keep when two changes contradict each other) requires intimate knowledge of your code and your colleague’s code.  Not the activity for 5PM on a Friday!

There are two keys to keeping merges simple:

  1. Commit frequently with simple, focused changes
  2. Update your working copy after each of your colleagues commits changes which may impact you

Commit Frequently with Simple, Focused Changes

As you are making changes to your code, keep a mental note when you shift from one focus to another.  Are you fixing a bug?  Developing a new feature?  Optimizing a query?  As soon as you shift from one focus to another – assuming you are finished with the first thing – commit those changes along with a short, simple description of your changes.  This is good practice in general, but it also greatly reduces confusion when a team member has to merge their changes with yours.  A small, focused change is much easier for someone who isn’t familiar with your code to comprehend.  So if I have to merge my changes with yours, and I see that your change fixes a certain bug, I can be sure to pay attention to that detail when merging so as not to re-introduce the bug into the code-base.

Update your Working Copy Frequently

Staying up to date with the activities of your team is a critical step in reducing and even eliminating the pain associated with merging.  If you see that a colleague committed a change to a file you are working on, you can update your working copy right then and there.  This offers two significant advantages: (1) you will be dealing with smaller conflicts that are usually much simpler and (2) the other developer is probably still in the office if you have any questions.

This is where Sublime enters the picture.  Sublime allows you to stay up to date with your development team using email notifications and RSS feeds.  If you enable email notifications on your project repositories you will be notified immediately when another users commits changes.  If you don’t like email, you can use the personalized activity stream RSS feed which notifies you whenever a user commits changes to any of your repositories.  Both of these methods allow you to quickly scan the commit details including the commit message, and changed files so you can determine if their changes might conflict with your work.

Viewing the Commit RSS feed in Outlook

The amazing thing about these two practices is that (a) they are actually pretty simple to implement and (b) the time and mental energy required for merging changes practically vanishes.  And it’s not just that you are spreading that hour merging commits across the day so it doesn’t seem like it takes as much time, it really does take less time.  The reason for this is that you are eliminating the mental ramp-up time required when you save this for the end of the day or worse, the end of the week.

A good way to think about this is efficiency in testing and fixing bugs.  Fixing bugs while your team is actively engaged in development is vastly more efficient than fixing bugs after your team has disbanded and moved on to something else.  While development is in progress, everyone is already engaged and can rapidly jump to the source of a problem, get it fixed, and move on.  Your brain operates the same way.  While you are working on a particular piece of code, your brain keeps a mental model of that code so that you can quickly navigate from one area to another implementing features.  If you have to merge changes and you already have that mental model, you know exactly how those changes will impact your code and what needs to be done to resolve any impacts.

These two practices really aren’t that hard to implement with your team.  Sublime has features that are designed specifically for making this easy, but even if you are using a different product you can still work to implement these practices.  Once you have worked this way for a few days I guarantee you’ll never want to go back.

Right now I feel like one of those “I must be crazy my prices are so low” guys on local TV.  But that’s because in celebration of the release of Sublime 1.2 we are cutting our prices by 50%!  Starting today until the end of Summer (September 21st to be exact) all Sublime licenses are 50% off if you enter the promo code “SUMMER” during checkout.

If you’ve been trying an evaluation version Sublime then now is a great time to buy!  Or if you are planning for additions to your team in the future, go ahead and grab some extra licenses now while the price is so low.

Go check out the details in our online store.

Sublime 1.2 Is Available Now!

We just pushed the final bits live and you can download Sublime 1.2 now!  Version 1.2 can be installed right over top of your existing Sublime 1.1 installation so upgrading is a snap!

We are super excited about Sublime 1.2 and feel that it’s the best version of Sublime yet.  Version 1.2 introduces a slew of new features and enhancements.  Check out the release notes for the complete list of new features and bug fixes included.  Below are the highlights:

  • Path-based permissions. It is now possible to manage path-based permissions within your repositories.
  • Personalized Dashboard. Each user gets their own personalized dashboard showing them their active repositories and activity stream.
  • Activity Stream RSS Feed. Keep track of all of your repositories from a single, dynamic RSS feed.
  • Active Directory Groups when using LDAP Authentication. Use existing Active Directory groups when managing repository permissions.
  • Advanced Repository Templates. Repository templates can contain files and content which will be personalized to the details of your new repository.  Included are two new templates for Visual Studio projects.  Each template will pre-populate the new repository with a Visual Studio solution file based on the name of the repository.

I LOVE this new feature.  I find it to be incredibly useful on a daily basis.  And building tools that you yourself find useful and productive is one of the most rewarding aspects of this business.

Sublime 1.2 ships with a new default home page which is personalized for each user.  It shows a list of active repositories that you have access to, and an activity stream for those repositories.  This makes it very easy to quickly access the repositories you care about, and see exactly who is committing to those repositories – all in one, streamlined view.

New personalized dashboard shows your repositories and latest activity

New personalized dashboard shows your repositories and latest activity

On the left side of the dashboard is a list of any repository that you have access to, which has been committed to in the last 15 days.  This makes it very easy to quickly access repositories that you have access to and it automatically filters out old or unused repositories.

On the right side of the screen is a list of the most recent commits to these active repositories.  This single, unified view lets you easily see which users are committing to the repositories you care about.

In addition, this activity stream is exposed as an RSS feed.  This lets users subscribe to a single RSS feed for all of their repositories without having to subscribe to each individual repository.

All in all we feel that this is a great feature for developers.  It helps everyone easily stay up to date with the activities of their team.

This is the first post in a series on what’s new in Sublime 1.2. Version 1.2 will be released next month but we’re so excited about the new features that we wanted to get the word out now.

First up: Path-based permissions.

This feature has been requested for some time and is finally making its way into Sublime. In 1.2 a repository owner will be able define unique permissions at different paths within a repository. A common scenario may be to allow all developers read/write access to the trunk, but then lock down the branches or tags folders to lead developers or release managers.

Below, we can see the updated Permission Management interface in Sublime 1.2. On the left we see the repository structure and the red icon overlay indicates that a folder has unique permissions applied. Clicking on that folder we can see, and then manage permissions for that level in the repository.

Assigning path-based permissions in Sublime

Assigning path-based permissions in Sublime

If you make a mistake and would like to remove all unique permissions you can simply click the “Remove these permissions” link in the highlighted area to the right.

Well that’s it for this update. For our next Sublime 1.2 Preview article we will discuss the new personalized Dashboard.

As you may know, last week saw the Subversion Vision Conference in New York City. This wasn’t a large event, rather it was a small meeting of several core members of the Subversion team. Their goal wasn’t marketing, community building, or flag waving, but rather to step back a moment and take a look at where Subversion was headed. And although they didn’t come away with a finalized roadmap or vision statement, it does appear that some good progress was made on mapping out the direction for Subversion.

I think this is great and I’m glad to see the Subversion team taking some time to map out the future. But I do wish we had seen some indication that Subversion may evolve to incorporate some distributed functionality. However, according to Michael Pilato the immediate plan appears to be to “Maintain a centralized approach to version control”.

Considering the composition of the team – most members being from companies such as Collabnet or WANdisco who serve the enterprise – this isn’t exactly surprising. Centralization is still a key concern for enterprise IT organizations who need to maintain tight control on their systems for compliance and governance reasons. But I hate to see the team dismiss different approaches to source control simply because it doesn’t appeal to the enterprise yet.

I think distributed version control systems have some great advantages and not just in the open source space. I think cheap, personal branching and merging is an extremely powerful tool. From personal experience I can tell you that it can completely change your development workflow for the better. My opinion is that anything that stops a developer from committing changes is a bad thing. Your version control system is your safety net – it should be there to support you, not to impose speed bumps.

I’ve watched the rise in popularity of DVCSs over the last few years. Git made the DVCS sexy but they’ve been around for quite a while. Microsoft supporting Mercurial on Codeplex is just one example of DVCSs being taken seriously by very large players.

But even though distributed systems are the hot “new” thing, most organizations – big or small – still place a high value on centralization. As a small business using Subversion, I see the value in having one location with all of our valuable IP. I have one asset to back up, one place to go to find repositories, one place to go to manage access, etc. These are all great arguments for a centralized system but I think there can be a middle ground.

The combination of a centralized version control system supporting distributed working copies could be extremely powerful. Allowing your developers to commit, branch, merge, and revert locally and then pushing changes up to the master repository as appropriate seems like the best of both worlds.

This is where the Git users out there yell at me and tell me that Github already works this way. I’m aware of that and have used it myself. It’s a great workflow – but it’s not ready for the enterprise, or even smaller companies. It will work for some, but not for the majority.

This is where I think the Subversion team can make some serious traction – not just supporting the status quo – but really moving the product forward in a new and exciting way. I think that Subversion is in the unique position of being able to take advantage of the benefits that distributed systems offer while at the same time serving those who care about centralization.

In the coming months I expect that the Subversion team will make their roadmap public and I’m excited to see what’s on it. I really like what I’ve been hearing about the Working Copy changes (no more .svn folders littering my working copy!) and love to see the momentum in the community. Subversion is still hands-down the best source control solution for small, medium and enterprise organizations, but it can always be better. I hope that the core team will consider some of these opportunities when mapping out Subversion’s future.