{"id":2772,"date":"2015-05-23T16:54:57","date_gmt":"2015-05-23T21:54:57","guid":{"rendered":"http:\/\/mikeconley.ca\/blog\/?p=2772"},"modified":"2023-12-20T16:25:10","modified_gmt":"2023-12-20T21:25:10","slug":"things-ive-learned-this-week-may-18-may-22-2015","status":"publish","type":"post","link":"https:\/\/mikeconley.ca\/blog\/2015\/05\/23\/things-ive-learned-this-week-may-18-may-22-2015\/","title":{"rendered":"Things I&#8217;ve Learned This Week (May 18 &#8211; May 22, 2015)"},"content":{"rendered":"<p>You might have noticed that I had no &#8220;Things I&#8217;ve Learned This Week&#8221; post last week. Sorry about that &#8211; by the end of the week, I looked at my Evernote of &#8220;lessons from the week&#8221;, and it was empty. I&#8217;m certain I&#8217;d learned stuff, but I just failed to write it down. So I guess the lesson I learned last week was, <strong>always write down what you learn.<\/strong><\/p>\n<h2>How to make your mozilla-central Mercurial clone work faster<\/h2>\n<p>I like Mercurial. I also like Git, but recently, I&#8217;ve gotten pretty used to Mercurial.<\/p>\n<p>One complaint I hear over and over (and I&#8217;m guilty of it myself sometimes), is that &#8220;Mercurial is slow&#8221;. I&#8217;ve even experienced that slowness during some of <a href=\"http:\/\/mikeconley.ca\/blog\/category\/technology\/livecoding\/\">my Joy of Coding episodes<\/a>.<\/p>\n<p>This past week, I was helping <a href=\"http:\/\/ursulasarracini.com\/\">my awesome new intern<\/a> get set up to tear into some e10s bugs, and at some point <a href=\"http:\/\/mozilla-version-control-tools.readthedocs.org\/en\/latest\/hgmozilla\/index.html\">we went through this document<\/a> to get her .hgrc all set up.<\/p>\n<p>This document did not exist when I first started working with Mercurial &#8211; back then, I was using mq or sometimes pbranch, and grumbling about how I missed Git.<\/p>\n<p><strong>But there is some gold in this document.<\/strong><\/p>\n<p><a href=\"http:\/\/gregoryszorc.com\/\">gps<\/a> has been doing some killer work documenting best practices with Mercurial, and this document is one of the results of his labour.<\/p>\n<p><a href=\"http:\/\/mozilla-version-control-tools.readthedocs.org\/en\/latest\/hgmozilla\/extensions.html#hgwatchman\">The part that&#8217;s really made the difference for me is the hgwatchman bit.<\/a><\/p>\n<p><a href=\"https:\/\/facebook.github.io\/watchman\/\">watchman<\/a> is a tool that some folks at Facebook wrote to monitor changes in a folder. <a href=\"https:\/\/bitbucket.org\/facebook\/hgwatchman\">hgwatchman<\/a> is an extension for Mercurial that takes advantage of watchman for a repository, smartly precomputing a bunch of stuff when the folder changes so that when you fire a command, like<\/p>\n<pre>hg status<\/pre>\n<p>It takes a fraction of the time it&#8217;d take without hgwatchman. A fraction.<\/p>\n<p>Here&#8217;s how I set hgwatchman up on my MacBook (though <a href=\"http:\/\/mozilla-version-control-tools.readthedocs.org\/en\/latest\/hgmozilla\/extensions.html#hgwatchman\">you should probably go by the Mercurial for Mozillians doc as the official reference<\/a>):<\/p>\n<ol>\n<li>Install watchman with brew:\n<pre>brew install watchman<\/pre>\n<\/li>\n<li>Clone the hgwatchman extension to some folder that you can easily remember and build it:\n<pre>hg clone https:\/\/bitbucket.org\/facebook\/hgwatchman\r\ncd hgwatchman\r\nmake local<\/pre>\n<\/li>\n<li>Add the following lines to my user .hgrc:\n<pre><span class=\"k\">[extensions]<\/span>\r\n<span class=\"na\">hgwatchman<\/span> <span class=\"o\">=<\/span> cloned-in-dir<span class=\"s\">\/hgwatchman\/hgwatchman<\/span><\/pre>\n<\/li>\n<li>Make sure the extension is properly installed by running:\n<pre>hg help extensions<\/pre>\n<\/li>\n<li>hgwatchman should be listed under &#8220;enabled extensions&#8221;. If it didn&#8217;t work, keep in mind that you want to target the hgwatchman directory<\/li>\n<li>And then in my mozilla-central .hg\/.hgrc:\n<pre>[watchman]\r\nmode = on<\/pre>\n<\/li>\n<li>Boom, you&#8217;re done!<\/li>\n<\/ol>\n<p>Congratulations, hg should feel snappier now!<\/p>\n<p>Next step is to try out <a href=\"http:\/\/mozilla-version-control-tools.readthedocs.org\/en\/latest\/hgmozilla\/extensions.html#chg\">this chg thing<\/a> &#8211; <a href=\"https:\/\/bitbucket.org\/yuja\/chg\/issue\/1\/chg-fails-with-chg-abort-failed-to-read\">though I&#8217;m having some issues<\/a> still.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You might have noticed that I had no &#8220;Things I&#8217;ve Learned This Week&#8221; post last week. Sorry about that &#8211; by the end of the week, I looked at my Evernote of &#8220;lessons from the week&#8221;, and it was empty. I&#8217;m certain I&#8217;d learned stuff, but I just failed to write it down. So I [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[874,861,110],"tags":[1176,998,125,1174,883,35,1019,1175],"class_list":["post-2772","post","type-post","status-publish","format-standard","hentry","category-firefox-mozilla-2","category-mozilla-2","category-musings","tag-chg","tag-fast","tag-firefox","tag-hgwatchman","tag-mercurial","tag-mozilla","tag-speed","tag-watchman"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/prmTy-II","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/posts\/2772","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/comments?post=2772"}],"version-history":[{"count":4,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/posts\/2772\/revisions"}],"predecessor-version":[{"id":2776,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/posts\/2772\/revisions\/2776"}],"wp:attachment":[{"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/media?parent=2772"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/categories?post=2772"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/tags?post=2772"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}