Sha256: f572eaf91bc720441c4aaa4b8c09a7ba9d685db2e2d30a37bc06c6f5ede40d7a

Contents?: true

Size: 1.54 KB

Versions: 495

Compression:

Stored size: 1.54 KB

Contents

module Fastlane
  module Actions
    module SharedValues
      HG_REPO_WAS_CLEAN_ON_START = :HG_REPO_WAS_CLEAN_ON_START
    end
    # Raises an exception and stop the lane execution if the repo is not in a clean state
    class HgEnsureCleanStatusAction < Action
      def self.run(params)
        repo_clean = `hg status`.empty?

        if repo_clean
          UI.success('Mercurial status is clean, all good! 😎')
          Actions.lane_context[SharedValues::HG_REPO_WAS_CLEAN_ON_START] = true
        else
          UI.user_error!('Mercurial repository is dirty! Please ensure the repo is in a clean state by committing/stashing/discarding all changes first.')
        end
      end

      def self.description
        "Raises an exception if there are uncommitted hg changes"
      end

      def self.details
        "Along the same lines as the [`ensure_git_status_clean`](#ensure_git_status_clean) action, this is a sanity check to ensure the working mercurial repo is clean. Especially useful to put at the beginning of your Fastfile in the `before_all` block."
      end

      def self.output
        [
          ['HG_REPO_WAS_CLEAN_ON_START', 'Stores the fact that the hg repo was clean at some point']
        ]
      end

      def self.author
        # credits to lmirosevic for original git version
        "sjrmanning"
      end

      def self.is_supported?(platform)
        true
      end

      def self.example_code
        [
          'hg_ensure_clean_status'
        ]
      end

      def self.category
        :source_control
      end
    end
  end
end

Version data entries

495 entries across 495 versions & 1 rubygems

Version Path
fastlane-2.85.0.beta.20180308050114 fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-2.85.0.beta.20180307050101 fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-2.85.0.beta.20180306050019 fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-2.85.0.beta.20180305050037 fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-2.85.0.beta.20180304050031 fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-2.85.0.beta.20180303050048 fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-2.85.0.beta.20180302050035 fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-2.84.0 fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-2.84.0.beta.20180301050048 fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-2.84.0.beta.20180228050122 fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-2.84.0.beta.20180227050054 fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-2.83.0 fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-2.83.0.beta.20180226050016 fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-2.83.0.beta.20180225050035 fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-2.83.0.beta.20180224050047 fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-2.82.0 fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-2.82.0.beta.20180223010003 fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-2.82.0.beta.20180222010003 fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-2.82.0.beta.20180221010003 fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb
fastlane-2.82.0.beta.20180220010002 fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb