I'm looking for a part-time remote job.

Hire me


I'm the author of:

Mastering Redmine is a comprehensive guide with tips, tricks and best practices, and an easy-to-learn structure.

Check the book's project or

Buy the book

Social pages of the book:

By buying this book you also donate to Redmine (see this page).


Follow me:

supoort-rm1.4-multirepository.patch

Takashi Okamoto, 22 May 2012 11:22

Download (4.44 KB)

View differences:

lib/scm_repositories_helper_patch.rb 2012-05-22 20:17:37.789414219 +0900
22 22
        def subversion_field_tags_with_add(form, repository)
23 23
            svntags = subversion_field_tags_without_add(form, repository)
24 24

  
25
            if !@project.repository && SubversionCreator.enabled?
25
            if (!@project.repository || @project.respond_to?('repositories')) && SubversionCreator.enabled?
26 26
                add = submit_tag(l(:button_create_new_repository), :onclick => "$('repository_operation').value = 'add';")
27 27
                svntags['<br />'] = ' ' + add + '<br />'
28 28
                svntags << hidden_field_tag(:operation, '', :id => 'repository_operation')
29 29
                unless request.post?
30 30
                    path = SubversionCreator.access_root_url(SubversionCreator.default_path(@project.identifier))
31
                    if @project.repository
32
                        path << '-' + @project.repositories.size.to_s
33
                    end
31 34
                    svntags << javascript_tag("$('repository_url').value = '#{escape_javascript(path)}';")
32 35
                end
33 36

  
......
45 48
        def mercurial_field_tags_with_add(form, repository)
46 49
            hgtags = mercurial_field_tags_without_add(form, repository)
47 50

  
48
            if !@project.repository && MercurialCreator.enabled?
51
            if (!@project.repository || (Redmine::Info.versioned_name > '1.4.0')) && MercurialCreator.enabled?
49 52
                add = submit_tag(l(:button_create_new_repository), :onclick => "$('repository_operation').value = 'add';")
50 53
                if hgtags.include?('<br />')
51 54
                    hgtags['<br />'] = ' ' + add + '<br />'
......
55 58
                hgtags << hidden_field_tag(:operation, '', :id => 'repository_operation')
56 59
                unless request.post?
57 60
                    path = MercurialCreator.access_root_url(MercurialCreator.default_path(@project.identifier))
61
                    if @project.repository
62
                        path << '-' + @project.repositories.size.to_s
63
                    end
58 64
                    hgtags << javascript_tag("$('repository_url').value = '#{escape_javascript(path)}';")
59 65
                end
60 66

  
......
78 84
        def bazaar_field_tags_with_add(form, repository)
79 85
            bzrtags = bazaar_field_tags_without_add(form, repository)
80 86

  
81
            if !@project.repository && BazaarCreator.enabled?
87
            if (!@project.repository || (Redmine::Info.versioned_name > '1.4.0')) && BazaarCreator.enabled?
82 88
                add = submit_tag(l(:button_create_new_repository), :onclick => "$('repository_operation').value = 'add';")
83 89
                bzrtags['</p>'] = ' ' + add + '</p>'
84 90
                bzrtags << hidden_field_tag(:operation, '', :id => 'repository_operation')
85 91
                unless request.post?
86 92
                    path = BazaarCreator.access_root_url(BazaarCreator.default_path(@project.identifier))
93
                    if @project.repository
94
                        path << '-' + @project.repositories.size.to_s
95
                    end
87 96
                    bzrtags << javascript_tag("$('repository_url').value = '#{escape_javascript(path)}';")
88 97
                    if BazaarCreator.options['log_encoding']
89 98
                        bzrtags << javascript_tag("$('repository_log_encoding').value = '#{escape_javascript(BazaarCreator.options['log_encoding'])}';")
......
104 113
        def git_field_tags_with_add(form, repository)
105 114
            gittags = git_field_tags_without_add(form, repository)
106 115

  
107
            if !@project.repository && GitCreator.enabled?
116
            if (!@project.repository || @project.respond_to?('repositories')) && GitCreator.enabled?
108 117
                add = submit_tag(l(:button_create_new_repository), :onclick => "$('repository_operation').value = 'add';")
109 118
                if gittags.include?('<br />')
110 119
                    gittags['<br />'] = ' ' + add + '<br />'
......
114 123
                gittags << hidden_field_tag(:operation, '', :id => 'repository_operation')
115 124
                unless request.post?
116 125
                    path = GitCreator.access_root_url(GitCreator.default_path(@project.identifier))
126
                    if @project.repository
127
                        path << '-' + @project.repositories.size.to_s
128
                    end
117 129
                    gittags << javascript_tag("$('repository_url').value = '#{escape_javascript(path)}';")
118 130
                end
119 131

  
Terms of use | Privacy policy