bigkeeper 0.9.13 → 0.9.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e751a206b1442e0848d2b6dfacc760f5d656bfc17b1274841a2091a62e6514b
4
- data.tar.gz: 22fc192c12e254bf5d449f7681d49bf0b10cf68774b209f2be04c3af95cd55ce
3
+ metadata.gz: 8cae335c4028f88931e908c5e06e46be79e64ff6c18940ddec9be8da644a696c
4
+ data.tar.gz: 7afc0960f5701b2119235863982fc9bbc86468c621062df8c2b6af3c1ebe3810
5
5
  SHA512:
6
- metadata.gz: da2b7fdf30d1c5e1f196b9c63b73c393c2816ac9a53c60479333d9168d8adce26406083f10a12788365ff7b6dcec89e23d06bbc9bac9a23662f05917af7801f5
7
- data.tar.gz: 3f8171e5002173aac2cc02b53eff96d388019f958b8b55d11bd596b490e455df4143eb281c4e65319f0622bfb120987915d5365084631bb0826078414c3b1579
6
+ metadata.gz: 93726a66acd35be37a9552c3c5b47edb41a67cc354289addd3bd5dc28e3b17c9a8d876e49a01c439b9c0adf44c13d0323294a467e85da55b1470aa3ac9b6b69f
7
+ data.tar.gz: f9c36337abf07d8c51289d174010e0faee47e67219d7ee0b1374a2b7da9a48c274011ca11ff1866734c991ca749bab2d308d234aa1e821911115c4264d34e06e
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bigkeeper (0.9.12)
4
+ bigkeeper (0.9.13)
5
5
  big_resources
6
6
  big_stash (~> 0.1)
7
7
  cocoapods
data/bin/big CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- #require "bundler/setup"
3
+ # require "bundler/setup"
4
4
  require "big_keeper"
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
@@ -25,20 +25,21 @@ module BigKeeper
25
25
 
