kookeeper 3.0.5 → 3.0.8

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: 7718447d06913c05171af6d4ec81c0953c3d4d9e887459c985bc3ee9771dce7e
4
- data.tar.gz: ac5205ec448541b9f18a290cf45d23bc040d9d0e541c8688b748d8b37382f76b
3
+ metadata.gz: dd6c22dfb14b333e9e1e2d3ba129cfb6a5d5cd68b0e2f1f760576131cd34e75e
4
+ data.tar.gz: ed7ae0bc9bd3146ac128c523a5de31df19a30ef51e4aa5e40964c1d987163c99
5
5
  SHA512:
6
- metadata.gz: c76b56a8b141755cc2c50ad3a4932514d4eeec66149cfbf8a2829b8480cdb0a5ae873531b96aaae193098e0678efe714beb62a2ff16dc561f6332f076a7c16c6
7
- data.tar.gz: 751772b95fb8e95f95ac6ffca60209846abac3a7fe9df09ee3f0cc611e45ed68c0623f47fe23caefc119b6ae402592986cf7f609ab90acf23a8c8a49ea61f382
6
+ metadata.gz: 9f4aca38e2e35f715f1f07ff6e602228e757b304e8dfd601e69baceb237a9aa5188c51b48a48f48e8d7f999fac9b77b9331a2dc681922496ca23e6428f612486
7
+ data.tar.gz: 131e6fc9c0b074b37d61b9a511efce1e2cc8ff18422081e0c14c7add3c203b42c20973769857f183f6e0542b4ce130068286445d6dffdeec4e1b18d5da53d5f9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kookeeper (3.0.5)
4
+ kookeeper (3.0.8)
5
5
  big_resources
6
6
  big_stash (~> 0.1)
7
7
  cocoapods
@@ -19,7 +19,8 @@ module BigKeeper
19
19
  # Parse Bigkeeper file
20
20
  BigkeeperParser.parse("#{path}/Bigkeeper")
21
21
 
22
- branch_name = GitOperator.new.current_branch(path)
22
+ home_branch_name = GitOperator.new.current_branch(path)
23
+ branch_name = ModuleCacheOperator.new(path).branch_name
23
24
  Logger.error("Not a #{GitflowType.name(type)} branch, exit.") unless branch_name.include? GitflowType.name(type)
24
25
 
25
26
  # Cache git modules
@@ -38,7 +39,7 @@ module BigKeeper
38
39
  Logger.highlight("Finish branch '#{branch_name}' for 'Home'")
39
40
 
40
41
  # Delete all path modules
41
- ModuleCacheOperator.new(path).cache_path_modules([], [], [])
42
+ # ModuleCacheOperator.new(path).cache_path_modules([], [], [])
42
43
 
43
44
  # Install
44
45
  DepService.dep_operator(path, user).install(false)
@@ -47,7 +48,7 @@ module BigKeeper
47
48
  DepService.dep_operator(path, user).open
48
49
 
49
50
  # Push home changes to remote
50
- GitService.new.verify_push(path, "finish branch #{branch_name}", branch_name, 'Home')
51
+ GitService.new.verify_push(path, "finish branch #{home_branch_name}", home_branch_name, 'Home')
51
52
  ensure
52
53
  end
53
54
  end
@@ -17,7 +17,7 @@ require 'big_keeper/service/module_service'
17
17
 
18
18
 
19
19
  module BigKeeper
20
- def self.start(path, version, user, name, modules, type)
20
+ def self.start(path, version, user, modules, type)
21
21
  begin
22
22
  # Parse Bigkeeper file
23
23
  p "----------1.开始解析#{path}/Bigkeeper"
@@ -26,15 +26,20 @@ module BigKeeper
26
26
  version = BigkeeperParser.version if version == 'Version in Bigkeeper file'
27
27
 
28
28
  p "----------2.version:#{version}"
29
- full_name = "#{version}_#{user}_#{name}"
29
+
30
+ full_name = "#{version}"
31
+ #full_name = "#{version}_#{user}_#{name}"
30
32
  p "----------3.full_name:#{full_name}"
31
33
  branch_name = "#{GitflowType.name(type)}/#{full_name}"
32
34
  p "----------4.branch_name:#{branch_name}"
35
+
36
+ ModuleCacheOperator.new(path).cache_branch_name(branch_name)
33
37
  home_branch_name = "release/#{version}"
34
38
  p "----------5.home_branch_name:#{home_branch_name}"
35
39
  p "----------6.path:#{path}"
36
40
  p "----------7.1验证home_branch"
37
- GitService.new.verify_home_branch(path, branch_name, OperateType::START)
41
+ GitService.new.verify_home_branch(path, home_branch_name, OperateType::START)
42
+ #GitService.new.verify_home_branch(path, branch_name, OperateType::START)
38
43
 
39
44
  stash_modules = ModuleCacheOperator.new(path).all_path_modules
40
45
  p "----------8.stash_modules:#{stash_modules}"
@@ -57,31 +62,31 @@ module BigKeeper
57
62
  ModuleCacheOperator.new(path).clean_modules
58
63
 
59
64
  # Cache all path modules
60
- p "----------Cache all path modules"
65
+ p "----------12.Cache all path modules"
61
66
  ModuleCacheOperator.new(path).cache_path_modules(modules, modules, [])
62
67
  modules = ModuleCacheOperator.new(path).remain_path_modules
63
- p "----------Backup home"
68
+ p "----------13.Backup home"
64
69
  # Backup home
65
70
  DepService.dep_operator(path, user).backup
66
71
 
67
- p "----------Start modules feature and modify module as path"
72
+ p "----------14.为模块建立分支并将podfile中地址切换到本地"
68
73
  # Start modules feature and modify module as path
69
74
  modules.each do |module_name|
70
75
  ModuleService.new.add(path, user, module_name, full_name, type)
71
76
  end
72
- p "----------install"
77
+ p "----------15.pod update"
73
78
  # install
74
79
  DepService.dep_operator(path, user).install(false )
75
- p "----------Open home workspace"
80
+ p "----------16.打开 workspace"
76
81
  # Open home workspace
77
82
  DepService.dep_operator(path, user).open
78
- p "----------Push home changes to remote"
83
+ p "----------17.Push home changes to remote"
79
84
  # Push home changes to remote
80
85
  Logger.highlight("Push branch release/#{version} for 'Home'...")
81
86
  GitService.new.verify_push(
82
87
  path,
83
- "init #{GitflowType.name(type)} #{full_name}",
84
- branch_name,
88
+ "start branch #{home_branch_name}",
89
+ home_branch_name,
85
90
  'Home')
86
91
  ensure
87
92
  end
@@ -10,34 +10,36 @@ module BigKeeper
10
10
  def self.switch_to(path, version, user, full_name, type)
11
11
  begin
12
12
  # Parse Bigkeeper file
13
+ p "1.switch_to #{version} 解析Bigkeeper"
13
14
  BigkeeperParser.parse("#{path}/Bigkeeper")
14
15
 
15
16
  version = BigkeeperParser.version if version == 'Version in Bigkeeper file'
16
17
  branch_name = "#{GitflowType.name(type)}/#{full_name}"
17
-
18
- GitService.new.verify_home_branch(path, branch_name, OperateType::SWITCH)
18
+ ModuleCacheOperator.new(path).cache_branch_name(branch_name)
19
+ home_branch_name = "release/#{full_name}"
20
+ GitService.new.verify_home_branch(path, home_branch_name, OperateType::SWITCH)
19
21
 
20
22
  stash_modules = ModuleCacheOperator.new(path).all_path_modules
21
-
23
+ p "2.switch_to 暂存所有"
22
24
  # Stash current branch
23
- StashService.new.stash_all(path, branch_name, user, stash_modules)
24
-
25
+ StashService.new.stash_all(path, branch_name, user, stash_modules,version)
26
+ p "3.switch_to checkout #{home_branch_name}"
25
27
  # Switch to new feature
26
- GitOperator.new.checkout(path, branch_name)
28
+ GitOperator.new.checkout(path, home_branch_name)
27
29
  GitOperator.new.pull(path)
28
-
30
+ p "4.switch_to"
29
31
  # Apply home stash
30
- StashService.new.pop_stash(path, branch_name, 'Home')
32
+ StashService.new.pop_stash(path, home_branch_name, 'Home')
31
33
 
32
34
  modules = ModuleCacheOperator.new(path).all_path_modules
