esr-rim 1.3.6 → 1.3.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MWUzYjVhOGMyZDNmZWUwOGYwYmIxZjdhNjAzOWFmZWYxNGVmNTNiMA==
4
+ MTIwZTVjMGFiNmQ3YjdmNmJmY2NmYTVkMzk2ODY2YzBkMjEwZDQ5YQ==
5
5
  data.tar.gz: !binary |-
6
- NTk4MjAwMTExNWQ5ZDgzODVjOWIzYjFmZTk2YTVlNTc5MjZiZWUyOQ==
6
+ MmU3YmU2NTA2OGZmYzI1Yjg0Y2ExYWFjN2MwNGExYjIzMmY0ZWZhNw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDY2Y2NmNjEzZGNkMWQ1ZTViMTBlYjRiOWRmN2Q3NDc5YmI3ZjYzNTc1ZjZl
10
- MDcwOWVlNTJhNzI5MzVhYmI5ZWJjODhhZjFlYzIxNWIzMWZhZmE2M2I5ZDQ2
11
- OGE1NzY5MmI2N2JkZGVmOTVkNTQ3NmMwYmQxNzBhODQyMzNjYWM=
9
+ ZjViYzhkNTgxMDM2ZWZlMDAxM2IxZGYzOGVjZWFhODFmNGI3OGI3OTlmYjZl
10
+ YWQ2MTE2NGY3ZDBjMTRjOGQ1MjA0NmQ4NjhmODA4NWM0NTVkYzlmN2ZiNzk4
11
+ NmRiMDliMDFjZTMwMGNiNWIwODVkNjVjZGNlMzI3MTMyYzlkM2M=
12
12
  data.tar.gz: !binary |-
13
- OWNlNmUzYTk4Y2MyMGU2ZjYyODRmZTM3YTEzNGFjNjc4YjFkOTg4ZmZjMTVl
14
- MDFjOTAyODQwMzExMzA5NDcwZWQzNWUzZjQyOWMwYzk3NmYzOGJkZjRkMzAw
15
- ZGIyYWJlOGM4MmQwYjRjYzcxYTA3MjJkZTkyYmRmNmQ1ODhmYWM=
13
+ MGI3ODk5ZGEyYmJiZmVhMzE1ZmIxMTgyOGE0OTc5MjVkNWVjYzY4NTM0YjNh
14
+ M2JjZjExMzk1MzA2ODdhMWZlYjNkODU1NzM4Zjc3MTI1ZDBiNjllMTNmNWFl
15
+ NjE3ZWNlMTVhZWQ1NjBmZjUwMmZmYjg4OWVkNWQ1YzNlNzI3NDk=
data/CHANGELOG CHANGED
@@ -109,3 +109,9 @@
109
109
  * Normalize path set in RIM_HOME before using (fixes problems with backslash used in Windows).
110
110
  * Use SHA1 for shortened paths only if shorter than original path.
111
111
  * Set RIM_HOME to non-persistent path for unit tests.
112
+
113
+ # 1.3.7
114
+
115
+ * fixed Issue #18: rim can't sync commits containing ignored files
116
+
117
+
@@ -61,15 +61,14 @@ module RIM
61
61
  def needs_commit?(session)
62
62
  # do we need to commit something?
63
63
  stat = session.status(@module_info.local_path)
64
- ignored = stat.lines.select{ |l| l.ignored? }
64
+ # no files should be ignored due to --force option. Anyway we will check for ignored files
65
+ ignored = []
66
+ session.execute("git add --all --force #{@module_info.local_path}") do |out, e|
67
+ ignored = parse_ignored_files(session, out, e)
68
+ end
65
69
  if ignored.empty?
66
- session.execute("git add --all #{@module_info.local_path}") do |out, e|
67
- ignored = parse_ignored_files(session, out, e)
68
- end
69
- if ignored.empty?
70
- stat = session.status(@module_info.local_path)
71
- ignored = stat.lines.select{ |l| l.ignored? }
72
- end
70
+ stat = session.status(@module_info.local_path)
71
+ ignored = stat.lines.select{ |l| l.ignored? }
73
72
  end
74
73
  if !ignored.empty?
75
74
  messages = ["Sync failed due to files/dirs of #{@module_info.local_path} which are ignored by workspace's .gitignore:"]
data/lib/rim/version.rb CHANGED
@@ -2,7 +2,7 @@ module RIM
2
2
 
3
3
  module Version
4
4
 
5
- Version = "1.3.6"
5
+ Version = "1.3.7"
6
6
 
7
7
  end
8
8
 
@@ -18,20 +18,20 @@ class SyncModuleHelperTest < Minitest::Test
18
18
  @logger.level = Logger::ERROR unless ARGV.include? "debug"
19
19
  RIM::GitSession.logger = @logger
20
20
  test_dir = empty_test_dir("module_sync_helper_test")
21
- remote_git_dir = File.join(test_dir, "remote_git")
22
- @remote_git_dir = "file://" + remote_git_dir
23
- FileUtils.mkdir(remote_git_dir)
24
- RIM::git_session(remote_git_dir) do |s|
21
+ @remote_git_dir = File.join(test_dir, "remote_git")
22
+ @remote_git_dir_url = "file://" + @remote_git_dir
23
+ FileUtils.mkdir(@remote_git_dir)
24
+ RIM::git_session(@remote_git_dir) do |s|
25
25
  s.execute("git init")
26
26
  s.execute("git checkout -B testbr")
27
- write_file(remote_git_dir, "readme.txt")
27
+ write_file(@remote_git_dir, "readme.txt")
28
28
  s.execute("git add .")
29
29
  s.execute("git commit -m \"Initial commit\"")
30
30
  end
