Project

General

Profile

Defect #6656 » hg-isodatesec-20101128.patch

Toshi MARUYAMA, 2010-11-28 02:25

View differences:

lib/redmine/scm/adapters/mercurial/hg-template-1.0.tmpl
1 1
changeset = 'This template must be used with --debug option\n'
2 2
changeset_quiet =  'This template must be used with --debug option\n'
3 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 6
file_mod = '<path action="M">{file_mod|escape}</path>\n'
7 7
file_add = '<path action="A">{file_add|escape}</path>\n'
test/unit/repository_mercurial_test.rb
62 62
      assert_equal 2, @repository.entries("images", 2).size
63 63
    end
64 64

  
65

  
66 65
    def test_cat
67 66
      assert @repository.scm.cat("sources/welcome_controller.rb", 2)
68 67
      assert_nil @repository.scm.cat("sources/welcome_controller.rb")
69 68
    end
70 69

  
......
66 65
    def test_cat
67 66
      assert @repository.scm.cat("sources/welcome_controller.rb", 2)
68 67
      assert_nil @repository.scm.cat("sources/welcome_controller.rb")
69 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 79
  else
72 80
    puts "Mercurial test repository NOT FOUND. Skipping unit tests !!!"
73 81
    def test_fake; assert true end
(4-4/4)