HgLab 1.4 Released

March 25, 2014 •

Welcome HgLab 1.4. This release features an exciting new feature called “LAN Optimizations”

LAN Optimizations

Previously, cloning an entire Mercurial repository (55 Mb, almost 21,000 changesets) took a bit over a minute (1:16, to be exact):

Cloning without LAN Optimizations

Now watch this:

Cloning with LAN Optimizations

Fifteen seconds. That’s almost 5x speed increase for initial clones. Impressive, isn’t it? What’s even better is that no configuration tweaking is required on the client side. HgLab itself enforces this behavior, with (compatible) Mercurial clients silently obeying.

Of course, nothing in the computing world comes for free, and this is no exception. When you are enabling LAN Optimizations, you’re trading speed for bandwidth. In corporate scenarios bandwidth is practically unlimited, so enabling LAN Optimizations for, well, LANs is a no-brainer. Additionally, it saves a bit of CPU cycles since HgLab doesn’t have to do all the complex computations involved in building a bundle.

How Does It Work?

For as long as I can remember (since 2006, actually, but that’s like 50 years Internet-time), Mercurial had an unfortunately named --uncompressed switch for clone command:

hg clone http://anton.gogolev@live.hglabhq.com/hg/mercurial/hg --uncompressed

With this flag set, Mercurial client asks server to perform for a what is called a “streamed clone”, when server just takes all the revlogs from the repository, glues them all together and streams the entire thing back to the client. With LAN Optimizations enabled, HgLab effectively enforces this streaming behavior even when client doesn’t explicitly asks for it.

Streaming clones, however, are not available if you’re doing any of the fancy-pants cloning, like hg clone --rev, hg clone -–branch or hg clone http://...#revision-or-branch-or-tag. This is by design, because when you’re cloning only a subset of history, there’s no reason to transfer the repository in its entirety, so Mercurial has to revert to a traditional cloning behavior.

How to Enable?

Just check the checkbox. Go to Administration, then to Repositories and enable “LAN Optimizations”. No reboot, no restart. Changes are effective immediately:

Enabling LAN Optimizations

Stay Tuned

This release also has a number of minor User Interface tweaks, and discovering them is left as an exercise to the reader.

Grab yourself a copy, request an evaluation license and stay tuned.

Happy coding!

HgLab 1.3 Released

March 11, 2014 •

HgLab 1.3 has just been shipped. With this release HgLab gets revamped security model as well as several new features, with most prominent being Commit Approvals and Source Code Archve Downloads.

Below are the highlights of HgLab 1.3.

Activity Atom Feeds

There’s now yet another way to track of All Things HgLab: Atom feeds allow you to get updates directly in your favorite RSS reader. Click the Feed link and you’ll get either a full feed for all your watched projects or for a specific project.

Activity Atom Feeds

Of course, feeds support Auto Discovery.

Source Code Archive Downloads

Previously, the only way to get source code from a repository was to clone it with Mercurial. While being appropriate for traditional collaboration models, this was a big roadblock in certain scenarios.

See this tiny button?

Source Code Archive Downloads

It allows you to abandon that version-controlled distributed universe and download a plain old ZIP file with all the source code for a particular changeset, branch or tag.

Commit Approvals

HgLab now has a light-weight approval process that allows teammates to Approve a commit, essentially green-lighting changes.

Commit Approvals

Later, when browsing commits, HgLab displays the total number approvals for a particular commit as either a gray or a green circle. Gray badge shows how many reviewers have approved a particular change. The badge turns green for the commits that were reviewed and approved by you.

Commit Approvals

Redesigned Security Model

There is a number of changes to the Security Model in this release.

Anonymous is No More

Previously, “Anonymous” user was used to grant public access to a project. This is now replaced by an independent checkbox in Project Settings.

Enable Public Access

System Permissions and Role Permissions

HgLab now splits permissions into two silos: System Permissions and Role Permissions.