31
31
  @ws_dir = File.join(test_dir, "ws")
32
32
  FileUtils.mkdir(@ws_dir)
33
33
  RIM::git_session(@ws_dir) do |s|
34
- s.execute("git clone #{@remote_git_dir} .")
34
+ s.execute("git clone #{@remote_git_dir_url} .")
35
35
  end
36
36
  end
37
37
 
@@ -40,13 +40,43 @@ class SyncModuleHelperTest < Minitest::Test
40
40
  end
41
41
 
42
42
  def test_files_are_copied_to_working_dir
43
- info = RIM::ModuleInfo.new(@remote_git_dir, "test", "testbr")
43
+ info = RIM::ModuleInfo.new(@remote_git_dir_url, "test", "testbr")
44
44
  cut = RIM::SyncModuleHelper.new(@ws_dir, @ws_dir, info, @logger)
45
45
  cut.sync
46
46
  assert File.exists?(File.join(@ws_dir, "test/readme.txt"))
47
47
  assert File.exists?(File.join(@ws_dir, "test/.riminfo"))
48
48
  end
49
49
 
50
+ def test_files_ignored_by_gitignore_of_workspace_are_copied_to_working_dir
51
+ RIM::git_session(@remote_git_dir) do |s|
52
+ write_file(@remote_git_dir, 'ignored_file.txt')
53
+ s.execute("git add .")
54
+ s.execute("git commit -m \"Add a single file\"")
55
+ end
56
+ RIM::git_session(@ws_dir) do |s|
57
+ write_file(@ws_dir, '.gitignore', 'ignored*\n')
58
+ s.execute("git add .")
59
+ s.execute("git commit -m \"Ignore a single file\"")
60
+ end
61
+ info = RIM::ModuleInfo.new(@remote_git_dir_url, "test", "testbr")
62
+ cut = RIM::SyncModuleHelper.new(@ws_dir, @ws_dir, info, @logger)
63
+ cut.sync
64
+ assert File.exists?(File.join(@ws_dir, "test/readme.txt"))
65
+ assert File.exists?(File.join(@ws_dir, "test/.riminfo"))
66
+ assert File.exists?(File.join(@ws_dir, "test/ignored_file.txt"))
67
+ # Add a single ignored file afterwards and sync again
68
+ RIM::git_session(@remote_git_dir) do |s|
69
+ write_file(@remote_git_dir, 'ignored_file_2.txt')
70
+ s.execute("git add .")
71
+ s.execute("git commit -m \"Add a second ignored file\"")
72
+ end
73
+ cut.sync
74
+ assert File.exists?(File.join(@ws_dir, "test/readme.txt"))
75
+ assert File.exists?(File.join(@ws_dir, "test/.riminfo"))
76
+ assert File.exists?(File.join(@ws_dir, "test/ignored_file.txt"))
77
+ assert File.exists?(File.join(@ws_dir, "test/ignored_file_2.txt"))
78
+ end
79
+
50
80
  def test_files_of_ignore_list_are_not_removed_when_copying
51
81
  test_folder = File.join(@ws_dir, "test")
52
82
  write_file(test_folder, "file1")
@@ -54,7 +84,7 @@ class SyncModuleHelperTest < Minitest::Test
54
84
  write_file(File.join(test_folder, "folder"), "file1")
55
85
  write_file(File.join(test_folder, "folder"), "file2")
56
86
  write_file(File.join(test_folder, "folder2"), "file1")
57
- info = RIM::ModuleInfo.new(@remote_git_dir, "test", "testbr", "**/file2")
87
+ info = RIM::ModuleInfo.new(@remote_git_dir_url, "test", "testbr", "**/file2")
58
88
  cut = RIM::SyncModuleHelper.new(@ws_dir, @ws_dir, info, @logger)
59
89
  cut.sync
60
90
  assert File.exists?(File.join(test_folder, "readme.txt"))
@@ -67,7 +97,7 @@ class SyncModuleHelperTest < Minitest::Test
67
97
  end
68
98
 
69
99
  def test_commit_message_is_set_by_default
70
- info = RIM::ModuleInfo.new(@remote_git_dir, "test", "testbr")
100
+ info = RIM::ModuleInfo.new(@remote_git_dir_url, "test", "testbr")
71
101
  cut = RIM::SyncModuleHelper.new(@ws_dir, @ws_dir, info, @logger)
72
102
  cut.sync
73
103
  RIM::git_session(@ws_dir) do |s|
@@ -77,7 +107,7 @@ class SyncModuleHelperTest < Minitest::Test
77
107
  end
78
108
 
79
109
  def test_commit_message_can_be_changed
80
- info = RIM::ModuleInfo.new(@remote_git_dir, "test", "testbr")
110
+ info = RIM::ModuleInfo.new(@remote_git_dir_url, "test", "testbr")
81
111
  cut = RIM::SyncModuleHelper.new(@ws_dir, @ws_dir, info, @logger)
82
112
  cut.sync("This is the commit header.")
83
113
  RIM::git_session(@ws_dir) do |s|
@@ -86,10 +116,10 @@ class SyncModuleHelperTest < Minitest::Test
86
116
  end
87
117
  end
88
118
 
89
- def write_file(dir, name)
119
+ def write_file(dir, name, content = nil)
90
120
  FileUtils.mkdir_p(dir)
91
121
  File.open(File.join(dir, name), "w") do |f|
92
- f.write("Content of #{name}\n")
122
+ f.write(content || "Content of #{name}\n")
93
123
  end
94
124
  end
95
125
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: esr-rim
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.6
4
+ version: 1.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - ESR Labs AG
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-08 00:00:00.000000000 Z
11
+ date: 2016-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: subcommand