26
26
  full_name = branch_name.gsub(/#{GitflowType.name(type)}\//, '')
27
27
 
28
- current_modules = ModuleCacheOperator.new(path).current_path_modules
29
-
30
28
  # Verify input modules
31
29
  modules = BigkeeperParser.verify_modules(modules)
32
30
 
33
- Logger.highlight("Start to update modules for branch '#{branch_name}'...")
31
+ current_modules = ModuleCacheOperator.new(path).current_path_modules
32
+
33
+ ModuleCacheOperator.new(path).clean_modules
34
+ ModuleCacheOperator.new(path).cache_path_modules(current_modules + modules, modules, [])
34
35
 
35
- add_modules = modules - current_modules
36
-
37
- if add_modules.empty?
36
+ Logger.highlight("Start to add modules for branch '#{branch_name}'...")
37
+
38
+ if modules.empty?
38
39
  Logger.default("There is nothing changed with modules #{modules}.")
39
40
  else
40
41
  # Modify podfile as path and Start modules feature
41
- add_modules.each do |module_name|
42
+ modules.each do |module_name|
42
43
  ModuleCacheOperator.new(path).add_path_module(module_name)
43
44
  ModuleService.new.add(path, user, module_name, full_name, type)
44
45
  end
@@ -64,7 +65,10 @@ module BigKeeper
64
65
  # Verify input modules
65
66
  modules = BigkeeperParser.verify_modules(modules)
66
67
 
67
- Logger.highlight("Start to update modules for branch '#{branch_name}'...")
68
+ ModuleCacheOperator.new(path).clean_modules
69
+ ModuleCacheOperator.new(path).cache_path_modules(current_module + modules, [], modules)
70
+
71
+ Logger.highlight("Start to delete modules for branch '#{branch_name}'...")
68
72
 
69
73
  if modules.empty?
70
74
  Logger.default("There is nothing changed with modules #{modules}.")
@@ -150,7 +150,7 @@ module BigKeeper
150
150
  GitOperator.new.check_diff(path, "develop", "master")
151
151
 
152
152
  #checkout release branch
153
- Logger.highlight(%Q(Start to checkout Branch release/#{version}))
153
+ Logger.highlight(%Q(Start to checkout Home Branch release/#{version}))
154
154
 
155
155
  GitService.new.verify_checkout(path, "release/#{version}")
156
156
 
@@ -161,14 +161,13 @@ module BigKeeper
161
161
  modules.each do |module_name|
162
162
  Logger.highlight("release checkout release/#{version} for #{module_name}")
163
163
  module_full_path = BigkeeperParser.module_full_path(path, user, module_name)
164
- ModuleService.new.release_start(path, user, modules, module_name, version)
165
164
 
166
165
  if GitOperator.new.has_branch(module_full_path, "release/#{version}")
166
+ Logger.highlight("#{module_name} has release/#{version}")
167
167
  GitOperator.new.checkout(module_full_path, "release/#{version}")
168
168
  else
169
- GitflowOperator.new.start(path, version, GitflowType::RELEASE)
170
- GitOperator.new.push_to_remote(path, "release/#{version}")
171
-
169
+ Logger.highlight("#{module_name} dont have release/#{version}")
170
+ ModuleService.new.release_start(path, user, modules, module_name, version)
172
171
  Logger.highlight("Push branch release/'#{version}' for #{module_name}...")
173
172
  GitOperator.new.push_to_remote(module_full_path, "release/#{version}")
174
173
  end
@@ -169,7 +169,7 @@ module BigKeeper
169
169
  git.push_to_remote(path, branch_name)
170
170
  end
171
171
 
172
- GitOperator.new.check_push_success(path, branch_name, "origin/#{branch_name}")
172
+ GitOperator.new.check_push_success(path, branch_name, "#{GitOperator.remote_local_name(path)}/#{branch_name}")
173
173
  else
174
174
  Logger.default("Nothing to push for '#{name}'.")
175
175
  end
@@ -51,13 +51,13 @@ module BigKeeper
51
51
 
52
52
  def fetch(path)
53
53
  Dir.chdir(path) do
54
- `git fetch origin`
54
+ `git fetch #{GitOperator.remote_local_name(path)}`
55
55
  end
56
56
  end
57
57
 
58
58
  def rebase(path, branch_name)
59
59
  Dir.chdir(path) do
60
- `git rebase origin/#{branch_name}`
60
+ `git rebase #{GitOperator.remote_local_name(path)}/#{branch_name}`
61
61
  end
62
62
  end
63
63
 
@@ -76,9 +76,9 @@ module BigKeeper
76
76
 
77
77
  def push_to_remote(path, branch_name)
78
78
  Dir.chdir(path) do
79
- `git push -u origin #{branch_name}`
79
+ `git push -u #{GitOperator.remote_local_name(path)} #{branch_name}`
80
80
  end
81
- GitOperator.new.check_push_success(path, branch_name, "origin/#{branch_name}")
81
+ GitOperator.new.check_push_success(path, branch_name, "#{GitOperator.remote_local_name(path)}/#{branch_name}")
82
82
  end
83
83
 
84
84
  def pull(path)
@@ -122,7 +122,7 @@ module BigKeeper
122
122
 
123
123
  def del_remote(path, branch_name)
124
124
  Dir.chdir(path) do
125
- `git push origin --delete #{branch_name}`
125
+ `git push #{GitOperator.remote_local_name(path)} --delete #{branch_name}`
126
126
  end
127
127
  end
128
128
 
@@ -184,7 +184,7 @@ module BigKeeper
184
184
  def check_remote_branch_diff(path, branch, compare_branch)
185
185
  fetch(path)
186
186
  compare_branch_commits = Array.new
187
- IO.popen("cd '#{path}';git log --left-right #{branch}...origin/#{compare_branch} --pretty=oneline") do |io|
187
+ IO.popen("cd '#{path}';git log --left-right #{branch}...#{GitOperator.remote_local_name(path)}/#{compare_branch} --pretty=oneline") do |io|
188
188
  io.each do |line|
189
189
  compare_branch_commits.push(line) unless (line.include? '>') && (line.include? "Merge branch \'#{branch}\'")
190
190
  end
@@ -196,6 +196,17 @@ module BigKeeper
196
196
  end
197
197
  end
198
198
 
199
+ def self.remote_local_name(path)
200
+ Dir.chdir(path) do
201
+ IO.popen("git remote") do |io|
202
+ io.each do |line|
203
+ Logger.error("Check git remote setting.") if line.length == 0
204
+ return line.chomp
205
+ end
206
+ end
207
+ end
208
+ end
209
+
199
210
  # TODO: 需要改造,util方法不应该有业务逻辑
200
211
  def check_diff(path, branch, compare_branch)
201
212
  compare_branch_commits = Array.new
@@ -51,7 +51,7 @@ module BigKeeper
51
51
  branch_dic["is_remote"] = true
52
52
  end
53
53
 
54
- if home_branch_name =~ /^origin\//
54
+ if home_branch_name =~ /^#{GitOperator.remote_local_name(path)}\//
55
55
  home_branch_name = $~.post_match
56
56
  end
57
57
 
@@ -1,3 +1,3 @@
1
1
  module BigKeeper
2
- VERSION = "0.9.13"
2
+ VERSION = "0.9.14"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bigkeeper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.13
4
+ version: 0.9.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - mmoaay
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-29 00:00:00.000000000 Z
11
+ date: 2019-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli