Sha256: af84fc9203fe125e15f917a0886f28f40602d9261900a7a563b8520efff7dacb

Contents?: true

Size: 545 Bytes

Versions: 7

Compression:

Stored size: 545 Bytes

Contents

# frozen_string_literal: true
module RubyCritic
  module SourceControlSystem
    class Mercurial < Base
      register_system

      def self.supported?
        `hg verify 2>&1` && $?.success?
      end

      def self.to_s
        'Mercurial'
      end

      def revisions_count(path)
        `hg log #{path.shellescape} --template '1'`.size
      end

      def date_of_last_commit(path)
        `hg log #{path.shellescape} --template '{date|isodate}' --limit 1`.chomp
      end

      def revision?
        false
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rubycritic-3.2.0 lib/rubycritic/source_control_systems/mercurial.rb
rubycritic-3.1.3 lib/rubycritic/source_control_systems/mercurial.rb
rubycritic-3.1.2 lib/rubycritic/source_control_systems/mercurial.rb
rubycritic-3.1.1 lib/rubycritic/source_control_systems/mercurial.rb
rubycritic-3.1.0 lib/rubycritic/source_control_systems/mercurial.rb
rubycritic-3.0.0 lib/rubycritic/source_control_systems/mercurial.rb
rubycritic-2.9.4 lib/rubycritic/source_control_systems/mercurial.rb