esr-rim 1.2.1 → 1.2.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.
- data/CHANGELOG +5 -0
- data/lib/rim/sync_helper.rb +3 -8
- data/lib/rim/version.rb +1 -1
- data/test/sync_helper_test.rb +42 -0
- metadata +2 -2
data/CHANGELOG
CHANGED
data/lib/rim/sync_helper.rb
CHANGED
@@ -41,14 +41,9 @@ class SyncHelper < CommandHelper
|
|
41
41
|
remote_url = "file://" + @ws_root
|
42
42
|
tmpdir = clone_or_fetch_repository(remote_url, module_tmp_git_path(".ws"), "Cloning workspace git...")
|
43
43
|
RIM::git_session(tmpdir) do |tmp_session|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
else
|
48
|
-
tmp_session.execute("git reset --hard")
|
49
|
-
tmp_session.execute("git clean -xdf")
|
50
|
-
tmp_session.execute("git checkout #{rim_branch}")
|
51
|
-
end
|
44
|
+
tmp_session.execute("git reset --hard")
|
45
|
+
tmp_session.execute("git clean -xdf")
|
46
|
+
tmp_session.execute("git checkout -B #{rim_branch} remotes/origin/#{rim_branch}")
|
52
47
|
changed_modules = sync_modules(tmp_session, message)
|
53
48
|
if !split
|
54
49
|
tmp_session.execute("git reset --soft #{branch_sha1}")
|
data/lib/rim/version.rb
CHANGED
data/test/sync_helper_test.rb
CHANGED
@@ -138,6 +138,48 @@ class SyncHelperTest < Minitest::Test
|
|
138
138
|
end
|
139
139
|
end
|
140
140
|
|
141
|
+
def test_sync_on_different_branches
|
142
|
+
mod1_info = create_module_git("mod1")
|
143
|
+
create_ws_git("testbr")
|
144
|
+
cut = RIM::SyncHelper.new(@ws_dir, @logger, [mod1_info])
|
145
|
+
cut.sync
|
146
|
+
remote_path = path_from_module_info(mod1_info)
|
147
|
+
RIM::git_session(remote_path) do |s|
|
148
|
+
FileUtils.mv(File.join(remote_path, "readme.txt"), File.join(remote_path, "readme.tx_"))
|
149
|
+
s.execute("git add --all .")
|
150
|
+
s.execute("git commit -m \"Temporary change of filename within mod1\"")
|
151
|
+
FileUtils.mv(File.join(remote_path, "readme.tx_"), File.join(remote_path, "Readme.txt"))
|
152
|
+
s.execute("git add --all .")
|
153
|
+
s.execute("git commit -m \"Changed case in filename within mod1\"")
|
154
|
+
end
|
155
|
+
RIM::git_session(@ws_dir) do |s|
|
156
|
+
s.execute("git checkout -b branch2")
|
157
|
+
end
|
158
|
+
cut.sync
|
159
|
+
RIM::git_session(@ws_dir) do |s|
|
160
|
+
s.execute("git rebase rim/branch2")
|
161
|
+
out = s.execute("git show --name-only")
|
162
|
+
assert out.include?("Readme.txt")
|
163
|
+
end
|
164
|
+
RIM::git_session(remote_path) do |s|
|
165
|
+
`echo ' changed' >> #{File.join(remote_path, "Readme.txt")}`
|
166
|
+
s.execute("git commit . -m \"Changed module file\"")
|
167
|
+
end
|
168
|
+
cut.sync
|
169
|
+
RIM::git_session(@ws_dir) do |s|
|
170
|
+
s.execute("git rebase rim/branch2")
|
171
|
+
s.execute("git checkout testbr")
|
172
|
+
s.execute("git reset --hard branch2~1")
|
173
|
+
s.execute("git push origin branch2:branch2")
|
174
|
+
end
|
175
|
+
cut.sync
|
176
|
+
RIM::git_session(@ws_dir) do |s|
|
177
|
+
s.execute("git reset --hard rim/testbr")
|
178
|
+
out = s.execute("git show --name-only")
|
179
|
+
assert out.include?("Readme.txt")
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
141
183
|
private
|
142
184
|
def create_ws_git(branch = "master")
|
143
185
|
FileUtils.mkdir_p(@ws_remote_dir)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: esr-rim
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-11-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: subcommand
|