This is an automated email from the ASF dual-hosted git repository. sebb pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push: new 8d285f7 Add support for root-url 8d285f7 is described below commit 8d285f77cc94cf38da41049156e2d6090b79ba84 Author: Sebb <s...@apache.org> AuthorDate: Tue Jun 30 23:33:04 2020 +0100 Add support for root-url --- lib/spec/lib/svn_wunderbar_spec.rb | 12 ++++++++++++ lib/whimsy/asf/svn.rb | 8 +++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/spec/lib/svn_wunderbar_spec.rb b/lib/spec/lib/svn_wunderbar_spec.rb index 7186d2e..20cb24f 100644 --- a/lib/spec/lib/svn_wunderbar_spec.rb +++ b/lib/spec/lib/svn_wunderbar_spec.rb @@ -292,4 +292,16 @@ describe "ASF::SVN.svnmucc_" do expect(ts[1]).to match(%r{^svnmucc .*--message test .*--username user --password.+pass}) expect(ts[4]).to eq('usage: svnmucc ACTION...') # output of svnmucc help end + it "svnmucc_([['help']],'test',ENV_.new,_,nil,{root: root}) should include --root-url" do + root = ASF::SVN.svnurl!('site-root') + rc, out = _json do |_| + ASF::SVN.svnmucc_([['help']],'test',ENV_.new,_,nil,{root: root}) + end + expect(rc).to eq(0) + expect(out).to be_kind_of(Hash) + ts = out['transcript'] + expect(ts).to be_kind_of(Array) + expect(ts[0]).to match(%r{^\$ svnmucc .*--message test .*--root-url #{root}}) + expect(ts[1]).to eq('usage: svnmucc ACTION...') # output of svnmucc help + end end \ No newline at end of file diff --git a/lib/whimsy/asf/svn.rb b/lib/whimsy/asf/svn.rb index 9dcb78b..5993e01 100644 --- a/lib/whimsy/asf/svn.rb +++ b/lib/whimsy/asf/svn.rb @@ -638,6 +638,7 @@ module ASF # :tmpdir - use this temporary directory (and don't remove it) # :verbose - if true, show command details # :dryrun - if true, don't execute command, but show it instead + # :root - interpret all action URLs relative to the specified root # The commands must themselves be arrays to ensure correct processing of white-space # For example: # commands = [] @@ -652,7 +653,7 @@ module ASF raise ArgumentError.new 'env must not be nil' unless env raise ArgumentError.new '_ must not be nil' unless _ - bad_keys = options.keys - [:dryrun, :verbose, :tmpdir] + bad_keys = options.keys - [:dryrun, :verbose, :tmpdir, :root] if bad_keys.size > 0 raise ArgumentError.new "Following options not recognised: #{bad_keys.inspect}" end @@ -684,6 +685,11 @@ module ASF syscmd << '--revision' syscmd << revision end + root = options[:root] + if root + syscmd << '--root-url' + syscmd << root + end sysopts = {} if env