33
35
 
34
36
  modules.each do |module_name|
35
37
  ModuleService.new.switch_to(path, user, module_name, branch_name, type)
36
38
  end
37
-
39
+ p "5.switch_to"
38
40
  # Install
39
41
  DepService.dep_operator(path, user).install(false)
40
-
42
+ p "6.switch_to"
41
43
  # Open home workspace
42
44
  DepService.dep_operator(path, user).open
43
45
  ensure
@@ -21,11 +21,11 @@ module BigKeeper
21
21
  begin
22
22
  # Parse Bigkeeper file
23
23
  BigkeeperParser.parse("#{path}/Bigkeeper")
24
- branch_name = GitOperator.new.current_branch(path)
25
-
24
+ home_branch_name = GitOperator.new.current_branch(path)
25
+ branch_name = ModuleCacheOperator.new(path).branch_name
26
26
  # Logger.error("Not a #{GitflowType.name(type)} branch, exit.") unless branch_name.include? GitflowType.name(type)
27
27
 
28
- Logger.error("Not a #{GitflowType.name(GitflowType::RELEASE)} branch, exit.") unless branch_name.include? GitflowType.name(GitflowType::RELEASE)
28
+ # Logger.error("Not a #{GitflowType.name(GitflowType::RELEASE)} branch, exit.") unless branch_name.include? GitflowType.name(GitflowType::RELEASE)
29
29
 
30
30
 
