<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>x.zpuppet.org &#187; mercurial</title>
	<atom:link href="http://x.zpuppet.org/tag/mercurial/feed/" rel="self" type="application/rss+xml" />
	<link>http://x.zpuppet.org</link>
	<description>blog</description>
	<lastBuildDate>Wed, 24 Jun 2009 08:36:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>mercurial tasks extension</title>
		<link>http://x.zpuppet.org/2009/03/09/mercurial-tasks-extension/</link>
		<comments>http://x.zpuppet.org/2009/03/09/mercurial-tasks-extension/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 09:16:19 +0000</pubDate>
		<dc:creator>alu</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[mercurial]]></category>

		<guid isPermaLink="false">http://x.zpuppet.org/?p=56</guid>
		<description><![CDATA[Mercurial bookmarks offer a way to work on separate short-lived tasks in the same repo without having to create a separate clone.
For me bookmarks lack two features: tracking all changesets belonging to a particular task, and being able to push completed tasks easily while ensuring that incomplete tasks are not pushed.
I decided to try to [...]]]></description>
			<content:encoded><![CDATA[<p><a title="mercurial bookmarks" href="http://www.selenic.com/mercurial/wiki/index.cgi/BookmarksExtension">Mercurial bookmarks</a> offer a way to work on separate short-lived tasks in the same repo without having to create a separate clone.</p>
<p>For me bookmarks lack two features: tracking all changesets belonging to a particular task, and being able to push completed tasks easily while ensuring that incomplete tasks are not pushed.</p>
<p>I decided to try to extend the bookmarks extension into something different.  I call it &#8216;tasks&#8217; and use it as my todo list.  It&#8217;s amateur python/hg and I would love some help/feedback on it.  You can see it here:  <a title="hgtasks" href="http://bitbucket.org/alu/hgtasks">http://bitbucket.org/alu/hgtasks</a></p>
<p>Below is a similar workflow to <a title="bookmarks workflow" href="http://x.zpuppet.org/2009/02/27/mercurial-bookmarks/">my other post about bookmarks</a>, except it allows me to safely push changes from one completed task while keeping my incomplete task local.</p>
<hr />
<p>You might start off your day by looking at issues in your project tracker and creating a todo list of what issues you want to tackle.  Instead of writing them on a post-it, let’s use tasks:</p>
<pre>$ hg task issue11
$ hg task issue12
$ hg tasks
    issue11      &gt;2:b8df77fa20d7
    issue12      &gt;2:b8df77fa20d7</pre>
<p>You&#8217;ll notice none of them appear &#8220;active&#8221; even though they point to the current changeset which matches our working copy. <img class="aligncenter size-full wp-image-59" title="hgtasks-01" src="http://x.zpuppet.org/wp-content/uploads/2009/03/hgtasks-01.png" alt="hgtasks-01" width="417" height="48" /></p>
<p>Let&#8217;s start hacking on issue11:</p>
<pre>$ hg up issue11
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
current task: issue11
$ hg tasks
  * issue11      &gt;2:b8df77fa20d7
    issue12      &gt;2:b8df77fa20d7</pre>
<p>Now that issue11 is marked as current, future commits will be applied to this task:</p>
<pre>*hack* *hack*
$ hg ci -m"fixing issue11"
*hack* *hack*
$ hg ci -m"still fixing 11"
$ hg tasks
  * issue11       4:6c8236430e56 (2 csets)
    issue12      &gt;2:b8df77fa20d7
$ hg task issue11 --info
task:            issue11
parent:          2:2ed12f44801b
state:           active
changesets (2):  4:31f77916d497
                 3:9ab60daf8b43</pre>
<p>We see that we have two changesets assigned to this task.<img class="aligncenter size-full wp-image-62" title="hgtasks-02" src="http://x.zpuppet.org/wp-content/uploads/2009/03/hgtasks-02.png" alt="hgtasks-02" width="498" height="81" /> Our work on issue11 is still not finished, but issue12 has just been bumped up to high priority and we want to work on it right away leaving issue11 half done.</p>
<pre>$ hg up -C issue12
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
current task: issue12
*hack* *hack*
$ hg ci -m"fixing issue12"
created new head
*hack* *hack*
$ hg ci -m"done fixing 12"
$ hg tasks
    issue11       4:6c8236430e56 (2 csets)
  * issue12       6:8672b6e96787 (2 csets)</pre>
<p><img class="aligncenter size-full wp-image-64" title="hgtasks-03" src="http://x.zpuppet.org/wp-content/uploads/2009/03/hgtasks-03.png" alt="hgtasks-03" width="507" height="105" /><br />
 Let&#8217;s mark issue12 as complete:</p>
<pre>$ hg task issue12 -c
$ hg tasks
    issue11       4:6c8236430e56 (2 csets)
$ hg tasks --all
    issue11       4:6c8236430e56 (2 csets)
    issue12       6:8672b6e96787 (2 csets - complete)</pre>
<p>By default, the task list will only include incomplete tasks unless we use the &#8211;all option.</p>
<p>We want to push this fix right away as it is high priority:</p>
<pre>$ hg push
pushing to /some/other/repo
abort: pushing incomplete tasks
(use --all-tasks to force or --completed-tasks to prune)
$ hg push --completed-tasks
pushing to /some/other/repo
searching for completed tasks
searching for changes
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 1 files</pre>
<p>Notice that push will warn you that incomplete tasks would be pushed (this is even before the standard warning of creating additional heads on the remote repo).  So we can choose to use <span class="code">&#8211;all-tasks</span> option to push everything (at which point we would be told to use <span class="code">&#8211;force</span> if we really want to create new heads) or we can do what makes more sense, only push completed tasks with the <span class="code">&#8211;completed-tasks</span> option.  Now we can go back to working on issue11:</p>
<pre>$ hg up -C issue11
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
current task: issue11
*hack* *hack*
$ hg ci -m"done fixing 11"
$ hg task -c issue11</pre>
<p>Merge in changes from issue12:</p>
<pre>$ hg merge issue12
merging file
0 files updated, 1 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg ci -m"merge"</pre>
<p><img class="aligncenter size-full wp-image-65" title="hgtasks-04" src="http://x.zpuppet.org/wp-content/uploads/2009/03/hgtasks-04.png" alt="hgtasks-04" width="483" height="141" /><br />
 We can leave completed tasks around but if you have no reason to keep them around, might as well delete them:</p>
<pre>$ hg task -d issue11
$ hg task -d issue12</pre>
<p><img class="aligncenter size-full wp-image-59" title="hgtasks-05" src="http://x.zpuppet.org/wp-content/uploads/2009/03/hgtasks-05.png" alt="hgtasks-05" width="423" height="144" /></p>
<hr />
<p>To see more features of this extension and details on how it was implemented, check out: <a title="hgtasks" href="http://bitbucket.org/alu/hgtasks">http://bitbucket.org/alu/hgtasks</a>.</p>
<p><br class="spacer_" /></p>
]]></content:encoded>
			<wfw:commentRss>http://x.zpuppet.org/2009/03/09/mercurial-tasks-extension/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>mercurial bookmarks</title>
		<link>http://x.zpuppet.org/2009/02/27/mercurial-bookmarks/</link>
		<comments>http://x.zpuppet.org/2009/02/27/mercurial-bookmarks/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 09:24:31 +0000</pubDate>
		<dc:creator>alu</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[mercurial]]></category>

		<guid isPermaLink="false">http://x.zpuppet.org/?p=15</guid>
		<description><![CDATA[When reading the many git-vs-mercurial blog posts I noticed lots of comments about how mercurial lacked the lightweight branching of git.  Then came a lot of rebuttals saying &#8220;well hg has bookmarks, so that&#8217;s not true anymore&#8221;.  But when I tried them, I was surprised by their behaviour.  If you had two bookmarks pointing to [...]]]></description>
			<content:encoded><![CDATA[<p>When reading the many git-vs-mercurial blog posts I noticed lots of comments about how mercurial lacked the lightweight branching of git.  Then came a lot of rebuttals saying &#8220;well hg has bookmarks, so that&#8217;s not true anymore&#8221;.  But when I tried them, I was surprised by their behaviour.  If you had two bookmarks pointing to the same changeset, they both would move as you create new child changesets.  But with the 1.2 release of hg coming out soon, an updated version of the <a href="http://bitbucket.org/segv/bookmarks/overview/">bookmarks extension</a> will be included.   It has a configuration option (which I wish was the default but cannot be due to backwards compatibility) called <span class="code">track.current</span>.  To enable this behaviour, you&#8217;ll need this in your rc file:</p>
<pre>[extensions]
hgext.bookmarks =

[bookmarks]
track.current = True</pre>
<p>Here&#8217;s a workflow that I find useful.  You might start off your day by looking at issues in your project tracker and creating a todo list of what issues you want to tackle.  Instead of writing them on a post-it, let&#8217;s use bookmarks:</p>
<pre>$ hg bookmark issue11
$ hg bookmark issue12
$ hg bookmarks
   issue11                   216:ca8cec4bf890
   issue12                   216:ca8cec4bf890</pre>
<p>You&#8217;ll notice none of them appear active even though they point to the current changeset which matches our<br />
working copy.</p>
<pre>$ hg up issue11
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg bookmarks
 * issue11                   216:ca8cec4bf890
   issue12                   216:ca8cec4bf890</pre>
<p><img class="size-full wp-image-29 alignnone" title="hg-bo-011" src="http://x.zpuppet.org/wp-content/uploads/2009/02/hg-bo-011.png" alt="hg-bo-011" width="264" height="96" /></p>
<hr />
<p>Let&#8217;s start hacking on issue11,</p>
<pre>*hack* *hack*
$ hg ci -m"fixing issue11"
*hack* *hack*
$ hg ci -m"still fixing 11"
$ hg bookmarks
 * issue11                   218:cdc9e873455d
   issue12                   216:ca8cec4bf890</pre>
<p>At this point, we haven&#8217;t yet created a branch:<br />
<img class="alignnone size-full wp-image-30" title="hg-bo-021" src="http://x.zpuppet.org/wp-content/uploads/2009/02/hg-bo-021.png" alt="hg-bo-021" width="264" height="174" /></p>
<hr />
<p>Our work on issue11 is still not finished, but we&#8217;re bored with and want to work on something else for a while. So let&#8217;s do some work on issue12:</p>
<pre>$ hg up -C issue12
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
*hack* *hack*
$ hg ci -m"fixing issue12"
created new head
*hack* *hack*
$ hg ci -m"done fixing 12"</pre>
<p><img class="alignnone size-full wp-image-40" title="hg-bo-031" src="http://x.zpuppet.org/wp-content/uploads/2009/02/hg-bo-031.png" alt="hg-bo-031" width="264" height="252" /></p>
<hr />
<p>Now we we&#8217;re happy with our fix and are done with 12. Back to issue 11.</p>
<pre>$ hg up -C issue11
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
*hack* *hack*
$ hg ci -m"done fixing 11"</pre>
<p>Merge in changes from issue12, (could have done this earlier):</p>
<pre>$ hg merge issue12
merging file
0 files updated, 1 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg ci -m"merge"</pre>
<p><img class="alignnone size-full wp-image-31" title="hg-bo-041" src="http://x.zpuppet.org/wp-content/uploads/2009/02/hg-bo-041.png" alt="hg-bo-041" width="264" height="324" /></p>
<hr />
<p>We&#8217;re done with these bookmarks for now so delete them:</p>
<pre>$ hg bookmark -d issue12
$ hg bookmark -d issue11</pre>
<p><img class="alignnone size-full wp-image-32" title="hg-bo-051" src="http://x.zpuppet.org/wp-content/uploads/2009/02/hg-bo-051.png" alt="hg-bo-051" width="252" height="330" /></p>
<hr class="step" />
]]></content:encoded>
			<wfw:commentRss>http://x.zpuppet.org/2009/02/27/mercurial-bookmarks/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>config extension for mercurial</title>
		<link>http://x.zpuppet.org/2009/02/23/config-extension-for-mercurial/</link>
		<comments>http://x.zpuppet.org/2009/02/23/config-extension-for-mercurial/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 22:02:32 +0000</pubDate>
		<dc:creator>alu</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[mercurial]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://x.zpuppet.org/?p=5</guid>
		<description><![CDATA[I&#8217;ve written a small extension for mercurial called &#8216;config&#8217;.  It allows you to view and set configuration values for hg from the command-line.
Some example commands and output:
prompt&#62; hg showconfigs
 ! /usr/etc/mercurial/hgrc
 * /etc/mercurial/hgrc
 * /etc/mercurial/hgrc.d/hgext.rc (ro)
 * /etc/mercurial/hgrc.d/mergetools.rc (ro)
 * /home/jdoe/.hgrc
 * /home/jdoe/projects/hgconfig/.hg/hgrc
prompt&#62; hg config --verbose ui.username
values found for ui.username:
 jdoe@host  C:\Documents and Settings\jdoe\mercurial.ini
 [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve written a small extension for mercurial called &#8216;config&#8217;.  It allows you to view and set configuration values for hg from the command-line.</p>
<p>Some example commands and output:</p>
<pre>prompt&gt; hg showconfigs
 ! /usr/etc/mercurial/hgrc
 * /etc/mercurial/hgrc
 * /etc/mercurial/hgrc.d/hgext.rc (ro)
 * /etc/mercurial/hgrc.d/mergetools.rc (ro)
 * /home/jdoe/.hgrc
 * /home/jdoe/projects/hgconfig/.hg/hgrc</pre>
<pre>prompt&gt; hg config --verbose ui.username
values found for ui.username:
 jdoe@host  C:\Documents and Settings\jdoe\mercurial.ini
 john       d:\projects\hgconfig\src\.hg\hgrc</pre>
<p>See more at <a title="hgconfig" href="http://bitbucket.org/alu/hgconfig">http://bitbucket.org/alu/hgconfig/</a></p>
<p>I would appreciate feedback so please get back to me here or on bitbucket.  This is my first mercurial extension and my first python anything.</p>
]]></content:encoded>
			<wfw:commentRss>http://x.zpuppet.org/2009/02/23/config-extension-for-mercurial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