System Permissions are assigned to Groups and are (and will be) used to restrict access to system-wide areas of functionality, such as ability to manage Projects.

Role Permissions are, as the name implies, assigned to Roles (which are in turn granted via Team Membership) and are used to restrict narrower areas of functionality, such as ability to manage Repositories and Teams.

User Experience

Neverending quest for great UI and UX continues. This release features expandable commit messages (see the little ellipsis in Message column in Commits tab), slightly redesigned Compare page and Diffstats and improved language detection for code highlighting.

Stay Tuned

That’s it for this release, but there’s a lot in the works.

Grab yourself a copy, request an evaluation license and stay tuned.

Happy coding!

Mercurial Support in TFS: Declined

January 17, 2014 •

Yesterday it was announced that Microsoft will not be adding support for Mercurial to Team Foundation Server.

Add Mercurial support to Team Foundation Server

I see two reasons why this might have happened.

Mercurial Core and Licensing Issues

There is a way of comparing and contrasting Git and Mercurial I came up with recently. Git is simple on the inside (with its ingeniously simple and elegant storage format) but overly complex on the outside (with its cumbersome and often illogical CLI). Mercurial, on the other hand, is quite complex on the inside, but has a refreshingly simple CLI.

This observation has far-reaching consequences.

Git, with its simple and-well documented storage format, makes it easy to do a clean room implementation of Git Core in any programming language. Clean room implementation effectively frees authors of GPL restrictions and allows this code to be used in any closed-source product.

Even if not for a possibility of a clean room implementation, libgit2 (which is what Microsoft uses internally) is licensed under GPLv2 with Linking Exception, so incorporating this library into Visual Studio and Team Foundation Server is a no-brainer technology-wise and licensing-wise.

When it comes to Mercurial, matters are significantly more complex here. Low-level Mercurial internals are documented only to a degree, which makes it impossible to implement Mercurial Core using clean room approach. This means that any reimplementation will automatically be treated as derivative work, which forces it to be licensed under GPL, which in turn prohibits usage of the library in a closed-source commercial project.

It’s unclear to me if this issue can be resolved at all. If Microsoft eventually decides to add support for Mercurial to Team Foundation Server, there are several options for them here:

  • Use the Command Server approach, which is the only legal option for the time being, albeit overly cumbersome.
  • Reach an agreement with Matt Mackall, Facebook and numerous Mercurial contributors so that Microsoft will be granted a permission to use Mercurial under different license.
  • Suffer through a complete rewrite of Mercurial without even attempting to take a peek into original source code.

Git Popularity

Comparing absolute numbers of developers using either VCS, Git is indeed more popular than Mercurial, so with Team Foundation Server integrating with Git Microsoft caters for a larger target audience.

Or it does not?

In absolute numbers Git is more popular, but Mercurial is arguably more popular in a corporate world and even more so in companies that are building on Microsoft stack and are using Microsoft products, client and server alike. It’s unlikely that the OSS community is the target market for either Visual Studio or Team Foundation System.

Mercurial Plugin Ecosystem

This is a minor point that is unlikely to have influence Microsoft’s decision, but it’s worth mentioning nevertheless.

Mercurial plugin ecosystem is richer than that of Git and, thanks to a nicer API of Mercurial, its extensions seamlessly integrate into Mercurial proper. Most notably, hg-git is significantly simpler to install than its’ Git counterpart, git-remote-hg, with latter being less feature-rich.

Again, this alone is unlikely to have had any significant weight in a decision to decline the UserVoice request, but it might have left Microsoft thinking that this will somehow satisfy us Mercurial aficionados.

All in all, this is an unfortunate piece of news for several thousand developers and several hundred companies. Let’s see what the future holds.

HgLab 1.1 Released

January 14, 2014 •

It’s been over a month since HgLab 1.0 and it’s high time for an update, so here goes: HgLab 1.1.

Inline Commit Discussions

