pixab 2.6.2 → 2.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/exe/pixab +5 -1
- data/lib/pixab/version.rb +1 -1
- data/lib/projects/MergeRequest.rb +40 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f63b51e91e21453dd1892a925619c5fcb5eec0492800d3f1168b873bd10fc23
|
4
|
+
data.tar.gz: a87f518f6532aca41402fc07af84d9bbc00e8eddd00256f26b14632c3460d714
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 250fbd905a5b0545b54f6dc455fec2066629817a70f99ab338d2008bcfc89259a8b55f2629b2e41a34c76d7c3f9e9e689b40e825b5a787af7a47e8dfa6244282
|
7
|
+
data.tar.gz: 4677eea1c7f6ba9e18af34e27471bfd1617c6c74a882d66cddcb8631c8a33f66985420de0fda2cec088df7cd63d4f538152154b32eec9ceeb5f89146563e6923
|
data/exe/pixab
CHANGED
@@ -27,7 +27,11 @@ when 'sync'
|
|
27
27
|
|
28
28
|
is_need_commit = Pixab::Utilities.display_default_dialog("是否需要提交代码")
|
29
29
|
if is_need_commit
|
30
|
-
commands = [
|
30
|
+
commands = []
|
31
|
+
if ARGV.count > 1
|
32
|
+
commands.push(*ARGV[1..-1])
|
33
|
+
end
|
34
|
+
commands.push("-m")
|
31
35
|
if !synchronizer.updated_repo_names.empty?
|
32
36
|
default_commit_msg = "[Feature]Update"
|
33
37
|
synchronizer.updated_repo_names.each do |repo_name|
|
data/lib/pixab/version.rb
CHANGED
@@ -11,7 +11,7 @@ module Pixab
|
|
11
11
|
|
12
12
|
class MergeRequest
|
13
13
|
|
14
|
-
attr_accessor :repo_type, :default_commit_msg, :need_merge_origin, :need_creat_mr
|
14
|
+
attr_accessor :repo_type, :default_commit_msg, :need_merge_origin, :need_creat_mr, :need_push_remote
|
15
15
|
attr_reader :repo_manager, :repos, :command_options
|
16
16
|
|
17
17
|
def initialize(repo_manager = RepoManager.new, commands = nil)
|
@@ -20,6 +20,7 @@ module Pixab
|
|
20
20
|
@default_commit_msg = "[Feature]"
|
21
21
|
@need_merge_origin = true
|
22
22
|
@need_creat_mr = true
|
23
|
+
@need_push_remote = false
|
23
24
|
|
24
25
|
if commands.nil?
|
25
26
|
return
|
@@ -37,6 +38,9 @@ module Pixab
|
|
37
38
|
@need_merge_origin = false
|
38
39
|
when "--no-mr"
|
39
40
|
@need_creat_mr = false
|
41
|
+
when "--current-branch"
|
42
|
+
@need_creat_mr = false
|
43
|
+
@need_push_remote = true
|
40
44
|
else
|
41
45
|
end
|
42
46
|
end
|
@@ -46,7 +50,11 @@ module Pixab
|
|
46
50
|
read_repo_infos
|
47
51
|
commit
|
48
52
|
merge
|
49
|
-
|
53
|
+
if need_creat_mr
|
54
|
+
push_and_create_mr
|
55
|
+
elsif need_push_remote
|
56
|
+
push_to_remote
|
57
|
+
end
|
50
58
|
end
|
51
59
|
|
52
60
|
# 读取组件信息
|
@@ -102,10 +110,6 @@ module Pixab
|
|
102
110
|
|
103
111
|
# 推送MR
|
104
112
|
def push_and_create_mr()
|
105
|
-
if !need_creat_mr
|
106
|
-
return
|
107
|
-
end
|
108
|
-
|
109
113
|
feature_branch = repo_manager.feature_branch
|
110
114
|
|
111
115
|
reviewers = Utilities.display_dialog("正在创建Merge Request\n请输入审核人员ID:\n子琰(979) 丕臻(1385) 再润(1569) 思保(1922)", "979 1385").split()
|
@@ -141,7 +145,36 @@ module Pixab
|
|
141
145
|
`#{commad} -o merge_request.create #{mr_target} #{mr_source_branch} #{mr_request_assign}`
|
142
146
|
end
|
143
147
|
end
|
144
|
-
|
148
|
+
|
149
|
+
def push_to_remote
|
150
|
+
feature_branch = repo_manager.feature_branch
|
151
|
+
|
152
|
+
repos.each do |repo|
|
153
|
+
repo_name = repo["name"]
|
154
|
+
puts "\n[#{repo_name}]"
|
155
|
+
FileUtils.cd("#{repo_manager.root_path}/#{repo_name}")
|
156
|
+
current_branch = GitUtils.current_branch
|
157
|
+
if current_branch != feature_branch
|
158
|
+
puts "\n[!] The repo #{repo_name} is not in feature branch `#{feature_branch}`. Skip it.".yellow
|
159
|
+
next
|
160
|
+
end
|
161
|
+
|
162
|
+
repo_target_branch = repo["target_branch"]
|
163
|
+
|
164
|
+
log_content = `git log origin/#{repo_target_branch}..#{current_branch} --pretty=format:"%H"`
|
165
|
+
if log_content.empty?
|
166
|
+
puts "\n[!] branch `#{current_branch}` is same as branch `origin/#{repo_target_branch}`. Skip it.".yellow
|
167
|
+
next
|
168
|
+
end
|
169
|
+
|
170
|
+
commad = "git push"
|
171
|
+
if repo["last_branch"].nil?
|
172
|
+
commad += " --set-upstream origin #{current_branch}"
|
173
|
+
end
|
174
|
+
`#{commad}`
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
145
178
|
end
|
146
179
|
|
147
180
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pixab
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.6.
|
4
|
+
version: 2.6.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 廖再润
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-08-
|
11
|
+
date: 2025-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colored2
|