git-maintain 0.2.2.pre.13.gd8c159e → 0.2.2.pre.16.g35a06ea
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.
- checksums.yaml +4 -4
- data/lib/branch.rb +5 -5
- data/lib/repo.rb +14 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9136bd1f9d90b86d3af7ca47cf635dd098ea9543d1e526b23b471161748f867
|
4
|
+
data.tar.gz: a5d820668e7ecbdba48ffec58f024a8dda0aebab1c0f7d82e269becae220dfbf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8038e5a2939531e015e747e686674b75212b2ae7b04a6b656b20196982b276827425161b3182061a998e4727cb8615e8f65db3b7b54304013b32d1448f96d7dc
|
7
|
+
data.tar.gz: d8dc1a7b8ab0833bfecf127a0f2fef045c4dd97abc9dd45cc275bcf56720bc38625ba9799374a6e68a117278ed7725e5e0640a1a23a65e6b6f038b3196f36cef
|
data/lib/branch.rb
CHANGED
@@ -127,7 +127,7 @@ module GitMaintain
|
|
127
127
|
@version = version
|
128
128
|
@branch_suff = branch_suff
|
129
129
|
|
130
|
-
if version =~ /^[0-9]
|
130
|
+
if version =~ /^[0-9]+$/
|
131
131
|
@local_branch = "dev/stable-v#{@version}/#{@branch_suff}"
|
132
132
|
@remote_branch ="stable-v#{@version}"
|
133
133
|
else
|
@@ -135,7 +135,7 @@ module GitMaintain
|
|
135
135
|
end
|
136
136
|
|
137
137
|
@head = @repo.runGit("rev-parse #{@local_branch}")
|
138
|
-
@remote_ref = "#{
|
138
|
+
@remote_ref = "#{@repo.getStableRepo()}/#{@remote_branch}"
|
139
139
|
@stable_head = @repo.runGit("rev-parse #{@remote_ref}")
|
140
140
|
@stable_base = @repo.findStableBase(@local_branch)
|
141
141
|
|
@@ -143,7 +143,7 @@ module GitMaintain
|
|
143
143
|
attr_reader :version, :local_branch, :head, :remote_branch, :remote_ref, :stable_head
|
144
144
|
|
145
145
|
def is_targetted?(opts)
|
146
|
-
return true if @version !~ /^[0-9]
|
146
|
+
return true if @version !~ /^[0-9]+$/
|
147
147
|
if @version.to_i < opts[:base_ver] then
|
148
148
|
return :too_old
|
149
149
|
end
|
@@ -202,7 +202,7 @@ module GitMaintain
|
|
202
202
|
|
203
203
|
# Push the branch to the validation repo
|
204
204
|
def push(opts)
|
205
|
-
@repo.runGit("push #{opts[:push_force] == true ? "-f" : ""} #{
|
205
|
+
@repo.runGit("push #{opts[:push_force] == true ? "-f" : ""} #{@repo.getValidRepo()} #{@local_branch}")
|
206
206
|
end
|
207
207
|
|
208
208
|
# Monitor the build status on Travis
|
@@ -237,7 +237,7 @@ module GitMaintain
|
|
237
237
|
end
|
238
238
|
rep = GitMaintain::checkLog(opts, @local_branch, @remote_ref, "submit")
|
239
239
|
if rep == "y" then
|
240
|
-
@repo.runGit("push #{
|
240
|
+
@repo.runGit("push #{@repo.getStableRepo()} #{@local_branch}:#{@remote_branch}")
|
241
241
|
else
|
242
242
|
puts "Skipping push to stable"
|
243
243
|
return
|
data/lib/repo.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module GitMaintain
|
2
2
|
class Repo
|
3
|
-
VALID_REPO = "github"
|
4
|
-
STABLE_REPO = "stable"
|
5
|
-
SUBMIT_BINARY="git-release"
|
3
|
+
@@VALID_REPO = "github"
|
4
|
+
@@STABLE_REPO = "stable"
|
5
|
+
@@SUBMIT_BINARY="git-release"
|
6
6
|
|
7
7
|
ACTION_LIST = [
|
8
8
|
:list_branches,
|
@@ -36,6 +36,13 @@ module GitMaintain
|
|
36
36
|
repo.send(action, opts)
|
37
37
|
end
|
38
38
|
|
39
|
+
def getValidRepo()
|
40
|
+
return @@VALID_REPO
|
41
|
+
end
|
42
|
+
def getStableRepo()
|
43
|
+
return @@STABLE_REPO
|
44
|
+
end
|
45
|
+
|
39
46
|
def initialize(path=nil)
|
40
47
|
GitMaintain::checkDirectConstructor(self.class)
|
41
48
|
|
@@ -47,9 +54,9 @@ module GitMaintain
|
|
47
54
|
if path == nil
|
48
55
|
@path = Dir.pwd()
|
49
56
|
end
|
50
|
-
@remote_valid=runGit("remote -v | egrep '^#{VALID_REPO}' | grep fetch |
|
57
|
+
@remote_valid=runGit("remote -v | egrep '^#{@@VALID_REPO}' | grep fetch |
|
51
58
|
awk '{ print $2}' | sed -e 's/.*://' -e 's/\.git//'")
|
52
|
-
@remote_stable=runGit("remote -v | egrep '^#{STABLE_REPO}' | grep fetch |
|
59
|
+
@remote_stable=runGit("remote -v | egrep '^#{@@STABLE_REPO}' | grep fetch |
|
53
60
|
awk '{ print $2}' | sed -e 's/.*://' -e 's/\.git//'")
|
54
61
|
@stable_base_patterns=
|
55
62
|
runGit("config --get-regexp stable-base | egrep '^stable-base\.' | "+
|
@@ -86,7 +93,7 @@ module GitMaintain
|
|
86
93
|
|
87
94
|
def stableUpdate()
|
88
95
|
puts "# Fetching stable updates..."
|
89
|
-
runGit("fetch #{STABLE_REPO}")
|
96
|
+
runGit("fetch #{@@STABLE_REPO}")
|
90
97
|
end
|
91
98
|
def getStableList(br_suff)
|
92
99
|
return @stable_list if @stable_list != nil
|
@@ -111,7 +118,7 @@ module GitMaintain
|
|
111
118
|
end
|
112
119
|
|
113
120
|
def submitReleases(opts)
|
114
|
-
remote_tags=runGit("ls-remote --tags #{STABLE_REPO} |
|
121
|
+
remote_tags=runGit("ls-remote --tags #{@@STABLE_REPO} |
|
115
122
|
egrep 'refs/tags/v[0-9.]*$'").split("\n").map(){
|
116
123
|
|x| x.gsub(/.*refs\/tags\//, '')
|
117
124
|
}
|