git-svn-id: http://svn.redmine.org/redmine/trunk@12929 e93f8b46-1217-0410-a6f0-8f06a7374b81tags/2.6.0
REPOSITORY_PATH = Rails.root.join('tmp/test/mercurial_repository').to_s | REPOSITORY_PATH = Rails.root.join('tmp/test/mercurial_repository').to_s | ||||
CHAR_1_HEX = "\xc3\x9c" | CHAR_1_HEX = "\xc3\x9c" | ||||
PRJ_ID = 3 | PRJ_ID = 3 | ||||
NUM_REV = 32 | |||||
NUM_REV = 34 | |||||
ruby19_non_utf8_pass = | ruby19_non_utf8_pass = | ||||
(RUBY_VERSION >= '1.9' && Encoding.default_external.to_s != 'UTF-8') | (RUBY_VERSION >= '1.9' && Encoding.default_external.to_s != 'UTF-8') |
adp = Redmine::Scm::Adapters::MercurialAdapter.new(repo) | adp = Redmine::Scm::Adapters::MercurialAdapter.new(repo) | ||||
repo_path = adp.info.root_url.gsub(/\\/, "/") | repo_path = adp.info.root_url.gsub(/\\/, "/") | ||||
assert_equal REPOSITORY_PATH, repo_path | assert_equal REPOSITORY_PATH, repo_path | ||||
assert_equal '31', adp.info.lastrev.revision | |||||
assert_equal '31eeee7395c8c78e66dd54c50addd078d10b2355',adp.info.lastrev.scmid | |||||
assert_equal '33', adp.info.lastrev.revision | |||||
assert_equal '2e6d546429230f377d7d19c2078abd2dd909f235',adp.info.lastrev.scmid | |||||
end | end | ||||
end | end | ||||
include Redmine::I18n | include Redmine::I18n | ||||
REPOSITORY_PATH = Rails.root.join('tmp/test/mercurial_repository').to_s | REPOSITORY_PATH = Rails.root.join('tmp/test/mercurial_repository').to_s | ||||
NUM_REV = 32 | |||||
NUM_REV = 34 | |||||
CHAR_1_HEX = "\xc3\x9c" | CHAR_1_HEX = "\xc3\x9c" | ||||
def setup | def setup | ||||
# with_limit | # with_limit | ||||
changesets = @repository.latest_changesets('', nil, 2) | changesets = @repository.latest_changesets('', nil, 2) | ||||
assert_equal %w|31 30|, changesets.collect(&:revision) | |||||
assert_equal ["#{NUM_REV - 1}", "#{NUM_REV - 2}"], changesets.collect(&:revision) | |||||
# with_filepath | # with_filepath | ||||
changesets = @repository.latest_changesets( | changesets = @repository.latest_changesets( | ||||
@repository.fetch_changesets | @repository.fetch_changesets | ||||
@project.reload | @project.reload | ||||
assert_equal NUM_REV, @repository.changesets.count | assert_equal NUM_REV, @repository.changesets.count | ||||
%w|31 31eeee7395c8 31eee|.each do |r1| | |||||
["#{NUM_REV - 1}", "2e6d54642923", "2e6d5"].each do |r1| | |||||
changeset = @repository.find_changeset_by_name(r1) | changeset = @repository.find_changeset_by_name(r1) | ||||
assert_nil changeset.next | assert_nil changeset.next | ||||
end | end |