Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How should I use Mercurial as a lone developer?

I've decided that I want to use Mercurial for a small, personal project.

Most of the help I've read about it talks about merging changes between multiple users. Since I'm solo, that's not going to happen.

Should I have multiple repositories? My development computer is already backed up nightly to my Windows Home Server, so it doesn't seem valuable to have a second repository elsewhere just for backup purposes.

Should I be branching every day? Or just around releases? Or when?

In general, what practices do you recommend for the lone developer using Mercurial?

like image 947
Jay Bazuzi Avatar asked Nov 10 '08 06:11

Jay Bazuzi


People also ask

Is mercurial dead?

Mercurial isn't dead. But Atlassian's Bitbucket support for Mercurial is. There are many teams who still have Mercurial repositories. So, Mercurial is very much alive.

Is mercurial better than Git?

Git Is Better for Experienced Users Mercurial depends on your level of technical expertise. Mercurial may be safer for less experienced users, but Git can offer ways to enhance safety (once you know what you are doing).

How does Mercurial work?

Mercurial repositories contain a working directory coupled with a store: The store contains the complete history of the project. Unlike traditional SCMs, where there's only one central copy of this history, every working directory is paired with a private copy of the history.

What is Sourcetree mercurial?

One of the tools out there is Sourcetree, a free Git and Mercurial Mac client offered by Atlassian. Sourcetree is an easy-to-use app that connects to many of the popular source code hosting tools out there like Bitbucket, Kiln and (for Git users) GitHub.


1 Answers

I use Mercurial to develop FsCheck, a unit testing framework hosted in codeplex. I am currently the only developer, but occasionally people send me patches.

Concretely, I have one folder in my filesystem called "FsCheck". In that, I have one repository, and thus folder, called main. Typically, I have a few folders next to that where I work on specific features or bug fixes or whatever, say bug-escapingexceptions and feat-statefulchecking and patch-userFoo. These are created using hg clone.

When I'm done with a feature or bugfix, I commit everything in that folder and push to main. Possibly merge in main. (hg commit, hg push, hg merge). Then I delete the folder (careful using hg status and hg outgoing that I'm not throwing away something useful).

I almost never work in main except right before a release, where I do final cleanup (say documentation). Before release, I tag in main with the release number (hg tag v0.5.1).

Codeplex uses svn as sourcecontrol. I only use it as to store releases, for which I use a locally checked out SVN working copy, to which I copy the Mercurial repository using hg archive. Then commit using svn. Primitive, but it works (using Mercurial as an SVN 'super client' on windows isn't very user-friendly yet in my opnion)

I haven't had to do maintenance on previous releases yet, but I would do that by cloning the main repository from that release's revision(this is easy, since I tagged it), and work in that separate repository. Merging back to the main trunk would be as easy as pushing the changes to main and merging.

In summary:

  • One folder to store all your project's repositories, with the name of your project
  • In that folder one main repository, and one transient repository per "unit of work", with a descriptive name for the unit of work.

It's nice cause your branches and what you're working on is intuitively visible in the filesystem.

like image 101
Kurt Schelfthout Avatar answered Sep 24 '22 15:09

Kurt Schelfthout