avm-git 0.13.4 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/avm/git/application_scms/base/assert_main_at.rb +49 -0
- data/lib/avm/git/application_scms/base.rb +21 -0
- data/lib/avm/git/application_scms.rb +11 -0
- data/lib/avm/git/issue/complete/commits.rb +2 -2
- data/lib/avm/git/issue/complete/push.rb +2 -2
- data/lib/avm/git/issue.rb +1 -1
- data/lib/avm/git/launcher/base/dirty_files.rb +4 -4
- data/lib/avm/git/launcher/base/subrepo.rb +1 -1
- data/lib/avm/git/launcher/base.rb +1 -0
- data/lib/avm/git/launcher/publish_base.rb +1 -2
- data/lib/avm/git/launcher/remote.rb +2 -2
- data/lib/avm/git/launcher/warp_base.rb +3 -2
- data/lib/avm/git/launcher_stereotypes/git_subrepo/warp.rb +2 -2
- data/lib/avm/git/organize/repository.rb +1 -1
- data/lib/avm/git/revision_test.rb +2 -2
- data/lib/avm/git/scms/git/change_tracker.rb +1 -0
- data/lib/avm/git/scms/git/commit.rb +1 -1
- data/lib/avm/git/scms/git/interval.rb +1 -1
- data/lib/avm/git/scms/git_subtree.rb +1 -1
- data/lib/avm/git/subrepo_check/show_result.rb +1 -1
- data/lib/avm/git/subrepo_checks.rb +1 -0
- data/lib/avm/git/version.rb +1 -1
- metadata +11 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b8398e0b296b1b152268e3e75893239fdbf76ea35198a090b5a32c0b50c29ce
|
4
|
+
data.tar.gz: 1a3d77ec717bededa720a46b50d44dbe8cf098dc829adfce891e66880669024c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6b6a7480886329c0d8d430ad2d3617e94a3775beee1812bf9d5a95bf5e56c0dad34dc9d4cfa437dfe0b3c9d73657960eefc149e7595d10b9f45fd3bc58d8cdc
|
7
|
+
data.tar.gz: a37e788e6f4c18b11c556c0bab148968e448915a34aa36e09810578c11f2b8ee9313882762a5ecc500b88d874407cd9f0cb09dbb945a9974ab59364317c0ccac
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/application_scms/base'
|
4
|
+
require 'eac_git/local'
|
5
|
+
require 'eac_git/remote'
|
6
|
+
require 'eac_ruby_utils/core_ext'
|
7
|
+
|
8
|
+
module Avm
|
9
|
+
module Git
|
10
|
+
module ApplicationScms
|
11
|
+
class Base < ::Avm::ApplicationScms::Base
|
12
|
+
class AssertMainAt
|
13
|
+
MAIN_REFERENCE = 'HEAD'
|
14
|
+
|
15
|
+
acts_as_instance_method
|
16
|
+
enable_simple_cache
|
17
|
+
common_constructor :base, :path
|
18
|
+
|
19
|
+
# @return [Pathname]
|
20
|
+
def result
|
21
|
+
local_repos.remote(base.git_https_url).fetch
|
22
|
+
local_repos.command('checkout', remote_head_commit_id).execute!
|
23
|
+
path
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
# @return [String]
|
29
|
+
def remote_head_commit_id
|
30
|
+
remote_repos.ls.fetch(MAIN_REFERENCE)
|
31
|
+
end
|
32
|
+
|
33
|
+
# @return [EacGit::Local]
|
34
|
+
def local_repos_uncached
|
35
|
+
path.mkpath
|
36
|
+
r = ::EacGit::Local.new(path)
|
37
|
+
r.command('init').execute! unless r.root_path.join('.git').exist?
|
38
|
+
r
|
39
|
+
end
|
40
|
+
|
41
|
+
# @return [EacGit::Remote]
|
42
|
+
def remote_repos_uncached
|
43
|
+
::EacGit::Remote.new(base.git_https_url)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/application_scms/base'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module Git
|
8
|
+
module ApplicationScms
|
9
|
+
class Base < ::Avm::ApplicationScms::Base
|
10
|
+
acts_as_abstract
|
11
|
+
|
12
|
+
# @return [Addressable::URI]
|
13
|
+
def git_https_url
|
14
|
+
raise_abstract_method __method__
|
15
|
+
end
|
16
|
+
|
17
|
+
require_sub __FILE__, require_mode: :kernel
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -32,8 +32,8 @@ module Avm
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def commit_parents(commit)
|
35
|
-
launcher_git.execute!('log', '--pretty=%P', '-n', '1', commit).split
|
36
|
-
|
35
|
+
launcher_git.execute!('log', '--pretty=%P', '-n', '1', commit).split.map(&:strip)
|
36
|
+
.select(&:present?)
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
@@ -25,11 +25,11 @@ module Avm
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def pushs_uncached
|
28
|
-
[master_push, remove_branch_push, tag_push].
|
28
|
+
[master_push, remove_branch_push, tag_push].compact
|
29
29
|
end
|
30
30
|
|
31
31
|
def master_push
|
32
|
-
remote_master_hash
|
32
|
+
remote_master_hash == branch_hash ? nil : "#{branch_hash}:refs/heads/master"
|
33
33
|
end
|
34
34
|
|
35
35
|
def remove_branch_push
|
data/lib/avm/git/issue.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
4
|
|
5
5
|
module Avm
|
6
6
|
module Git
|
@@ -9,11 +9,11 @@ module Avm
|
|
9
9
|
module DirtyFiles
|
10
10
|
delegate :dirty?, to: :eac_git
|
11
11
|
|
12
|
+
# @return [Array<Struct>]
|
12
13
|
def dirty_files
|
13
14
|
eac_git.dirty_files.map do |df|
|
14
|
-
|
15
|
-
|
16
|
-
)
|
15
|
+
df.to_h.merge(path: df.path.to_path, absolute_path: df.absolute_path.to_path)
|
16
|
+
.to_struct
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -30,7 +30,7 @@ module Avm
|
|
30
30
|
def subrepo_status_parse_output(output)
|
31
31
|
r = {}.with_indifferent_access
|
32
32
|
output.each_line do |l|
|
33
|
-
m = /\A([^\:]+)
|
33
|
+
m = /\A([^\:]+):(.*)\z/.match(l.strip)
|
34
34
|
next unless m && m[2].present?
|
35
35
|
|
36
36
|
r[m[1].strip] = m[2].strip
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'eac_ruby_utils/simple_cache'
|
4
3
|
require 'eac_ruby_utils/simple_cache'
|
5
4
|
require 'avm/launcher/publish/base'
|
6
5
|
require 'avm/launcher/publish/check_result'
|
@@ -111,7 +110,7 @@ module Avm
|
|
111
110
|
def remote_sha_uncached
|
112
111
|
remote_fetch
|
113
112
|
b = sgit.git.branches["#{remote_name}/#{remote_ref}"]
|
114
|
-
b
|
113
|
+
b&.gcommit&.sha
|
115
114
|
end
|
116
115
|
|
117
116
|
def remote_fetch_uncached
|
@@ -13,10 +13,10 @@ module Avm
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def ls
|
16
|
-
git.execute!(['ls-remote', name]).each_line.
|
16
|
+
git.execute!(['ls-remote', name]).each_line.to_h do |line|
|
17
17
|
x = line.strip.split(/\s+/)
|
18
18
|
[x[1], x[0]]
|
19
|
-
end
|
19
|
+
end
|
20
20
|
end
|
21
21
|
|
22
22
|
# +git remote add ...+
|
@@ -33,8 +33,9 @@ module Avm
|
|
33
33
|
return
|
34
34
|
end
|
35
35
|
|
36
|
-
raise ::Avm::Launcher::Instances::Error,
|
37
|
-
|
36
|
+
raise ::Avm::Launcher::Instances::Error,
|
37
|
+
"Refspec \"#{source_instance.options.git_current_revision}\" " \
|
38
|
+
"not found in \"#{source_git}\""
|
38
39
|
end
|
39
40
|
|
40
41
|
def update
|
@@ -33,8 +33,8 @@ module Avm
|
|
33
33
|
parent_git_warped.descendant?('HEAD', subrepo_parent_hash)
|
34
34
|
|
35
35
|
raise Avm::Launcher::Errors::Base,
|
36
|
-
"Subrepo parent hash \"#{subrepo_parent_hash}\"" \
|
37
|
-
"
|
36
|
+
"Subrepo parent hash \"#{subrepo_parent_hash}\" " \
|
37
|
+
"not found in \"#{parent_git_warped}\""
|
38
38
|
end
|
39
39
|
|
40
40
|
def subrepo_parent_hash
|
@@ -57,8 +57,8 @@ module Avm
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def run_test
|
60
|
-
infom "Running test command \"#{::Shellwords.join(test_command_args)}\"" \
|
61
|
-
|
60
|
+
infom "Running test command \"#{::Shellwords.join(test_command_args)}\" " \
|
61
|
+
"on \"#{git_absolute_path}\"..."
|
62
62
|
result = ::EacRubyUtils::Ruby.on_clean_environment { test_command.execute }
|
63
63
|
infom 'Test done'
|
64
64
|
write_result_cache(result)
|
@@ -17,7 +17,7 @@ module Avm
|
|
17
17
|
# @return [Array<Avm::Git::Scms::Git::Commit>]
|
18
18
|
def commits
|
19
19
|
scm.git_repo.command('log', '--pretty=format:%H', git_commit_interval).execute!
|
20
|
-
|
20
|
+
.each_line.map { |sha1| scm.commit(sha1.strip) }
|
21
21
|
end
|
22
22
|
|
23
23
|
# @return [String]
|
@@ -15,7 +15,7 @@ module Avm
|
|
15
15
|
|
16
16
|
def valid?
|
17
17
|
return false unless ::Avm::Git::Scms::Provider
|
18
|
-
|
18
|
+
.new.all.any? { |scm_class| parent_scm.is_a?(scm_class) }
|
19
19
|
|
20
20
|
(::Avm::Git::Scms::Provider.new.all - [self.class])
|
21
21
|
.lazy.map { |scm_class| scm_class.new(path) }.none?(&:valid?)
|
data/lib/avm/git/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avm-git
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Put here the authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: avm
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.82'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.82'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: avm-files
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -73,7 +73,7 @@ dependencies:
|
|
73
73
|
version: '0.119'
|
74
74
|
- - ">="
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: 0.119.
|
76
|
+
version: 0.119.2
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -83,7 +83,7 @@ dependencies:
|
|
83
83
|
version: '0.119'
|
84
84
|
- - ">="
|
85
85
|
- !ruby/object:Gem::Version
|
86
|
-
version: 0.119.
|
86
|
+
version: 0.119.2
|
87
87
|
- !ruby/object:Gem::Dependency
|
88
88
|
name: git
|
89
89
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,40 +98,20 @@ dependencies:
|
|
98
98
|
- - "~>"
|
99
99
|
- !ruby/object:Gem::Version
|
100
100
|
version: '1.18'
|
101
|
-
- !ruby/object:Gem::Dependency
|
102
|
-
name: aranha-parsers
|
103
|
-
requirement: !ruby/object:Gem::Requirement
|
104
|
-
requirements:
|
105
|
-
- - "~>"
|
106
|
-
- !ruby/object:Gem::Version
|
107
|
-
version: '0.8'
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: 0.8.5
|
111
|
-
type: :development
|
112
|
-
prerelease: false
|
113
|
-
version_requirements: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - "~>"
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0.8'
|
118
|
-
- - ">="
|
119
|
-
- !ruby/object:Gem::Version
|
120
|
-
version: 0.8.5
|
121
101
|
- !ruby/object:Gem::Dependency
|
122
102
|
name: eac_ruby_gem_support
|
123
103
|
requirement: !ruby/object:Gem::Requirement
|
124
104
|
requirements:
|
125
105
|
- - "~>"
|
126
106
|
- !ruby/object:Gem::Version
|
127
|
-
version: 0.
|
107
|
+
version: '0.9'
|
128
108
|
type: :development
|
129
109
|
prerelease: false
|
130
110
|
version_requirements: !ruby/object:Gem::Requirement
|
131
111
|
requirements:
|
132
112
|
- - "~>"
|
133
113
|
- !ruby/object:Gem::Version
|
134
|
-
version: 0.
|
114
|
+
version: '0.9'
|
135
115
|
description:
|
136
116
|
email:
|
137
117
|
executables: []
|
@@ -139,6 +119,9 @@ extensions: []
|
|
139
119
|
extra_rdoc_files: []
|
140
120
|
files:
|
141
121
|
- lib/avm/git.rb
|
122
|
+
- lib/avm/git/application_scms.rb
|
123
|
+
- lib/avm/git/application_scms/base.rb
|
124
|
+
- lib/avm/git/application_scms/base/assert_main_at.rb
|
142
125
|
- lib/avm/git/commit.rb
|
143
126
|
- lib/avm/git/commit/class_methods.rb
|
144
127
|
- lib/avm/git/commit/diff_tree_line.rb
|