From 759048e73a9bef1569be51f1f0f1caf3b7a3e504 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Thu, 23 Dec 2010 09:56:30 +0000 Subject: [PATCH] Fixes: Mercurial adapter loses seconds of commit times (#6656). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4561 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .../scm/adapters/mercurial/hg-template-1.0.tmpl | 2 +- test/unit/repository_mercurial_test.rb | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/redmine/scm/adapters/mercurial/hg-template-1.0.tmpl b/lib/redmine/scm/adapters/mercurial/hg-template-1.0.tmpl index 3eef85016..b6cc7a786 100644 --- a/lib/redmine/scm/adapters/mercurial/hg-template-1.0.tmpl +++ b/lib/redmine/scm/adapters/mercurial/hg-template-1.0.tmpl @@ -1,7 +1,7 @@ changeset = 'This template must be used with --debug option\n' changeset_quiet = 'This template must be used with --debug option\n' changeset_verbose = 'This template must be used with --debug option\n' -changeset_debug = '\n{author|escape}\n{date|isodate}\n\n{file_mods}{file_adds}{file_dels}{file_copies}\n{desc|escape}\n{tags}\n\n' +changeset_debug = '\n{author|escape}\n{date|isodatesec}\n\n{file_mods}{file_adds}{file_dels}{file_copies}\n{desc|escape}\n{tags}\n\n' file_mod = '{file_mod|escape}\n' file_add = '{file_add|escape}\n' diff --git a/test/unit/repository_mercurial_test.rb b/test/unit/repository_mercurial_test.rb index 3e2f56925..16e72c35d 100644 --- a/test/unit/repository_mercurial_test.rb +++ b/test/unit/repository_mercurial_test.rb @@ -62,12 +62,20 @@ class RepositoryMercurialTest < ActiveSupport::TestCase assert_equal 2, @repository.entries("images", 2).size end - def test_cat assert @repository.scm.cat("sources/welcome_controller.rb", 2) assert_nil @repository.scm.cat("sources/welcome_controller.rb") end + def test_isodatesec + # Template keyword 'isodatesec' supported in Mercurial 1.0 and higher + if @repository.scm.class.client_version_above?([1, 0]) + @repository.fetch_changesets + @repository.reload + rev0_committed_on = Time.gm(2007, 12, 14, 9, 22, 52) + assert_equal @repository.changesets.find_by_revision('0').committed_on, rev0_committed_on + end + end else puts "Mercurial test repository NOT FOUND. Skipping unit tests !!!" def test_fake; assert true end