Up until now HgLab only had commit-level discussions. Welcome inline commit discussions:

Inline Commit Discussions

Discuss with style: inline discussions support Markdown, Emojis and @mentions.

Virtual @ Bookmark

Some teams prefer their mainline branch to be something other than default. Therein lies a catch: newly cloned repositories gets automatically updated to default branch and commits often end up in the wrong place.

Virtual @ Bookmark

To solve that, Mercurial 2.4 introduced a special bookmark called @ to which all fresh clones get updated to. Where does HgLab come into play here? Well, if you change your Mainline Branch to something other than default (and you don’t happen to have @ bookmark already), HgLab will manage this oh-so-special marker by itself, allowing you to always be on the correct path.

Starred Repositories

Your favorite repositories are now even more accessible. Clicking that tiny arrow opens up a handy list of all your Starred Repositories.


Language Statistics

Each Repository page now comes with a nice language statistics graph which shows the language breakdown.

Language Statistics

Performance Improvements and More

Speed is a feature, and I continue to work on improving HgLab performance. This release is no exception: HgLab became much smarter about caching and cache invalidation.

These are the big features in this release, but there’s also a lot of small fixes that contribute to the overall experience: updated icons and .hgignore templates, improved language detection, numerous UI and UX fixes, tweaks and improvements.

Long Road Ahead

These 19 branches you saw on the screenshots above – they are there for a reason. This is just the beginning, and will be many new and exciting features. Stay tuned!

HgLab 1.0 Released

November 26, 2013 •

Today I’m officially launching HgLab 1.0, a self-hosted, behind-the-firewall Mercurial server and source control management system for Windows.

For many companies, hosting an internal source control server and maintaining access to repositories can be a difficult and time consuming process. Now, you can focus on building great software and let HgLab take care of your repository management.

Built for Windows

Mercurial has always had excellent Windows support on the client-side. With HgLab, server-side gets equally great treatment. HgLab runs on Microsoft Windows Server 2003 and above and requires only Microsoft .NET Framework, Internet Information Services and Microsoft SQL Server: everything you are already familiar with.

What’s more, HgLab integrates seamlessly with your LDAP server and provides all the benefits of centralized user and group management.

Centralized Repository Management

HgLab delivers you a central, secure solution to create and manage distributed repositories, on your own servers. Developers can trust that they will find the latest official version of a project. Managers can trust that users’ access to code is appropriate for their role, and assigned with minimal administrative overhead.

Meet HgLab

This is really big: HgLab has now grown out of its beta pants and turned into a mature, real-world application. Over the past 18 months HgLab has come a long way, but there’s an even longer road ahead. My goal with HgLab is to build state-of-the art code collaboration platform for Mercurial and Windows, and version 1.0 is just the beginning.

Head over to Features page to see what HgLab has to offer. Download the installer, request an Evaluation License and be up and running in no time.

Introducing HgLab 1.0

November 21, 2013 •

About 18 months ago I made a first commit to the HgLab repository. From the get-go I had several major goals in mind:

  • Build the Mercurial Server for Windows: minimum dependencies, cleanest and simplest possible installation and upgrade experience
  • Make managing Mercurial repositories less of a hassle
  • Bring all the cool code collaboration tools to Mercurial and Windows

After 1.5 years in the making, I think I have first two points covered.

HgLab runs on Microsoft Windows Server 2003 and above and only requires .NET Framework, Internet Information Services and (for now) Microsoft SQL Server 2008 (Express edition or any later version will do just fine); it’s trivial to install and upgrade.

On the management side HgLab has a lot to offer too: web-based interface for managing Mercurial repositories and users, integration with ActiveDirectory, roles, groups and teams and much much more.

All in all, it’s been a bumpy ride and I have quite a few war stories to tell about IIS, WiX and .NET Framework. Yet, fast-forward 1 300 commits — and HgLab 1.0 is here.

