From 95247950513ee4c9e31aa7d142adb5d0920f8f11 Mon Sep 17 00:00:00 2001
From: Toshi MARUYAMA <marutosijp2@yahoo.co.jp>
Date: Wed, 2 Feb 2011 10:01:22 +0000
Subject: [PATCH] scm: mercurial: add unit lib test for the previous changeset
 isn't the parent (#7253, #7518).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4792 e93f8b46-1217-0410-a6f0-8f06a7374b81
---
 .../redmine/scm/adapters/mercurial_adapter_test.rb    | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb b/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb
index 65e4a23d6..bc82c562d 100644
--- a/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb
+++ b/test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb
@@ -69,6 +69,17 @@ begin
         end
       end
 
+      def test_diff_made_by_revision
+        if @adapter.class.client_version_above?([1, 2])
+          [16, '16', '4cddb4e45f52'].each do |r1|
+            diff1 = @adapter.diff(nil, r1)
+            assert_equal 5, diff1.size
+            buf = diff1[4].gsub(/\r\n|\r|\n/, "")
+            assert_equal '+0885933ad4f68d77c2649cd11f8311276e7ef7ce tag-init-revision', buf
+          end
+        end
+      end
+
       def test_cat
         [2, '400bb8672109', '400', 400].each do |r|
           buf = @adapter.cat('sources/welcome_controller.rb', r)
-- 
GitLab