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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f438a83212dbe4da273cda92edd62841f0f30e2a
4
- data.tar.gz: e4383ac7c0af643f8d4cf07672beed1d8ca51736
3
+ metadata.gz: 473a682621ce0f8423b8be51fead333becdd3b2f
4
+ data.tar.gz: eee8e3adda5ca606288174952cd81eb10b052e0d
5
5
  SHA512:
6
- metadata.gz: f1c2ac125404824a24960f0f8e770eba0fed9c34d780e822a67e9929c4016c14309fe72fa591125250d542d569f1f662f3e4011364d52d3361340e6741e8bcb2
7
- data.tar.gz: a5afe470e20e8d9a624a37e1e779dba5f9e75f1d45d3b6467445b111b5b413165f74d641c042a8fab971f28357673a097616d154f724fe0e1d6e67ddc1514c6e
6
+ metadata.gz: 7ce776c91106a12049c74df657e2a98b3d69ba17e996941a4d218581ea8b648a2a0335e42bc2818e96ba99b2c64c4a9a76dda912757ef24450b43b568020b649
7
+ data.tar.gz: 94f8feb724b65a45a9dda3767fc9094a41e818bcd3061dbaf7f234bf85a055102294862fd5b18045e4f205a77e2f55a3f8d9107fb72a4ea1eb77557e9c017fec
@@ -1,4 +1,4 @@
1
1
  module SvnCommandHelper
2
2
  # version
3
- VERSION = "0.6.1"
3
+ VERSION = "0.7.0"
4
4
  end
@@ -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
- def copy_single(transaction, message)
217
- transactions = transaction.glob_transactions
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: svn_command_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Narazaka