Defect #2402

Darcs test unit wrong repos content.... Mercurial's one duplicated

Added by yves dufour almost 9 years ago. Updated over 8 years ago.

Status:ClosedStart date:2008-12-26
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:SCM
Target version:0.8.1
Resolution:Fixed Affected version:

Description

Darcs
gunzip < test/fixtures/repositories/darcs_repository.tar.gz | tar -xv -C tmp/test

same content as Mercurial one ( watchers.rb)

so tests fail ..

def test_cat
@repository.fetch_changesets
cat = @repository.cat("sources/welcome_controller.rb", 2)
assert_not_nil cat
assert cat.include?('class WelcomeController < ApplicationController')
end

Associated revisions

Revision 2231
Added by Jean-Philippe Lang almost 9 years ago

Fixed: Darcs adapter works on Win32 only (wrong quotes in commands #2402).

Revision 2232
Added by Jean-Philippe Lang almost 9 years ago

Merged r2231 from 0.8-stable (#2402).

History

#1 Updated by Jean-Philippe Lang almost 9 years ago

same content as Mercurial one

Same files but one is a Mercurial repository, and the other one is a Darcs repository.

so tests fail

Tests pass for me. Maybe you could post the test failure?

#2 Updated by yves dufour almost 9 years ago

1) Failure:
test_add_file(ProjectsControllerTest)
[./test/functional/projects_controller_test.rb:133:in `test_add_file'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `__send__'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `run']:
<nil>
expected to be kind_of?
<TMail::Mail> but was
<NilClass>.

2) Failure:
test_browse_at_given_revision(RepositoriesDarcsControllerTest)
[./test/functional/repositories_darcs_controller_test.rb:73:in `test_browse_at_given_revision'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `__send__'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `run']:
Expected response to be a <:success>, but was <500>
<"">

3) Failure:
test_browse_directory(RepositoriesDarcsControllerTest)
[./test/functional/repositories_darcs_controller_test.rb:60:in `test_browse_directory'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `__send__'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `run']:
Expected response to be a <:success>, but was <500>
<"">

4) Failure:
test_browse_root(RepositoriesDarcsControllerTest)
[./test/functional/repositories_darcs_controller_test.rb:49:in `test_browse_root'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `__send__'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `run']:
Expected response to be a <:success>, but was <500>
<"">

5) Failure:
test_changes(RepositoriesDarcsControllerTest)
[./test/functional/repositories_darcs_controller_test.rb:81:in `test_changes'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `__send__'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `run']:
Expected response to be a <:success>, but was <500>
<"">

6) Failure:
test_diff(RepositoriesDarcsControllerTest)
[./test/functional/repositories_darcs_controller_test.rb:90:in `test_diff'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `__send__'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `run']:
Expected response to be a <:success>, but was <500>
<"">

7) Failure:
test_show(RepositoriesDarcsControllerTest)
[./test/functional/repositories_darcs_controller_test.rb:41:in `test_show'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `__send__'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/testing/setup_and_teardown.rb:67:in `run']:
Expected response to be a <:success>, but was <500>
<"">

331 tests, 1278 assertions, 7 failures, 0 errors

#3 Updated by Jean-Philippe Lang almost 9 years ago

OK, you've got 500 errors. So please read SubmittingBugs and attach the stack traces.

#4 Updated by Jean-Philippe Lang almost 9 years ago

Oh, and make sure you have Darcs installed and available in your path.

#5 Updated by Jean-Philippe Lang almost 9 years ago

No feedback?

#6 Updated by Jean-Philippe Lang almost 9 years ago

  • Status changed from New to Closed
  • Resolution set to Invalid

Reopen if needed.

#7 Updated by yves dufour almost 9 years ago

Jean-Philippe Lang wrote:

Reopen if needed.

sorry.. for the last log (error 500) was not ther ight one...

tested with last redmine trunk ..
the command sent to DARCS was :

darcs show content --repodir /Users/yves/Sites/rails/redmine/tmp/test/darcs_repository --match \"hash 20080308225413-98289-21b8e42854e60a780294bdf21e21a39ba8c47eff.gz\" 'sources/welcome_controller.rb'

which was wrong
darcs failed: Invalid --match pattern '"hash'.
"match" (line 1, column 1):
unexpected "\""
expecting match rule

I modified the line 139 in
redmine/scm/adapters/darcs_adapter

        def cat(path, identifier=nil)
          cmd = "#{DARCS_BIN} show content --repodir #{@url}" 
139          cmd << " --match \"hash #{identifier}\"" if identifier
          cmd << " #{shell_quote path}" 
          debugger
          cat = nil
          shellout(cmd) do |io|
            io.binmode
            cat = io.read
          end
          return nil if $? && $?.exitstatus != 0
          cat
        end

TO :

 139       cmd << " --match 'hash #{identifier}'" if identifier

so the command is now :
darcs show content --repodir /Users/yves/Sites/rails/redmine/tmp/test/darcs_repository --match 'hash 20080308225413-98289-21b8e42854e60a780294bdf21e21a39ba8c47eff.gz' 'sources/welcome_controller.r

and test if good

yves

#8 Updated by Jean-Philippe Lang almost 9 years ago

OK, quotes are Win32 style and thus it fails on *nix OS.
I'll fix it.

#9 Updated by Jean-Philippe Lang almost 9 years ago

  • Status changed from Closed to Resolved
  • Resolution changed from Invalid to Fixed

I've fixed DarcsAdapter in r2232, using the appropriate quotes depending on the OS.
Please confirm it's OK. Thanks.

#10 Updated by Jean-Philippe Lang over 8 years ago

  • Category set to SCM
  • Status changed from Resolved to Closed
  • Target version set to 0.8.1

Also available in: Atom PDF