<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/bob/scm/hg.rb</filename>
    </added>
    <added>
      <filename>test/hg_test.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -4,6 +4,7 @@ module Bob
   module SCM
     autoload :Git, &quot;bob/scm/git&quot;
     autoload :Svn, &quot;bob/scm/svn&quot;
+    autoload :Hg, &quot;bob/scm/hg&quot;
 
     class Error &lt; StandardError; end
 </diff>
      <filename>lib/bob/scm.rb</filename>
    </modified>
    <modified>
      <diff>@@ -81,7 +81,7 @@ SH
     end
 
     def create
-      FileUtils.mkdir(@path)
+      FileUtils.mkdir_p(@path)
 
       Dir.chdir(@path) {
         `git init`
@@ -160,4 +160,58 @@ SH
       end
     end
   end
+  
+  class HgRepo &lt; AbstractRepo
+    def scm
+      &quot;hg&quot;
+    end
+
+    def branch
+      &quot;default&quot;
+    end
+
+    def uri
+      @path
+    end
+
+    def add(file)
+      `hg add #{file}`
+    end
+
+    def commit(message)
+      `hg commit -m &quot;#{message}&quot;`
+    end
+
+    def head
+      Dir.chdir(@path) { `hg tip --template '{node|short}'` }
+    end
+
+    def create
+      FileUtils.mkdir_p(@path)
+
+      Dir.chdir(@path) {
+        `hg init`
+        `echo &quot;[ui]\nusername = John Doe &lt;johndoe@example.com&gt;&quot; &gt;&gt; .hg/hgrc`
+      }
+
+      super
+    end
+
+    def commits
+      Dir.chdir(@path) {
+        `hg log --template '{node|short} '`.split(' ').
+        inject([]) { |acc, node|
+          format = &quot;---\nidentifier: {node|short}\nauthor: {author} &quot; +
+            &quot;\nmessage: &gt;-\n  {desc}\ncommitted_at: {date|isodate}\n&quot;
+
+          dump = YAML.load(`hg log -r #{node} \
+            --template '#{format}'`)
+
+          dump.update(&quot;committed_at&quot; =&gt; Time.parse(dump[&quot;committed_at&quot;]))
+          
+          acc &lt;&lt; dump
+        }.reverse
+      }
+    end
+  end
 end</diff>
      <filename>lib/bob/test/repo.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,5 +22,6 @@ class BobTestTest &lt; Test::Unit::TestCase
   def test_scm_repo
     assert_scm_repo(GitRepo.new)
     assert_scm_repo(SvnRepo.new)
+    assert_scm_repo(HgRepo.new)
   end
 end</diff>
      <filename>test/test_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>104c6097264d8f9a0fc3df8f4ffec4b9749f26ba</id>
    </parent>
  </parents>
  <author>
    <name>Paul Damer</name>
    <email>paul.damer@duke.edu</email>
  </author>
  <url>http://github.com/pdamer/bob/commit/615f83595f797d417be2da81d467f95a1c3d7956</url>
  <id>615f83595f797d417be2da81d467f95a1c3d7956</id>
  <committed-date>2009-10-12T19:34:54-07:00</committed-date>
  <authored-date>2009-10-12T19:34:54-07:00</authored-date>
  <message>Adding Mercurial Support</message>
  <tree>1d0053ee265d998c4d4234b0d60641233853f59c</tree>
  <committer>
    <name>Paul Damer</name>
    <email>paul.damer@duke.edu</email>
  </committer>
</commit>
