ebm 0.0.32 → 0.0.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/commands/pull.rb +43 -45
- data/lib/commands/status.rb +6 -8
- data/lib/info.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
data.tar.gz:
|
4
|
-
metadata.gz:
|
3
|
+
data.tar.gz: 992915ca9318b3a1771ac408a516e1aff08c4d3e
|
4
|
+
metadata.gz: 31e420ce369332e349abb147f778cdad71cbac14
|
5
5
|
SHA512:
|
6
|
-
data.tar.gz:
|
7
|
-
metadata.gz:
|
6
|
+
data.tar.gz: a8330e7c3981e410f9751f2a3ef24daaf410ec3c5d3c68490883899648a658ee1240f66562a22bc23ff6fb4d3fe78128c2b6dc90922e7904d2126b9dd84721fd
|
7
|
+
metadata.gz: 6c6d7bc01b509ae2c8e7e23c6058f18d55f108280f97346c798bbd23d3f0454209e3dd273f9d7761a9a4b85d414daf192c9a692174c408d948f015c2156c48cd
|
data/lib/commands/pull.rb
CHANGED
@@ -73,61 +73,59 @@ module Commands
|
|
73
73
|
merge_failed = false
|
74
74
|
repos = info[:repos]
|
75
75
|
repos.each do |repo|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
base_branch = repo[:base_branch]
|
76
|
+
repo_name = EbmSharedLib.get_repo_name(repo[:git_path])
|
77
|
+
repo_path = "#{top_dir}/#{repo_name}"
|
78
|
+
branch = repo[:branch]
|
79
|
+
base_branch = repo[:base_branch]
|
81
80
|
|
82
|
-
|
81
|
+
puts("\n#{repo_name} pull:\n");
|
83
82
|
|
84
|
-
|
83
|
+
cmd = "git fetch #{dry_run} --all"
|
84
|
+
if EbmSharedLib::CL.do_cmd_result(cmd, repo_path) != 0
|
85
|
+
raise "Git fetch failed for #{repo_name}."
|
86
|
+
end
|
87
|
+
|
88
|
+
if tag
|
89
|
+
# use git checkout to force changes from either tag or branch
|
90
|
+
cmd = "git checkout -f refs/tags/#{tag}"
|
85
91
|
if EbmSharedLib::CL.do_cmd_result(cmd, repo_path) != 0
|
86
|
-
raise "Git
|
92
|
+
raise "Git checkout failed for #{repo_name}."
|
87
93
|
end
|
88
|
-
|
89
|
-
if
|
90
|
-
#
|
91
|
-
cmd = "git
|
92
|
-
|
93
|
-
|
94
|
+
elsif repo[:create_dev_branch]
|
95
|
+
if remote_version
|
96
|
+
# pulling from remote version branch
|
97
|
+
cmd = "git pull #{dry_run} --no-edit --recurse-submodules=yes origin #{branch}"
|
98
|
+
elsif base_version
|
99
|
+
# pulling from base remote version branch
|
100
|
+
if base_branch.nil?
|
101
|
+
raise "You specified base-version but the config has no base_branch."
|
94
102
|
end
|
103
|
+
cmd = "git pull #{dry_run} --no-edit --recurse-submodules=yes origin #{base_branch}"
|
95
104
|
else
|
96
|
-
|
97
|
-
|
98
|
-
cmd = "git pull #{dry_run} --no-edit --recurse-submodules=yes origin #{branch}"
|
99
|
-
elsif base_version
|
100
|
-
# pulling from base remote version branch
|
101
|
-
if base_branch.nil?
|
102
|
-
raise "You specified base-version but the config has no base_branch."
|
103
|
-
end
|
104
|
-
cmd = "git pull #{dry_run} --no-edit --recurse-submodules=yes origin #{base_branch}"
|
105
|
-
else
|
106
|
-
# pull from the remote branch of the current branch
|
107
|
-
cmd = "git pull #{dry_run} --no-edit --recurse-submodules=yes"
|
108
|
-
end
|
109
|
-
|
110
|
-
exit_code = EbmSharedLib::CL.do_cmd_ignore_str(cmd, "Automatic merge failed", repo_path)
|
111
|
-
if exit_code != 0 && exit_code != 999
|
112
|
-
raise "Git pull failed for #{repo_name}."
|
113
|
-
end
|
114
|
-
if exit_code == 999
|
115
|
-
merge_failed = true
|
116
|
-
end
|
105
|
+
# pull from the remote branch of the current branch
|
106
|
+
cmd = "git pull #{dry_run} --no-edit --recurse-submodules=yes"
|
117
107
|
end
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
if dry_run.empty?
|
123
|
-
cmd = "git submodule update"
|
124
|
-
else
|
125
|
-
cmd = "git submodule update --no-fetch"
|
108
|
+
|
109
|
+
exit_code = EbmSharedLib::CL.do_cmd_ignore_str(cmd, "Automatic merge failed", repo_path)
|
110
|
+
if exit_code != 0 && exit_code != 999
|
111
|
+
raise "Git pull failed for #{repo_name}."
|
126
112
|
end
|
127
|
-
if
|
128
|
-
|
113
|
+
if exit_code == 999
|
114
|
+
merge_failed = true
|
129
115
|
end
|
116
|
+
end
|
130
117
|
|
118
|
+
cmd = "git submodule sync"
|
119
|
+
if EbmSharedLib::CL.do_cmd_result(cmd, repo_path) != 0
|
120
|
+
raise "Submodule sync for #{repo_name} failed."
|
121
|
+
end
|
122
|
+
if dry_run.empty?
|
123
|
+
cmd = "git submodule update"
|
124
|
+
else
|
125
|
+
cmd = "git submodule update --no-fetch"
|
126
|
+
end
|
127
|
+
if EbmSharedLib::CL.do_cmd_result(cmd, repo_path) != 0
|
128
|
+
raise "Updating submodules for #{repo_name} failed."
|
131
129
|
end
|
132
130
|
|
133
131
|
end
|
data/lib/commands/status.rb
CHANGED
@@ -41,14 +41,12 @@ module Commands
|
|
41
41
|
|
42
42
|
repos = info[:repos]
|
43
43
|
repos.each do |repo|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
raise "Git status failed for #{repo_name}. Make sure you run the command from within a top level repo directory."
|
51
|
-
end
|
44
|
+
repo_name = EbmSharedLib.get_repo_name(repo[:git_path])
|
45
|
+
repo_path = "#{top_dir}/#{repo_name}"
|
46
|
+
puts("\n#{repo_name} status:\n");
|
47
|
+
cmd = "git status"
|
48
|
+
if EbmSharedLib::CL.do_cmd_result(cmd, repo_path) != 0
|
49
|
+
raise "Git status failed for #{repo_name}. Make sure you run the command from within a top level repo directory."
|
52
50
|
end
|
53
51
|
end
|
54
52
|
|
data/lib/info.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ebm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.33
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Seitz
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-10-16 00:00:00 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: subcommand
|