svn_command_helper 0.6.1 → 0.7.0
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/svn_command_helper/version.rb +1 -1
- data/lib/svn_command_helper.rb +8 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 473a682621ce0f8423b8be51fead333becdd3b2f
|
4
|
+
data.tar.gz: eee8e3adda5ca606288174952cd81eb10b052e0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ce776c91106a12049c74df657e2a98b3d69ba17e996941a4d218581ea8b648a2a0335e42bc2818e96ba99b2c64c4a9a76dda912757ef24450b43b568020b649
|
7
|
+
data.tar.gz: 94f8feb724b65a45a9dda3767fc9094a41e818bcd3061dbaf7f234bf85a055102294862fd5b18045e4f205a77e2f55a3f8d9107fb72a4ea1eb77557e9c017fec
|
data/lib/svn_command_helper.rb
CHANGED
@@ -213,8 +213,9 @@ module SvnCommandHelper
|
|
213
213
|
# copy single transaction
|
214
214
|
# @param [SvnFileCopyTransaction] transaction from and to info
|
215
215
|
# @param [String] message commit message
|
216
|
-
|
217
|
-
|
216
|
+
# @param [Boolean] recursive list --recursive
|
217
|
+
def copy_single(transaction, message, recursive = false)
|
218
|
+
transactions = transaction.glob_transactions(recursive)
|
218
219
|
raise "copy_single: #{transaction.from} not exists" if transactions.empty?
|
219
220
|
to_exist_transactions = Svn.list_files(transaction.to_base).map do |_file|
|
220
221
|
transactions.find {|_transaction| _transaction.file == _file}
|
@@ -253,12 +254,13 @@ module SvnCommandHelper
|
|
253
254
|
sys "svn checkout --depth empty #{base_uri} ."
|
254
255
|
transactions.each do |transaction|
|
255
256
|
relative_to = transaction.relative_to(base_uri)
|
256
|
-
Svn.update_deep(relative_to, "empty", false) # mkpath的な なくてもエラーにはならないので
|
257
257
|
|
258
258
|
if transaction.to_exist? # toがある場合マージ
|
259
|
+
Svn.update_deep(relative_to, "empty", false)
|
259
260
|
sys "svn export --force #{transaction.from} #{relative_to}"
|
260
261
|
sys "svn add --force #{relative_to}"
|
261
262
|
else # toがない場合コピー
|
263
|
+
Svn.update_deep(File.dirname(relative_to), "empty", false) # mkpath的な なくてもエラーにはならないので
|
262
264
|
sys "svn copy --parents #{transaction.from} #{relative_to}"
|
263
265
|
end
|
264
266
|
end
|
@@ -319,9 +321,10 @@ module SvnCommandHelper
|
|
319
321
|
end
|
320
322
|
|
321
323
|
# filename glob (like "hoge*") to each single file transaction
|
324
|
+
# @param [Boolean] recursive list --recursive
|
322
325
|
# @return [Array<SvnFileCopyTransaction>] transactions
|
323
|
-
def glob_transactions
|
324
|
-
Svn.list_files(@from_base)
|
326
|
+
def glob_transactions(recursive = false)
|
327
|
+
Svn.list_files(@from_base, recursive)
|
325
328
|
.select{|_file| File.fnmatch(@file, _file)}
|
326
329
|
.map{|_file| SvnFileCopyTransaction.new(from_base: @from_base, to_base: @to_base, file: _file)}
|
327
330
|
end
|