--- lib/scm_repositories_helper_patch.rb.org 2012-05-22 19:12:00.126404764 +0900
+++ lib/scm_repositories_helper_patch.rb 2012-05-22 20:17:37.789414219 +0900
@@ -22,12 +22,15 @@
def subversion_field_tags_with_add(form, repository)
svntags = subversion_field_tags_without_add(form, repository)
- if !@project.repository && SubversionCreator.enabled?
+ if (!@project.repository || @project.respond_to?('repositories')) && SubversionCreator.enabled?
add = submit_tag(l(:button_create_new_repository), :onclick => "$('repository_operation').value = 'add';")
svntags['
'] = ' ' + add + '
'
svntags << hidden_field_tag(:operation, '', :id => 'repository_operation')
unless request.post?
path = SubversionCreator.access_root_url(SubversionCreator.default_path(@project.identifier))
+ if @project.repository
+ path << '-' + @project.repositories.size.to_s
+ end
svntags << javascript_tag("$('repository_url').value = '#{escape_javascript(path)}';")
end
@@ -45,7 +48,7 @@
def mercurial_field_tags_with_add(form, repository)
hgtags = mercurial_field_tags_without_add(form, repository)
- if !@project.repository && MercurialCreator.enabled?
+ if (!@project.repository || (Redmine::Info.versioned_name > '1.4.0')) && MercurialCreator.enabled?
add = submit_tag(l(:button_create_new_repository), :onclick => "$('repository_operation').value = 'add';")
if hgtags.include?('
')
hgtags['
'] = ' ' + add + '
'
@@ -55,6 +58,9 @@
hgtags << hidden_field_tag(:operation, '', :id => 'repository_operation')
unless request.post?
path = MercurialCreator.access_root_url(MercurialCreator.default_path(@project.identifier))
+ if @project.repository
+ path << '-' + @project.repositories.size.to_s
+ end
hgtags << javascript_tag("$('repository_url').value = '#{escape_javascript(path)}';")
end
@@ -78,12 +84,15 @@
def bazaar_field_tags_with_add(form, repository)
bzrtags = bazaar_field_tags_without_add(form, repository)
- if !@project.repository && BazaarCreator.enabled?
+ if (!@project.repository || (Redmine::Info.versioned_name > '1.4.0')) && BazaarCreator.enabled?
add = submit_tag(l(:button_create_new_repository), :onclick => "$('repository_operation').value = 'add';")
bzrtags['