##// END OF EJS Templates
Fixes: Mercurial adapter loses seconds of commit times (#6656)....
Jean-Philippe Lang -
r4447:759048e73a9b
parent child
Show More
@@ -1,7 +1,7
1 changeset = 'This template must be used with --debug option\n'
1 changeset = 'This template must be used with --debug option\n'
2 changeset_quiet = 'This template must be used with --debug option\n'
2 changeset_quiet = 'This template must be used with --debug option\n'
3 changeset_verbose = 'This template must be used with --debug option\n'
3 changeset_verbose = 'This template must be used with --debug option\n'
4 changeset_debug = '<logentry revision="{rev}" node="{node|short}">\n<author>{author|escape}</author>\n<date>{date|isodate}</date>\n<paths>\n{file_mods}{file_adds}{file_dels}{file_copies}</paths>\n<msg>{desc|escape}</msg>\n{tags}</logentry>\n\n'
4 changeset_debug = '<logentry revision="{rev}" node="{node|short}">\n<author>{author|escape}</author>\n<date>{date|isodatesec}</date>\n<paths>\n{file_mods}{file_adds}{file_dels}{file_copies}</paths>\n<msg>{desc|escape}</msg>\n{tags}</logentry>\n\n'
5
5
6 file_mod = '<path action="M">{file_mod|escape}</path>\n'
6 file_mod = '<path action="M">{file_mod|escape}</path>\n'
7 file_add = '<path action="A">{file_add|escape}</path>\n'
7 file_add = '<path action="A">{file_add|escape}</path>\n'
@@ -62,12 +62,20 class RepositoryMercurialTest < ActiveSupport::TestCase
62 assert_equal 2, @repository.entries("images", 2).size
62 assert_equal 2, @repository.entries("images", 2).size
63 end
63 end
64
64
65
66 def test_cat
65 def test_cat
67 assert @repository.scm.cat("sources/welcome_controller.rb", 2)
66 assert @repository.scm.cat("sources/welcome_controller.rb", 2)
68 assert_nil @repository.scm.cat("sources/welcome_controller.rb")
67 assert_nil @repository.scm.cat("sources/welcome_controller.rb")
69 end
68 end
70
69
70 def test_isodatesec
71 # Template keyword 'isodatesec' supported in Mercurial 1.0 and higher
72 if @repository.scm.class.client_version_above?([1, 0])
73 @repository.fetch_changesets
74 @repository.reload
75 rev0_committed_on = Time.gm(2007, 12, 14, 9, 22, 52)
76 assert_equal @repository.changesets.find_by_revision('0').committed_on, rev0_committed_on
77 end
78 end
71 else
79 else
72 puts "Mercurial test repository NOT FOUND. Skipping unit tests !!!"
80 puts "Mercurial test repository NOT FOUND. Skipping unit tests !!!"
73 def test_fake; assert true end
81 def test_fake; assert true end
General Comments 0
You need to be logged in to leave comments. Login now