{"id":5,"date":"2007-11-24T22:28:00","date_gmt":"2007-11-24T21:28:00","guid":{"rendered":"http:\/\/www.andypalmer.com\/blog\/?p=5"},"modified":"2007-11-24T22:28:00","modified_gmt":"2007-11-24T21:28:00","slug":"things-i-like-mercurial-version-control","status":"publish","type":"post","link":"https:\/\/andypalmer.com\/2007\/11\/things-i-like-mercurial-version-control\/","title":{"rendered":"Things I Like: Mercurial Version Control"},"content":{"rendered":"
I was recently introduced to Mercurial version control. (http:\/\/www.selenic.com\/mercurial\/<\/a>) Things I like (a lot): As an example, here is how you would create a new repository once you have decided that you are going to bring it under version control (before you start, right?) \ud83d\ude42<\/p>\n We start in the working directory of the project: The ease with which you can create a new repository along with the fact that it is stored alongside the working copy without all the versioning artifacts mean that Mercurial is going to be my version control system of choice for my personal projects going forward (sorry subversion)<\/p>\n","protected":false},"excerpt":{"rendered":" I was recently introduced to Mercurial version control. (http:\/\/www.selenic.com\/mercurial\/)I haven’t had enough time to play with it to tell how well it holds up in all situations, but first impressions are very positive. Things I like (a lot):– the repository is contained within the working directory, but only in the root, so you don’t have […]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/andypalmer.com\/wp-json\/wp\/v2\/posts\/5"}],"collection":[{"href":"https:\/\/andypalmer.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/andypalmer.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/andypalmer.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/andypalmer.com\/wp-json\/wp\/v2\/comments?post=5"}],"version-history":[{"count":0,"href":"https:\/\/andypalmer.com\/wp-json\/wp\/v2\/posts\/5\/revisions"}],"wp:attachment":[{"href":"https:\/\/andypalmer.com\/wp-json\/wp\/v2\/media?parent=5"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/andypalmer.com\/wp-json\/wp\/v2\/categories?post=5"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/andypalmer.com\/wp-json\/wp\/v2\/tags?post=5"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}
I haven’t had enough time to play with it to tell how well it holds up in all situations, but first impressions are very positive.<\/p>\n
– the repository is contained within the working directory, but only in the root, so you don’t have version control artifacts spread throughout the directory structure.
– The way it handles development branches is very clever. Modifications are stored as changesets, which are then applied to a common parent. If two developers move down separate paths, it effectively creates two branches. It’s possible to change between “branches” by reverting to the common parent and then applying the changesets for the other branch.
– It’s possible to merge the two branches (called heads) together to return to a single main branch (There is a clever pattern that Dan North<\/a> showed me using this that lets you merge a complex change back into another version control system)<\/p>\n
– hg init (tell Mercurial to create a repository)<\/i>
– hg addremove (add all files in this directory and subdirectories to the repository)<\/i>
– hg ci -m “Created repository for Project X” (commit the changes to the repository)<\/i><\/p>\n