With this release HgLab will be turning into a commercial product. It’s here for the long haul and I believe it has a much bigger chance of of succeeding if it has people committed to doing the not-so-fun things (as opposed to doing “fun” features), producing a very useful, high-quality and reliable product that you can trust your source code with and that use to do what you do best: build awesome software.


From now on, HgLab will be distributed as an MSI package. This is a much cleaner approach compared to what was available previously. Upgrades are handled automatically, so no more hand-picking which files to delete and which to leave out.

One thing to note here. HgLab itself is compiled as AnyCPU and actually runs as 64-bit process on 64-bit systems, but since there is no such a thing as as “AnyCPU MSI” and since I didn’t want to complicate things by offering two versions of installer, there will only be an x86 MSI.

Licensing and Pricing

HgLab will be licensed under a perpetual licensing model. Your license key allows you to use any release of HgLab that was available when you purchased the key, as well as any future releases (bug fixes, enhancements, new features, etc.) for 12 months from the date of purchase. After that 12 months, you can continue to use the version you have forever, or you can choose to renew your license key for another 12 months to continue getting updates.

There will be four licensing tiers for HgLab (plus a full-featured 45-day evaluation license), all providing the same functionality but differing in the number of users who will be able to access the system.

  • Startup: Up to 5 users, $ 29
  • Team: Up to 20 users, $ 349
  • Corporate: Up to 50 users, $ 849
  • Enterprise: Unlimited users plus access to full source code, $ 1 949
  • Evaluation: Unlimited users, 45 day evaluation

Thank you

HgLab has now matured into a real application, and it's time for the beta period to come to an end. The current 0.4.x series of releases will be the last beta releases while I tidy a few things up. On November 25th I'll release the final 1.0 version, and this will be a farewell to the beta label.

To everyone who participated in the beta, you have my sincere thanks for helping to make HgLab the product it is today!

HgLab 0.4.5 Released: Talking About Security

October 24, 2013 •

Last time I mentioned:

…more work related to improving stability, performance and reliability

What I didn’t mention was security. How thoughtful of me.

There is a regression introduced in 0.4.4 while fixing #345, which results in all projects being available to an Anonymous user as long as there is at least one project where an Anonymous was added as a Team member.

HgLab 0.4.5 fixes this issue.

HgLab 0.4 Released

October 23, 2013 •

Please, update to HgLab 0.4.5.

HgLab is nearing its 1.0 release, which means there will be less work put into new features and significantly more work related to improving stability, performance and reliability. Still, there are a couple new features in HgLab 0.4.

As it always is, upgrading HgLab is trivial.

Email Notifications

Email notifications go hand in hand with Watched repositories. Whenever someone pushes to any of the repositories you are watching, you’ll get a nice concise email highlighting all the commits with links to pages where you can review each commit in greater detail and discuss it with your team.

Commit Discussions

Just as mentioned before, you can now discuss commits directly in HgLab. This feature will be serving as a basis for upcoming Pull Requests and Code Reviews.

While discussing commits, you can use Emojis, Markdown formatting and @mentions:

HgLab Commit Discussions and @mentions

All participants will get subscribed to the discussion and will receive email notifications whenever there is a new post.

Bug Fixes

  • Fixed an issue when signed-in users could not see projects accessible by Anonymous users. See #345.
  • Fixed an issue when a Clone URL was not generating for users who use email addresses as logins. See #343, #312.
  • Fixed an issue with browsing repositores without a default branch. See #314.
  • Fixed an issue with browsing Activity Streams for repositories with stripped revisions. See #256, #222.


  • Performance improvements for all Mercurial over-the-wire operations.
  • Various servicing and administration-related improvements and fixes.
  • Significantly improved reliablility and stability of LDAP integration. See #220, #353, #338, #320.
  • As usual, UI and UX fixes all over the place.

Huge thanks to all the beta-testers. Your feedback is truly valuable!

Take HgLab for a Spin

Try HgLab now. Full-featured 45-day evaluation, no credit card required.