def hg(command, error = true)
      unless Berkshelf.which('hg') || Berkshelf.which('hg.exe')
        raise HgNotInstalled.new
      end

      Berkshelf.log.debug("Running:hg #{command}")
      response = shell_out(%|hg #{command}|)
      Berkshelf.log.debug("response:hg #{response.stdout}")

      if response.error?
        raise HgCommandError.new(command, response, cache_path)
      end

      response.stdout.strip
    end
def hg(command, error = true)
      unless Berkshelf.which('hg') || Berkshelf.which('hg.exe')
        raise HgNotInstalled.new
      end

      Berkshelf.log.debug("Running:hg #{command}")
      response = shell_out(%|hg #{command}|)
      Berkshelf.log.debug("response:hg #{response.stdout}")

      if response.error?
        raise HgCommandError.new(command, response, cache_path)
      end

      response.stdout.strip
    end
Perform a mercurial command.

 @param [String] command
   the command to run
 @param [Boolean] error
   whether to raise error if the command fails

 @raise [String]
   the +$stdout+ from the command