# HG changeset patch
# Date 1286709576 -32400
# Parent 425724afa3754e254677b90c2cdfb9188f6c4bef
# User Toshi MARUYAMA
scm: mercurial: preserve seconds of committed timestamp
It changes template keyword 'isodate' to 'isodatesec'.
'isodatesec' is supported since Mercurial 8999d1249171,
which means Mercurial 1.0 has it.
Tested-by: Yuya Nishihara
Tested-on: Redmine trunk r3840
closes #6656
diff --git a/lib/redmine/scm/adapters/mercurial/hg-template-1.0.tmpl b/lib/redmine/scm/adapters/mercurial/hg-template-1.0.tmpl
--- 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
--- a/test/unit/repository_mercurial_test.rb
+++ b/test/unit/repository_mercurial_test.rb
@@ -68,6 +68,13 @@
assert_nil @repository.scm.cat("sources/welcome_controller.rb")
end
+ def test_isodatesec
+ @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
+
else
puts "Mercurial test repository NOT FOUND. Skipping unit tests !!!"
def test_fake; assert true end