-
Notifications
You must be signed in to change notification settings - Fork 5.6k
/
hg_push.rb
64 lines (54 loc) 路 1.98 KB
/
hg_push.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
module Fastlane
module Actions
# Pushes commits to the remote hg repo
class HgPushAction < Action
def self.run(params)
command = ['hg', 'push']
command << '--force' if params[:force]
command << params[:destination] unless params[:destination].empty?
return command.join(' ') if Helper.test?
Actions.sh(command.join(' '))
UI.success('Successfully pushed changes to remote 馃殌.')
end
def self.description
"This will push changes to the remote hg repository"
end
def self.details
"The mercurial equivalent of [push_to_git_remote](https://docs.fastlane.tools/actions/push_to_git_remote/). Pushes your local commits to a remote mercurial repo. Useful when local changes such as adding a version bump commit or adding a tag are part of your lane鈥檚 actions."
end
def self.available_options
[
FastlaneCore::ConfigItem.new(key: :force,
env_name: "FL_HG_PUSH_FORCE",
description: "Force push to remote",
type: Boolean,
default_value: false),
FastlaneCore::ConfigItem.new(key: :destination,
env_name: "FL_HG_PUSH_DESTINATION",
description: "The destination to push to",
default_value: '',
optional: true)
]
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_push',
'hg_push(
destination: "ssh://hg@repohost.com/owner/repo",
force: true
)'
]
end
def self.category
:source_control
end
end
end
end