avm-git 0.12.0 → 0.13.1
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/launcher/publish_base.rb +8 -1
- data/lib/avm/git/launcher_stereotypes/git_subrepo/publish.rb +17 -0
- data/lib/avm/git/launcher_stereotypes/git_subrepo.rb +4 -2
- data/lib/avm/git/scms/git_sub_base/commit.rb +29 -0
- data/lib/avm/git/scms/git_sub_base/interval.rb +28 -0
- data/lib/avm/git/scms/git_sub_base.rb +10 -1
- data/lib/avm/git/version.rb +1 -1
- metadata +22 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c527e07290b2c56ad8f4aeb91cdbb3b0f78223dc34c9babf50f372573555d79
|
4
|
+
data.tar.gz: f9cf685952de778334ce13137152065a246bbcd0b95135b627439fee1fdd2a8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2685abcc268908517117700c16217f2bd928e0eadb0564f81e7702dd20a7a0fef4273178ebbe7c9baf4b12c93e7c5b0bd2e7e2e1773c6b97d9d1d3d8d2b063ba
|
7
|
+
data.tar.gz: f72d76691c1d21a09fbcb7e2c9f73f802f168734e34575e5c7e3a55f2401005d99b6492739f9a467e7fea30ce13d611f64e1b1a19b41f78ca344c3a474321f2b
|
@@ -15,6 +15,8 @@ module Avm
|
|
15
15
|
CHECKERS = %w[remote_url remote_fetch publish_remote_no_exist remote_equal remote_following
|
16
16
|
local_following].freeze
|
17
17
|
|
18
|
+
DEFAULT_REMOTE_REF = 'master'
|
19
|
+
|
18
20
|
REMOTE_UNAVAILABLE_MESSAGES = ['could not resolve host', 'connection timed out',
|
19
21
|
'no route to host'].map(&:downcase).freeze
|
20
22
|
|
@@ -108,7 +110,7 @@ module Avm
|
|
108
110
|
|
109
111
|
def remote_sha_uncached
|
110
112
|
remote_fetch
|
111
|
-
b = sgit.git.branches["#{remote_name}
|
113
|
+
b = sgit.git.branches["#{remote_name}/#{remote_ref}"]
|
112
114
|
b ? b.gcommit.sha : nil
|
113
115
|
end
|
114
116
|
|
@@ -119,6 +121,11 @@ module Avm
|
|
119
121
|
def remote_name
|
120
122
|
::Avm::Git::Launcher::WarpBase::TARGET_REMOTE
|
121
123
|
end
|
124
|
+
|
125
|
+
# @return [String]
|
126
|
+
def remote_ref
|
127
|
+
DEFAULT_REMOTE_REF
|
128
|
+
end
|
122
129
|
end
|
123
130
|
end
|
124
131
|
end
|
@@ -7,6 +7,23 @@ module Avm
|
|
7
7
|
module LauncherStereotypes
|
8
8
|
class GitSubrepo
|
9
9
|
class Publish < ::Avm::Git::Launcher::PublishBase
|
10
|
+
# @return [Pathname]
|
11
|
+
def config_path
|
12
|
+
instance.parent.warped.to_pathname.join(
|
13
|
+
"./#{instance.to_parent_path}",
|
14
|
+
::Avm::Git::LauncherStereotypes::GitSubrepo::CONFIG_SUBPATH
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
# @return [EacGit::Local::Subrepo::Config]
|
19
|
+
def config
|
20
|
+
::EacGit::Local::Subrepo::Config.from_file(config_path)
|
21
|
+
end
|
22
|
+
|
23
|
+
# @return [String]
|
24
|
+
def remote_ref
|
25
|
+
config.remote_branch || super
|
26
|
+
end
|
10
27
|
end
|
11
28
|
end
|
12
29
|
end
|
@@ -11,9 +11,11 @@ module Avm
|
|
11
11
|
require_sub __FILE__
|
12
12
|
include Avm::Launcher::Stereotype
|
13
13
|
|
14
|
+
CONFIG_SUBPATH = '.gitrepo'
|
15
|
+
|
14
16
|
class << self
|
15
17
|
def match?(path)
|
16
|
-
File.exist?(path.real.subpath(
|
18
|
+
File.exist?(path.real.subpath(CONFIG_SUBPATH)) && subrepo_url(path.real) != 'none'
|
17
19
|
end
|
18
20
|
|
19
21
|
def color
|
@@ -21,7 +23,7 @@ module Avm
|
|
21
23
|
end
|
22
24
|
|
23
25
|
def subrepo_url(path)
|
24
|
-
File.read(path.subpath(
|
26
|
+
File.read(path.subpath(CONFIG_SUBPATH)).each_line do |l|
|
25
27
|
m = /remote\s*=\s(.+)/.match(l)
|
26
28
|
return m[1] if m
|
27
29
|
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/scms/commit'
|
4
|
+
require 'avm/git/scms/git/commit'
|
5
|
+
require 'eac_ruby_utils/core_ext'
|
6
|
+
|
7
|
+
module Avm
|
8
|
+
module Git
|
9
|
+
module Scms
|
10
|
+
class GitSubBase < ::Avm::Scms::Base
|
11
|
+
class Commit < ::Avm::Scms::Commit
|
12
|
+
common_constructor :scm, :parent_commit do
|
13
|
+
# parent_commit.assert_argument(::Avm::Git::Scms::Git::Commit, 'parent_commit')
|
14
|
+
end
|
15
|
+
|
16
|
+
delegate :deploy_to_env_path, :fixup?, :id, :merge_with, :reword, :scm_file?, :subject,
|
17
|
+
:to_s, to: :parent_commit
|
18
|
+
|
19
|
+
# @return [Array<Pathname>]
|
20
|
+
def changed_files
|
21
|
+
parent_commit.changed_files.map do |cf|
|
22
|
+
cf.relative_path_from(scm.relative_path_from_parent_scm)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/git/scms/git_sub_base/commit'
|
4
|
+
require 'avm/scms/base'
|
5
|
+
require 'avm/scms/interval'
|
6
|
+
require 'eac_ruby_utils/core_ext'
|
7
|
+
|
8
|
+
module Avm
|
9
|
+
module Git
|
10
|
+
module Scms
|
11
|
+
class GitSubBase < ::Avm::Scms::Base
|
12
|
+
class Interval < ::Avm::Scms::Interval
|
13
|
+
# @return [Array<Avm::Git::Scms::GitSubBase::Commit>]
|
14
|
+
def commits
|
15
|
+
parent_interval.commits.map do |parent_commit|
|
16
|
+
Avm::Git::Scms::GitSubBase::Commit.new(scm, parent_commit)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
# @return [Avm::Git::Scms::Git::Interval]
|
21
|
+
def parent_interval
|
22
|
+
scm.parent_scm.interval(from, to)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -9,8 +9,17 @@ module Avm
|
|
9
9
|
class GitSubBase < ::Avm::Scms::Base
|
10
10
|
enable_abstract_methods
|
11
11
|
|
12
|
-
delegate :changed_files, :commit_if_change, :current_milestone_base_commit,
|
12
|
+
delegate :changed_files, :commit_if_change, :current_milestone_base_commit,
|
13
13
|
:head_commit, :reset_and_commit, :run_commit, to: :parent_scm
|
14
|
+
|
15
|
+
# @param from [Avm::Git::Scms::Git::Commit]
|
16
|
+
# @param to [Avm::Git::Scms::Git::Commit]
|
17
|
+
# @return [Avm::Git::Scms::GitSubBase::Interval]
|
18
|
+
def interval(from, to)
|
19
|
+
::Avm::Git::Scms::GitSubBase::Interval.new(self, from, to)
|
20
|
+
end
|
21
|
+
|
22
|
+
require_sub __FILE__
|
14
23
|
end
|
15
24
|
end
|
16
25
|
end
|
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.13.1
|
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-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: avm
|
@@ -16,14 +16,20 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.64'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 0.64.2
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
27
|
- - "~>"
|
25
28
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
29
|
+
version: '0.64'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 0.64.2
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: avm-files
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -45,6 +51,9 @@ dependencies:
|
|
45
51
|
- - "~>"
|
46
52
|
- !ruby/object:Gem::Version
|
47
53
|
version: '0.14'
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 0.14.1
|
48
57
|
type: :runtime
|
49
58
|
prerelease: false
|
50
59
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -52,46 +61,37 @@ dependencies:
|
|
52
61
|
- - "~>"
|
53
62
|
- !ruby/object:Gem::Version
|
54
63
|
version: '0.14'
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: 0.14.1
|
55
67
|
- !ruby/object:Gem::Dependency
|
56
68
|
name: eac_ruby_utils
|
57
69
|
requirement: !ruby/object:Gem::Requirement
|
58
70
|
requirements:
|
59
71
|
- - "~>"
|
60
72
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0.
|
62
|
-
- - ">="
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
version: 0.110.1
|
73
|
+
version: '0.112'
|
65
74
|
type: :runtime
|
66
75
|
prerelease: false
|
67
76
|
version_requirements: !ruby/object:Gem::Requirement
|
68
77
|
requirements:
|
69
78
|
- - "~>"
|
70
79
|
- !ruby/object:Gem::Version
|
71
|
-
version: '0.
|
72
|
-
- - ">="
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: 0.110.1
|
80
|
+
version: '0.112'
|
75
81
|
- !ruby/object:Gem::Dependency
|
76
82
|
name: git
|
77
83
|
requirement: !ruby/object:Gem::Requirement
|
78
84
|
requirements:
|
79
85
|
- - "~>"
|
80
86
|
- !ruby/object:Gem::Version
|
81
|
-
version: '1.
|
82
|
-
- - ">="
|
83
|
-
- !ruby/object:Gem::Version
|
84
|
-
version: 1.13.1
|
87
|
+
version: '1.18'
|
85
88
|
type: :runtime
|
86
89
|
prerelease: false
|
87
90
|
version_requirements: !ruby/object:Gem::Requirement
|
88
91
|
requirements:
|
89
92
|
- - "~>"
|
90
93
|
- !ruby/object:Gem::Version
|
91
|
-
version: '1.
|
92
|
-
- - ">="
|
93
|
-
- !ruby/object:Gem::Version
|
94
|
-
version: 1.13.1
|
94
|
+
version: '1.18'
|
95
95
|
- !ruby/object:Gem::Dependency
|
96
96
|
name: aranha-parsers
|
97
97
|
requirement: !ruby/object:Gem::Requirement
|
@@ -193,6 +193,8 @@ files:
|
|
193
193
|
- lib/avm/git/scms/git/milestones.rb
|
194
194
|
- lib/avm/git/scms/git/run_commit.rb
|
195
195
|
- lib/avm/git/scms/git_sub_base.rb
|
196
|
+
- lib/avm/git/scms/git_sub_base/commit.rb
|
197
|
+
- lib/avm/git/scms/git_sub_base/interval.rb
|
196
198
|
- lib/avm/git/scms/git_subrepo.rb
|
197
199
|
- lib/avm/git/scms/git_subtree.rb
|
198
200
|
- lib/avm/git/scms/provider.rb
|