]> source.dussan.org Git - redmine.git/commitdiff
scm: mercurial: add latin-1 encoding directory to test repository (#2664).
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 8 Mar 2011 10:35:48 +0000 (10:35 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 8 Mar 2011 10:35:48 +0000 (10:35 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5059 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/fixtures/repositories/mercurial_repository.hg
test/functional/repositories_mercurial_controller_test.rb
test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb
test/unit/repository_mercurial_test.rb

index ef65dfeee43a710729d86db1b6a655f1a6264e57..54a8c2ef7bb70808e8de52cb80ee7ec5885e4d95 100644 (file)
Binary files a/test/fixtures/repositories/mercurial_repository.hg and b/test/fixtures/repositories/mercurial_repository.hg differ
index 15c6216738ee8c36cbbed66a3eedde9d472a6934..a29c46ae0e8c686626962e744b1cba51034eda3d 100644 (file)
@@ -126,7 +126,7 @@ class RepositoriesMercurialControllerTest < ActionController::TestCase
                       "test-#{@char_1}.txt"], assigns(:entries).collect(&:name)
         changesets = assigns(:changesets)
         assert_not_nil changesets
-        assert_equal %w(21 20 19 18 17), changesets.collect(&:revision)
+        assert_equal %w(27 21 20 19 18 17), changesets.collect(&:revision)
       end
     end
 
index b89caa5b978a70bfb6be9e930e4d121bd717cb93..6c9bdd580fa3bfedad7c85fbe93739fb5e119630 100644 (file)
@@ -18,9 +18,11 @@ begin
         @diff_c_support = true
 
         @tag_char_1    = "tag-#{CHAR_1_HEX}-00"
-        @branch_char_1 = "branch-#{CHAR_1_HEX}-00"
+        @branch_char_0 = "branch-#{CHAR_1_HEX}-00"
+        @branch_char_1 = "branch-#{CHAR_1_HEX}-01"
         if @tag_char_1.respond_to?(:force_encoding)
           @tag_char_1.force_encoding('UTF-8')
+          @branch_char_0.force_encoding('UTF-8')
           @branch_char_1.force_encoding('UTF-8')
         end
       end
@@ -58,7 +60,7 @@ begin
           adp = Redmine::Scm::Adapters::MercurialAdapter.new(repo)
           repo_path =  adp.info.root_url.gsub(/\\/, "/")
           assert_equal REPOSITORY_PATH, repo_path
-          assert_equal '26', adp.info.lastrev.revision
+          assert_equal '28', adp.info.lastrev.revision
           assert_equal '3ae45e2d177d',adp.info.lastrev.scmid
         end
       end
@@ -243,8 +245,9 @@ begin
       def test_branches
         assert_equal [
             'default',
-            'branch (1)[2]&,%.-3_4',
             @branch_char_1,
+            'branch (1)[2]&,%.-3_4',
+            @branch_char_0,
             'test_branch.latin-1',
             'test-branch-00',
           ], @adapter.branches
@@ -256,7 +259,8 @@ begin
            'test_branch.latin-1'   => 'c2ffe7da686a',
            'branch (1)[2]&,%.-3_4' => 'afc61e85bde7',
            'test-branch-00'        => '3a330eb32958',
-           @branch_char_1          => 'c8d3e4887474',
+           @branch_char_0          => 'c8d3e4887474',
+           @branch_char_1          => '7bbf4c738e71',
          }
         assert_equal bm, @adapter.branchmap
       end
index 6e7938f6c89ee42d4cfdc69650eb576db9c75228..7bb839046ae788ab6881e32014a64becf393f901 100644 (file)
@@ -43,8 +43,8 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
     def test_fetch_changesets_from_scratch
       @repository.fetch_changesets
       @repository.reload
-      assert_equal 27, @repository.changesets.count
-      assert_equal 34, @repository.changes.count
+      assert_equal 29, @repository.changesets.count
+      assert_equal 37, @repository.changes.count
       assert_equal "Initial import.\nThe repository contains 3 files.",
                    @repository.changesets.find_by_revision('0').comments
     end
@@ -57,7 +57,7 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
       assert_equal 3, @repository.changesets.count
       
       @repository.fetch_changesets
-      assert_equal 27, @repository.changesets.count
+      assert_equal 29, @repository.changesets.count
     end
 
     def test_isodatesec
@@ -187,7 +187,7 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
       @repository.fetch_changesets
       @repository.reload
       changesets = @repository.latest_changesets('README', nil)
-      assert_equal %w|26 17 8 6 1 0|, changesets.collect(&:revision)
+      assert_equal %w|28 17 8 6 1 0|, changesets.collect(&:revision)
 
       path = 'sql_escape/percent%dir/percent%file1.txt'
       changesets = @repository.latest_changesets(path, nil)
@@ -216,9 +216,9 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
     def test_previous
       @repository.fetch_changesets
       @repository.reload
-      %w|26 3ae45e2d177d 3ae4|.each do |r1|
+      %w|28 3ae45e2d177d 3ae45|.each do |r1|
         changeset = @repository.find_changeset_by_name(r1)
-        %w|25 afc61e85bde7 afc6|.each do |r2|
+        %w|27 7bbf4c738e71 7bbf|.each do |r2|
           assert_equal @repository.find_changeset_by_name(r2), changeset.previous
         end
       end
@@ -236,9 +236,9 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
     def test_next
       @repository.fetch_changesets
       @repository.reload
-      %w|25 afc61e85bde7 afc6|.each do |r2|
+      %w|27 7bbf4c738e71 7bbf|.each do |r2|
         changeset = @repository.find_changeset_by_name(r2)
-        %w|26 3ae45e2d177d 3ae4|.each do |r1|
+        %w|28 3ae45e2d177d 3ae45|.each do |r1|
         assert_equal @repository.find_changeset_by_name(r1), changeset.next
         end
       end
@@ -247,7 +247,7 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
     def test_next_nil
       @repository.fetch_changesets
       @repository.reload
-      %w|26 3ae45e2d177d 3ae4|.each do |r1|
+      %w|28 3ae45e2d177d 3ae45|.each do |r1|
         changeset = @repository.find_changeset_by_name(r1)
         assert_nil changeset.next
       end