esr-rim 1.4.4 → 1.4.7

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: 92a6cf9a777ebf7199d6642919737640ed4194dc18b191973cc51612d196f4b5
4
- data.tar.gz: 1254ea13f802865c004cac16759b71c509b42026c735da1838e98ecce0f75816
3
+ metadata.gz: 4b293dbe27fac4aa9a8a8a9ddd5e4646137bc2ef1e1199c15fb88b5949c45177
4
+ data.tar.gz: 8ac963407d05985800068f93c0bfd3eed86afce4326d2d60cf1d71d4cd226d29
5
5
  SHA512:
6
- metadata.gz: 0aa2478abeecc42a19eeccbfa30b7769811a62c17593c9d2384b00d73e4fb9a640b68ab65019f97ee967ffaba0a9d56222ec0c54af4289d920960aa4fff2f4b6
7
- data.tar.gz: 55dec8e4158dfe395db31d92174dbd42eff729f6a36292903e0df90abbc6a3311ea98545126470af72a309d2dc540583aba7e7b4d37a89a2ebb20586856f798e
6
+ metadata.gz: 6c4c1e5a227cc9984a524cd2edc0141f1422b9101db9d865469cbe1573668b97ef9f38829d6104155b59208a07df35e615f4e56f100d6cc1c06132743d08e8a1
7
+ data.tar.gz: 71d75b7b8d54415c5dc366d161286bb4944886bdc89fc575d2ab3b3023f0e9cfe9944d4a5e9cd7936a1332321f67afc12bb1a9f951e0997e790a090ad0fa4739
data/CHANGELOG CHANGED
@@ -142,4 +142,16 @@
142
142
 
143
143
  # 1.4.4
144
144
 
145
- * Fixed exception which results in ugly log output for Ruby >= 2.5 (Thread.report_on_exception)
145
+ * Fixed exception which results in ugly log output for Ruby >= 2.5
146
+
147
+ # 1.4.5
148
+
149
+ * Wrong build: deprecated
150
+
151
+ # 1.4.6
152
+
153
+ * Fixed issue #28: rim sync is not working in root of destination repository
154
+
155
+ # 1.4.7
156
+
157
+ * Added a notification in `rim info` in case the current SHA1 is not an existing commit
data/Rakefile CHANGED
@@ -14,13 +14,13 @@ RTextGemSpec = Gem::Specification.new do |s|
14
14
  s.date = Time.now.strftime("%Y-%m-%d")
15
15
  s.summary = "RIM - multi git tool"
16
16
  s.description = "RIM lets you work with multiple git repositories from within one single git repository."
17
- s.authors = "ESR Labs AG"
17
+ s.authors = "ESR Labs GmbH"
18
18
  s.homepage = "http://github.com/esrlabs/esr-rim"
19
19
  s.add_dependency('subcommand', '>= 1.0.6')
20
20
  gemfiles = Rake::FileList.new
21
21
  gemfiles.include("{lib,test}/**/*")
22
22
  gemfiles.include(DocFiles)
23
- gemfiles.include("Rakefile")
23
+ gemfiles.include("Rakefile")
24
24
  s.files = gemfiles
25
25
  s.rdoc_options = ["--main", "README.md", "-x", "test"]
26
26
  s.extra_rdoc_files = DocFiles
@@ -37,14 +37,14 @@ end
37
37
 
38
38
  RTextPackageTask = Gem::PackageTask.new(RTextGemSpec) do |p|
39
39
  p.need_zip = false
40
- end
40
+ end
41
41
 
42
42
  task :prepare_package_rdoc => :rdoc do
43
43
  RTextPackageTask.package_files.include("doc/**/*")
44
44
  end
45
45
 
46
46
  desc 'run unit tests'
47
- task :run_tests do
47
+ task :unit_tests do
48
48
  sh "ruby test/unit_tests.rb"
49
49
  end
50
50
 
@@ -27,7 +27,7 @@ class CommandHelper < Processor
27
27
  def check_ready
28
28
  raise RimException.new("The workspace git contains uncommitted changes.") if !local_changes?(@ws_root)
29
29
  end
30
-
30
+
31
31
  def check_arguments
32
32
  raise RimException.new("Unexpected command line arguments.") if !ARGV.empty?
33
33
  end
@@ -49,7 +49,7 @@ class CommandHelper < Processor
49
49
  end
50
50
  true
51
51
  end
52
-
52
+
53
53
  def modules_from_paths(paths, opts = {})
54
54
  if paths.empty?
55
55
  module_from_path(nil, opts)
@@ -61,7 +61,7 @@ class CommandHelper < Processor
61
61
  raise RimException.new("Multiple modules cannot be used with URL option.")
62
62
  end
63
63
  end
64
-
64
+
65
65
  def module_from_path(path, opts = {})
66
66
  module_path = find_file_dir_in_workspace(path || ".", RimInfo::InfoFileName)
67
67
  if module_path
@@ -79,10 +79,10 @@ class CommandHelper < Processor
79
79
  raise RimException.new("Invalid .riminfo file found in directory '#{module_path}'.")
80
80
  end
81
81
  else
