{"id":523,"date":"2013-04-11T06:53:29","date_gmt":"2013-04-11T13:53:29","guid":{"rendered":"http:\/\/10kdev.ivystreetinc.com\/?p=523"},"modified":"2013-05-12T06:54:50","modified_gmt":"2013-05-12T13:54:50","slug":"mercurial-merge","status":"publish","type":"post","link":"http:\/\/10kdev.net\/?p=523","title":{"rendered":"Mercurial Merge"},"content":{"rendered":"<p>There are times when you will see some more difficult to resolve Mercurial conflicts, perhaps with extra branches in Tortoise. \u00a0This usually comes about because a developer forgot to pull the most recent code before pushing a recent check in. \u00a0For instance, the .hgtags file which tracks build numbers will be out of sync because the developer did not pull it down before checking in.<\/p>\n<p><strong>Transparent Merge<\/strong><\/p>\n<p>In Mercurial, when you pull and update from the repository, merges are usually done transparently if there are no conflicts:<br \/>\n:&#8221;&#8217;hg pull -u&#8221;&#8217;<\/p>\n<p><strong>Deliberate Merge<\/strong><\/p>\n<p>There are times when trying to do an update in Mercurial from the central repository, the tool will report that there are merge conflicts. \u00a0The first thing to try is a merge, commit, then push like so:<\/p>\n<p>:&#8221;&#8217;hg pull -u&#8221;&#8217;<br \/>\n&#8211;&gt;cannot update, merge conflicts<br \/>\n:&#8221;&#8217;hg merge&#8221;&#8217;<br \/>\n:&#8221;&#8217;hg commit -m &#8220;merge&#8221;&#8221;&#8217;<br \/>\n:&#8221;&#8217;hg push&#8221;&#8217;<\/p>\n<p><strong>Resolve Merge<\/strong><\/p>\n<p>But if something more complicated happens, like the hg tags scenario where your local file is completely out of sync you need to resolve the conflicts.<br \/>\n:&#8221;&#8217;hg resolve&#8221;&#8217;<br \/>\n&#8211;&gt; this will open the default file comparison tool, or KDiff if you have tortoise installed, so that you can manually merge the files:<br \/>\n[[File:Merge sample.jpg]]<br \/>\n:&#8221;&#8217;hg commit -m &#8220;merge&#8221;&#8221;&#8217;<br \/>\n:&#8221;&#8217;hg push&#8221;&#8217;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are times when you will see some more difficult to resolve Mercurial conflicts, perhaps with extra branches in Tortoise. \u00a0This usually comes about because a developer forgot to pull the most recent code before pushing a recent check in. \u00a0For instance, the .hgtags file which tracks build numbers will be out of sync because [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/523"}],"collection":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=523"}],"version-history":[{"count":4,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/523\/revisions"}],"predecessor-version":[{"id":638,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/523\/revisions\/638"}],"wp:attachment":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=523"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=523"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=523"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}