31
31
  full_name = branch_name.gsub(/#{GitflowType.name(type)}\//, '')
@@ -65,6 +65,9 @@ module BigKeeper
65
65
 
66
66
  # Open home workspace
67
67
  DepService.dep_operator(path, user).open
68
+
69
+ # Push home changes to remote
70
+ GitService.new.verify_push(path, "update branch #{home_branch_name}", home_branch_name, 'Home')
68
71
  ensure
69
72
  end
70
73
  end
@@ -24,9 +24,11 @@ module BigKeeper
24
24
 
25
25
  help_now!('user name is required') if user and user.empty?
26
26
  help_now!("#{GitflowType.name(type)} name is required") if args.length < 1
27
- name = args[0]
28
- modules = args[(1...args.length)] if args.length > 1
29
- start(path, version, user, name, modules, type)
27
+ #name = args[0]
28
+ #modules = args[(1...args.length)] if args.length > 1
29
+ modules = args[(0...args.length)] if args.length > 0
30
+ #start(path, version, user, name, modules, type)
31
+ start(path, version, user, modules, type)
30
32
  end
31
33
  end
32
34
 
@@ -58,7 +58,8 @@ module BigKeeper
58
58
  end
59
59
  elsif ModuleOperateType::FINISH == module_operate_type
60
60
  module_git = BigkeeperParser.module_git(module_name)
61
- branch_name = GitOperator.new.current_branch(@path)
61
+ #branch_name = GitOperator.new.current_branch(@path)
62
+ branch_name = ModuleCacheOperator.new(@path).branch_name
62
63
  "#{$1}pod '#{module_name}', :git => '#{module_git}', :branch => '#{branch_name}'"
63
64
  elsif ModuleOperateType::PUBLISH == module_operate_type
64
65
  module_git = BigkeeperParser.module_git(module_name)
@@ -9,12 +9,12 @@ module BigKeeper
9
9
  class GitService
10
10
 
11
11
  def startHome(path, name, type)
12
- p "----------startHome"
12
+ p "--------------------11.1.startHome"
13
13
  git = GitOperator.new
14
14
  branch_name = "#{GitflowType.name(type)}/#{name}"
15
- p "----------branch_name:#{branch_name}"
15
+ p "--------------------11.2branch_name:#{branch_name}"
16
16
  if !git.has_remote_branch(path, branch_name) && !git.has_local_branch(path, branch_name)
17
- p "----------如果远程和本地没有#{branch_name}分支"
17
+ p "------------------------------11.2.1如果远程和本地没有#{branch_name}分支"
18
18
  verify_special_branch(path, 'master')
19
19
 
20
20
 
@@ -25,7 +25,7 @@ module BigKeeper
25
25
  #GitflowOperator.new.start(path, name, type)
26
26
  #
27
27
  Dir.chdir(path) do
28
- p "git checkout -b #{branch_name}"
28
+ p "------------------------------11.2.2git checkout -b #{branch_name}"
29
29
  `git checkout -b #{branch_name}`
30
30
  end
31
31
  git.push_to_remote(path, branch_name)
@@ -33,7 +33,7 @@ module BigKeeper
33
33
  verify_checkout(path, branch_name)
34
34
 
35
35
  if !git.has_remote_branch(path, branch_name)
36
- p "如果远程没有 #{branch_name}"
36
+ p "------------------------------11.3.1如果远程没有 #{branch_name}"
37
37
  git.push_to_remote(path, branch_name)
38
38
  end
39
39
  end
@@ -49,9 +49,9 @@ module BigKeeper
49
49
  verify_special_branch(path, 'master')
50
50
  #verify_special_branch(path, 'develop')
51
51
 
52
- GitflowOperator.new.verify_git_flow(path)
52
+ #GitflowOperator.new.verify_git_flow(path)
53
53
 
54
- GitflowOperator.new.start(path, name, type)
54
+ #GitflowOperator.new.start(path, name, type)
55
55
 
56
56
  verify_checkout(path, branch_name)
57
57
  git.push_to_remote(path, branch_name)
@@ -65,14 +65,15 @@ module BigKeeper
65
65
  end
66
66
 
67
67
  def verify_checkout(path, branch_name)
68
+ p "++++++++++verify_checkout:#{path} #{branch_name}"
68
69
  Dir.chdir(path) do
69
- p "----------cd:#{path}"
70
+ p "++++++++++cd:#{path}"
70
71
  cmd = "git checkout -b #{branch_name}"
71
72
  if GitOperator.new.has_branch(path, branch_name)
72
- p "有#{branch_name}"
73
+ p "++++++++++有#{branch_name}"
73
74
  cmd = "git checkout #{branch_name}"
74
75
  end
75
- p "cmd:#{cmd}"
76
+ p "++++++++++cmd:#{cmd}"
76
77
  IO.popen(cmd) do |io|
77
78
  io.each do |line|
78
79
  Logger.error("Checkout #{branch_name} failed.") if line.include? 'error'
@@ -34,10 +34,14 @@ module BigKeeper
34
34
  @modules = JSON.load(file.read())
35
35
  file.close
36
36
  else
37
- @modules = {"git" => {"all" => [], "current" => []}, "path" => {"all" => [], "add" => [], "del" => [], "current" => []}}
37
+ @modules = {"git" => {"all" => [], "current" => []}, "path" => {"all" => [], "add" => [], "del" => [], "current" => []},"branch_name" => ""}
38
38
  end
39
39
  end
40
40
 
41
+ def branch_name
42
+ @modules["branch_name"]
43
+ end
44
+
41
45
  def all_path_modules
42
46
  @modules["path"]["all"]
43
47
  end
@@ -70,6 +74,13 @@ module BigKeeper
70
74
  @modules["git"]["all"] - @modules["git"]["current"]
71
75
  end
72
76
 
77
+
78
+ def cache_branch_name(branch_name)
79
+ @modules["branch_name"] = branch_name
80
+ cache_modules
81
+ end
82
+
83
+
73
84
  def cache_path_modules(modules, add_modules, del_modules)
74
85
  @modules["path"]["all"] = modules.uniq
75
86
  @modules["path"]["add"] = add_modules.uniq
@@ -103,7 +114,8 @@ module BigKeeper
103
114
  end
104
115
 
105
116
  def clean_modules
106
- @modules = {"git" => {"all" => [], "current" => []}, "path" => {"all" => [], "add" => [], "del" => [], "current" => []}}
117
+ branch_name = @modules["branch_name"]
118
+ @modules = {"git" => {"all" => [], "current" => []}, "path" => {"all" => [], "add" => [], "del" => [], "current" => []},"branch_name" => branch_name}
107
119
  cache_modules
108
120
  end
109
121
 
@@ -1,3 +1,3 @@
1
1
  module BigKeeper
2
- VERSION = "3.0.5"
2
+ VERSION = "3.0.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kookeeper
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.5
4
+ version: 3.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - mmoaay
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-12 00:00:00.000000000 Z
11
+ date: 2022-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli