git-si 0.2.4 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/git/si.rb +29 -6
- data/lib/git/si/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c77dbf792e64c63bff1a45af38b1554db4d32d0d
|
4
|
+
data.tar.gz: 45647e4d3e817d743fda2559d11fc52e84ac8588
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2ce1a14dbaa857ccdbfa81b06b8ab117a76cf6f060779a848bec3f4f540bef6a74b0b965d04aa1eda7747145501c1dad9ff4ace08fae315931c3709c00d2649
|
7
|
+
data.tar.gz: e6c9b056273c3592539963724ed417f0206641fbfea819386f5ffafe92381b422066b8882865cfc972248668ee4009db4a2dddc8f7c0e09603d7cdb63d8161e9
|
data/lib/git/si.rb
CHANGED
@@ -119,9 +119,23 @@ use the commands below.
|
|
119
119
|
end
|
120
120
|
on_mirror_branch do
|
121
121
|
notice_message "Fetching remote data from svn"
|
122
|
-
|
122
|
+
updated_files = `svn up --accept theirs-full --ignore-externals`
|
123
|
+
files_to_add = []
|
124
|
+
updated_files.each_line do |line|
|
125
|
+
say line
|
126
|
+
case line.strip!
|
127
|
+
when /^\w\s+(\S.+)/
|
128
|
+
files_to_add << '"' + $1 + '"'
|
129
|
+
end
|
130
|
+
end
|
131
|
+
notice_message "Reverting any local changes in mirror branch"
|
123
132
|
run_command("svn revert -R ./")
|
124
|
-
|
133
|
+
unless files_to_add.empty?
|
134
|
+
files_to_add.each do |filename|
|
135
|
+
say "Updating file in git: #{filename}"
|
136
|
+
end
|
137
|
+
system("git add " + files_to_add.join(' '))
|
138
|
+
end
|
125
139
|
run_command("git commit --allow-empty -am 'svn update to version #{get_svn_version}'")
|
126
140
|
end
|
127
141
|
success_message "fetch complete!"
|
@@ -168,12 +182,21 @@ continue, it's wise to reset the master branch afterward."
|
|
168
182
|
|
169
183
|
run_command("svn commit")
|
170
184
|
success_message "commit complete!"
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
185
|
+
|
186
|
+
files_unchanged = true
|
187
|
+
git_status = `git status --porcelain`
|
188
|
+
files_unchanged = false if git_status.match(/^[^\?]/)
|
189
|
+
unless files_unchanged
|
190
|
+
if yes? "Some files were added or modified during the commit; should I revert them? [y/N] ", :yellow
|
191
|
+
run_command("git reset --hard HEAD")
|
192
|
+
files_unchanged = true
|
175
193
|
end
|
176
194
|
end
|
195
|
+
|
196
|
+
if files_unchanged and yes? "Do you want to update the mirror branch to the latest commit? [y/N] ", :green
|
197
|
+
fetch
|
198
|
+
mirror_is_updated = true
|
199
|
+
end
|
177
200
|
end
|
178
201
|
|
179
202
|
if mirror_is_updated
|
data/lib/git/si/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-si
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Payton Swick
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|