pindo 5.5.0 → 5.5.2
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/lib/pindo/command/dev/tag.rb +22 -6
- data/lib/pindo/module/build/buildhelper.rb +1 -1
- data/lib/pindo/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fc0da63e03341f38c7ab8ba1978d58d6777e81150487c11bce90a15cced9115
|
4
|
+
data.tar.gz: 14497a37c91a7dd3203c1a67ab9e21b771b4e1d1803fda9ea4236e0838f502e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6e87f354dfa085b2469505bf593e753036ad889bd5f78c4e2014fd0e5ece208c92fdec1c5f2cd74e7533351216f26b13e6070ff7943a9667ab6f2c9b3628025
|
7
|
+
data.tar.gz: 947663c7599d2f4a866632cf3102f4414863c41e70feb7a8994b20002b269faa929c77399c11ac7a3239b8b231a9f3cb50860b996495bb5073bc4328f2e3b091
|
@@ -133,7 +133,7 @@ module Pindo
|
|
133
133
|
Funlog.instance.fancyinfo_start("开始合并到#{release_branch}分支")
|
134
134
|
if !coding_branch.eql?(release_branch)
|
135
135
|
coding_branch_commit_id = git!(%W(-C #{current_project_dir} rev-parse #{coding_branch})).strip
|
136
|
-
release_branch_commit_id =
|
136
|
+
release_branch_commit_id = nil
|
137
137
|
|
138
138
|
if remote_branch_exists?(local_repo_dir: current_project_dir, branch: release_branch)
|
139
139
|
Funlog.instance.fancyinfo_update("存在#{release_branch}远程分支")
|
@@ -141,7 +141,6 @@ module Pindo
|
|
141
141
|
Funlog.instance.fancyinfo_update("存在#{release_branch}本地分支")
|
142
142
|
git!(%W(-C #{current_project_dir} checkout #{release_branch}))
|
143
143
|
else
|
144
|
-
Funlog.instance.fancyinfo_update("存在#{release_branch}远程分支")
|
145
144
|
Funlog.instance.fancyinfo_update("不存在#{release_branch}本地分支")
|
146
145
|
git!(%W(-C #{current_project_dir} checkout -b #{release_branch} origin/#{release_branch}))
|
147
146
|
end
|
@@ -150,8 +149,10 @@ module Pindo
|
|
150
149
|
git!(%W(-C #{current_project_dir} fetch origin #{release_branch}))
|
151
150
|
git!(%W(-C #{current_project_dir} merge origin/#{release_branch}))
|
152
151
|
|
153
|
-
|
152
|
+
# 执行合并操作,捕获输出以便后续检查冲突
|
153
|
+
stdout, exit_status = Executable.capture_command('git', %W(-C #{current_project_dir} merge #{coding_branch}), :capture => :out)
|
154
154
|
|
155
|
+
# 检查是否有冲突(git merge 在有冲突时返回非0状态)
|
155
156
|
conflict_filelist = git!(%W(-C #{current_project_dir} diff --name-only --diff-filter=U --relative))
|
156
157
|
if !conflict_filelist.nil? && conflict_filelist.size > 0
|
157
158
|
puts "合并代码冲突, 冲突文件如下:"
|
@@ -159,7 +160,14 @@ module Pindo
|
|
159
160
|
else
|
160
161
|
git!(%W(-C #{current_project_dir} push))
|
161
162
|
Funlog.instance.fancyinfo_success("代码已经合并到#{release_branch}分支")
|
162
|
-
|
163
|
+
# 获取 release_branch 的 commit ID(处理空分支情况)
|
164
|
+
begin
|
165
|
+
release_branch_commit_id = git!(%W(-C #{current_project_dir} rev-parse #{release_branch})).strip
|
166
|
+
rescue => e
|
167
|
+
# 分支可能存在但没有提交(空分支),此时使用 coding_branch 的 commit
|
168
|
+
Funlog.instance.fancyinfo_update("#{release_branch}分支为空或获取commit失败,将使用当前分支commit")
|
169
|
+
release_branch_commit_id = coding_branch_commit_id
|
170
|
+
end
|
163
171
|
end
|
164
172
|
|
165
173
|
else
|
@@ -180,14 +188,22 @@ module Pindo
|
|
180
188
|
git!(%W(-C #{current_project_dir} branch --set-upstream-to=origin/#{release_branch} #{release_branch}))
|
181
189
|
|
182
190
|
Funlog.instance.fancyinfo_success("代码已经合并到#{release_branch}分支")
|
183
|
-
|
191
|
+
# 获取 release_branch 的 commit ID(处理空分支情况)
|
192
|
+
begin
|
193
|
+
release_branch_commit_id = git!(%W(-C #{current_project_dir} rev-parse #{release_branch})).strip
|
194
|
+
rescue => e
|
195
|
+
# 新创建的分支,commit ID 应该与 coding_branch 相同
|
196
|
+
release_branch_commit_id = coding_branch_commit_id
|
197
|
+
end
|
184
198
|
end
|
185
199
|
|
186
200
|
git!(%W(-C #{current_project_dir} checkout #{coding_branch}))
|
187
|
-
if !release_branch_commit_id.eql?(coding_branch_commit_id)
|
201
|
+
if release_branch_commit_id && !release_branch_commit_id.eql?(coding_branch_commit_id)
|
188
202
|
git!(%W(-C #{current_project_dir} merge #{release_branch}))
|
189
203
|
Funlog.instance.fancyinfo_success("已将#{release_branch}合并到#{coding_branch}")
|
190
204
|
end
|
205
|
+
git!(%W(-C #{current_project_dir} push origin #{coding_branch}))
|
206
|
+
Funlog.instance.fancyinfo_success("已推送#{coding_branch}分支到远程")
|
191
207
|
else
|
192
208
|
Funlog.instance.fancyinfo_success("代码处于#{coding_branch}分支,无需合并")
|
193
209
|
end
|
@@ -138,7 +138,7 @@ module Pindo
|
|
138
138
|
latest_tag = get_latest_version_tag(project_dir: current_git_root_path)
|
139
139
|
|
140
140
|
unless is_tag_at_head?(git_root_dir: current_git_root_path, tag_name: latest_tag)
|
141
|
-
if auto_mode
|
141
|
+
if auto_mode
|
142
142
|
# 在自动化模式或没有交互式终端时,默认选择新增版本号打新Tag
|
143
143
|
puts "检测到当前代码没有打Tag,在自动模式下将自动新增版本号并打新Tag"
|
144
144
|
tag_action_parms = []
|
data/lib/pindo/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pindo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.5.
|
4
|
+
version: 5.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- wade
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: claide
|
@@ -115,20 +115,20 @@ dependencies:
|
|
115
115
|
requirements:
|
116
116
|
- - "~>"
|
117
117
|
- !ruby/object:Gem::Version
|
118
|
-
version: 0.
|
118
|
+
version: 1.0.0
|
119
119
|
- - ">="
|
120
120
|
- !ruby/object:Gem::Version
|
121
|
-
version: 0.
|
121
|
+
version: 1.0.0
|
122
122
|
type: :runtime
|
123
123
|
prerelease: false
|
124
124
|
version_requirements: !ruby/object:Gem::Requirement
|
125
125
|
requirements:
|
126
126
|
- - "~>"
|
127
127
|
- !ruby/object:Gem::Version
|
128
|
-
version: 0.
|
128
|
+
version: 1.0.0
|
129
129
|
- - ">="
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 0.
|
131
|
+
version: 1.0.0
|
132
132
|
- !ruby/object:Gem::Dependency
|
133
133
|
name: rqrcode
|
134
134
|
requirement: !ruby/object:Gem::Requirement
|
@@ -475,7 +475,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
475
475
|
- !ruby/object:Gem::Version
|
476
476
|
version: '0'
|
477
477
|
requirements: []
|
478
|
-
rubygems_version: 3.6.
|
478
|
+
rubygems_version: 3.6.9
|
479
479
|
specification_version: 3
|
480
480
|
summary: easy work
|
481
481
|
test_files: []
|