{"id":69,"date":"2014-01-17T16:01:02","date_gmt":"2014-01-17T15:01:02","guid":{"rendered":"http:\/\/miroz.com.hr\/blog\/?p=69"},"modified":"2014-02-15T11:16:45","modified_gmt":"2014-02-15T10:16:45","slug":"hgchecker","status":"publish","type":"post","link":"https:\/\/miroz.com.hr\/blog\/projects\/hgchecker","title":{"rendered":"HgChecker"},"content":{"rendered":"<p>When I used Subversion as the SCS, I had all my projects in one repository, and every commit went to the central server. I looked at root folder and I knew commit status of all projects.<\/p>\n<p>Now I use Mercurial and I have multiple unrelated or loosely related projects and every project is a separate repository. My dev folder is structured like this:<\/p>\n<ul>\n<li>\/dev\n<ul>\n<li>\/Apps\n<ul>\n<li>\/App1<\/li>\n<li>\/App2<\/li>\n<\/ul>\n<\/li>\n<li>\/Reporting\n<ul>\n<li>\/ReportingApp1<\/li>\n<li>\/ReportingApp2<\/li>\n<\/ul>\n<\/li>\n<li>\/Scripts\n<ul>\n<li>\/Importer1<\/li>\n<li>\/Exporter2<\/li>\n<\/ul>\n<\/li>\n<li>\/TestArea\n<ul>\n<li>\/TestProject1<\/li>\n<li>\/Test2<\/li>\n<\/ul>\n<\/li>\n<li>\/Utils\n<ul>\n<li>\/Util1<\/li>\n<li>\/Util2<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>So, after a frantic week where I made fixes to old code, changed some scripts, worked at current development project and tested some new techiques in test projects, I asked myself:<\/p>\n<ol>\n<li>Have I commited every change in every project?<\/li>\n<li>Have I pushed every change to remote server?<\/li>\n<li>Is there any change in remote repository I can pull?<\/li>\n<\/ol>\n<p>TortoiseHg icons give me some clues but they often can be wrong. I have to remember what I changed or check every project one by one. I&#8217;m not good at remembering things and I hate repetitive work that computer could do for me so i just had to write another utility to keep track of my projects.<\/p>\n<p>Here&#8217;s how it works:<\/p>\n<ul>\n<li>Configuration is done in config.ini<\/li>\n<li>HGChecker will traverse folder hierarchy beginning from [ProjectRootDir]<\/li>\n<li>It will check if any subfolder is project folder using patterns defined in [FindProjectRootFilePattern] or [FindProjectRootDirPattern]<\/li>\n<li>It will run hg.ex defined in [HgExecutable] with status, incoming and outgoing parameters.<\/li>\n<li>It will translate responses from hg and show the results in console, coded as following:\n<ul>\n<li>? (cyan) &#8211; project is not source controlled<\/li>\n<li>M (blue) &#8211; uncommitted changes<\/li>\n<li>\u2191\u2193 (red) &#8211; no valid default remote repository<\/li>\n<li>\u2191[#] (yelow) &#8211; there are # outgoing changes to push<\/li>\n<li>\u2193[#] (yelow) &#8211; # incoming changes available from remote repository<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>So, I have a scheduled a task that runs HGChecker every day at the end of the workday. Usually I strive to commit when I&#8217;m done, push when it&#8217;s ready and add every project to source control. But I&#8217;m not perfect and I easily forget. HGChecker is there now to remind me.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"627\" height=\"330\" class=\"aligncenter size-full wp-image-70\" alt=\"hgchecker-console\" src=\"http:\/\/miroz.com.hr\/blog\/wp-content\/uploads\/2014\/01\/hgchecker-console.png\" srcset=\"https:\/\/miroz.com.hr\/blog\/wp-content\/uploads\/2014\/01\/hgchecker-console.png 627w, https:\/\/miroz.com.hr\/blog\/wp-content\/uploads\/2014\/01\/hgchecker-console-300x157.png 300w\" sizes=\"(max-width: 627px) 100vw, 627px\" \/><\/p>\n<p>When this screen shows up, I immediatelly know the following:<\/p>\n<ul>\n<li>I have some uncommited changes in App1 and there are two remote changes I must pull &#8211; there is merge on the way<\/li>\n<li>It seems I created ReportingApp2 project but I didn&#8217;t add it to source control<\/li>\n<li>I have commited one change to Importer1 but I didn&#8217;t push it to remote.<\/li>\n<li>Importer 2 is source controled but it doesn&#8217;t have default remote repository<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><a href=\"https:\/\/bitbucket.org\/miroz\/hgchecker\">Check HGChecker repository on BitBucket<\/a><\/li>\n<li><a href=\"https:\/\/bitbucket.org\/miroz\/hgchecker\/downloads\/HGChecker.zip\">Download console application for .NET 2.0<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>When I used Subversion as the SCS, I had all my projects in one repository, and every commit went to the central server. I looked at root folder and I knew commit status of all projects. Now I use Mercurial and I have multiple unrelated or loosely related projects and every project is a separate [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/miroz.com.hr\/blog\/wp-json\/wp\/v2\/posts\/69"}],"collection":[{"href":"https:\/\/miroz.com.hr\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/miroz.com.hr\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/miroz.com.hr\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/miroz.com.hr\/blog\/wp-json\/wp\/v2\/comments?post=69"}],"version-history":[{"count":9,"href":"https:\/\/miroz.com.hr\/blog\/wp-json\/wp\/v2\/posts\/69\/revisions"}],"predecessor-version":[{"id":77,"href":"https:\/\/miroz.com.hr\/blog\/wp-json\/wp\/v2\/posts\/69\/revisions\/77"}],"wp:attachment":[{"href":"https:\/\/miroz.com.hr\/blog\/wp-json\/wp\/v2\/media?parent=69"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/miroz.com.hr\/blog\/wp-json\/wp\/v2\/categories?post=69"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/miroz.com.hr\/blog\/wp-json\/wp\/v2\/tags?post=69"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}