82
- raise RimException.new(path ? "No module info found in '#{path}'." : "No module info found.")
82
+ raise RimException.new(path ? "No module info found in '#{path}'." : "No module info found.")
83
83
  end
84
84
  end
85
-
85
+
86
86
  def module_paths(paths, exclude_paths = nil)
87
87
  module_paths = []
88
88
  (paths.empty? ? ['.'] : paths).each do |p|
@@ -98,11 +98,11 @@ class CommandHelper < Processor
98
98
  end
99
99
  module_paths.sort
100
100
  end
101
-
101
+
102
102
  def all_module_paths_from_path(path)
103
103
  Dir.glob(File.join(path, "**/.riminfo")).map { |f| Pathname.new(File.expand_path(File.dirname(f))).relative_path_from(Pathname.pwd).to_s }
104
104
  end
105
-
105
+
106
106
  def add_unique_module_info(module_info)
107
107
  if !@paths.include?(module_info.local_path)
108
108
  @paths.push(module_info.local_path)
@@ -119,19 +119,20 @@ class CommandHelper < Processor
119
119
 
120
120
  def find_file_dir_in_workspace(start_dir, file)
121
121
  path = File.expand_path(start_dir)
122
- while path != @ws_root
122
+ loop do
123
123
  if File.exist?(File.join(path, file))
124
124
  return path
125
- else
125
+ elsif path != @ws_root
126
126
  parent = File.dirname(path)
127
127
  if parent != path
128
128
  path = parent
129
129
  else
130
- break
130
+ return nil
131
131
  end
132
- end
132
+ else
133
+ return nil
134
+ end
133
135
  end
134
- nil
135
136
  end
136
137
 
137
138
  protected
data/lib/rim/git.rb CHANGED
@@ -98,6 +98,13 @@ class GitSession
98
98
  end
99
99
  nil
100
100
  end
101
+
102
+ # check whether a commit exists
103
+ def commit_exists?(sha)
104
+ execute("git rev-parse --quiet --verify #{sha}^{commit}") do |b, e|
105
+ return !e
106
+ end
107
+ end
101
108
 
102
109
  # check whether branch exists
103
110
  def has_branch?(branch)
@@ -23,7 +23,11 @@ class InfoHelper < CommandHelper
23
23
  @module_helpers.each do |h|
24
24
  path = h.module_info.local_path.split(/[\\\/]/).last.ljust(40)
25
25
  info = "#{path}: ->#{h.target_rev.ljust(10)} @#{h.current_sha1[0..6]}"
26
- if h.upstream_revs
26
+
27
+ if (!h.current_commit_exists)
28
+ info += " [COMMIT NOT FOUND]"
29
+ @logger.info(info)
30
+ elsif h.upstream_revs
27
31
  if h.upstream_revs.size > 0
28
32
  info += " [#{h.upstream_revs.size} commits behind]"
29
33
  else
@@ -5,6 +5,7 @@ module RIM
5
5
  class InfoModuleHelper < ModuleHelper
6
6
 
7
7
  attr_accessor :target_rev
8
+ attr_accessor :current_commit_exists
8
9
  attr_accessor :current_sha1
9
10
  attr_accessor :upstream_revs
10
11
  attr_accessor :upstream_non_fast_forward
@@ -19,6 +20,10 @@ class InfoModuleHelper < ModuleHelper
19
20
  @target_rev = rim_info.target_revision
20
21
  @current_sha1 = rim_info.revision_sha1
21
22
  RIM::git_session(git_path) do |s|
23
+ if s.commit_exists?(current_sha1)
24
+ @current_commit_exists = true
25
+ end
26
+
22
27
  if s.has_remote_branch?(target_rev)
23
28
  # repository is mirrored so branches are "local"
24
29
  if s.is_ancestor?(current_sha1, target_rev)
@@ -32,7 +32,7 @@ module RIM
32
32
  raise RimException.new("Unknown target revision '#{@module_info.target_revision}' for module '#{@module_info.local_path}'.")
33
33
  end
34
34
  local_path = File.join(@dest_root, @module_info.local_path)
35
- prepare_empty_folder(local_path, @module_info.ignores)
35
+ prepare_empty_folder(local_path, [*@module_info.ignores, ".git/**/*"])
36
36
  temp_commit(d, "clear directory") if d.uncommited_changes?
37
37
  strip = ""
38
38
  if @module_info.subdir
data/lib/rim/version.rb CHANGED
@@ -2,9 +2,8 @@ module RIM
2
2
 
3
3
  module Version
4
4
 
5
- Version = "1.4.4"
5
+ Version = "1.4.7"
6
6
 
7
7
  end
8
8
 
9
9
  end
10
-
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.4.4
4
+ version: 1.4.7
5
5
  platform: ruby
6
6
  authors:
7
- - ESR Labs AG
7
+ - ESR Labs GmbH
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-02 00:00:00.000000000 Z
11
+ date: 2021-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: subcommand
@@ -106,8 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  - !ruby/object:Gem::Version
107
107
  version: '0'
108
108
  requirements: []
109
- rubyforge_project:
110
- rubygems_version: 2.7.7
109
+ rubygems_version: 3.1.2
111
110
  signing_key:
112
111
  specification_version: 4
113
112
  summary: RIM - multi git tool