@ -26,15 +26,15 @@ type RepoUnit struct {
// Enumerate all the unit types
const (
UnitTypeCode = iota + 1 // 1 code
UnitTypeIssues // 2 issues
UnitTypePRs // 3 PRs
UnitTypeCommits // 4 Commits
UnitTypeReleases // 5 Releases
UnitTypeWiki // 6 Wiki
UnitTypeSettings // 7 Settings
UnitTypeExternalWiki // 8 ExternalWiki
UnitTypeExternalTracker // 9 ExternalTracker
V16 UnitTypeCode = iota + 1 // 1 code
V16 UnitTypeIssues // 2 issues
V16 UnitTypePRs // 3 PRs
V16 UnitTypeCommits // 4 Commits
V16 UnitTypeReleases // 5 Releases
V16 UnitTypeWiki // 6 Wiki
V16 UnitTypeSettings // 7 Settings
V16 UnitTypeExternalWiki // 8 ExternalWiki
V16 UnitTypeExternalTracker // 9 ExternalTracker
)
// Repo describes a repository
@ -79,32 +79,32 @@ func addUnitsToTables(x *xorm.Engine) error {
for _ , repo := range repos {
for i := 1 ; i <= 9 ; i ++ {
if ( i == UnitTypeWiki || i == UnitTypeExternalWiki ) && ! repo . EnableWiki {
if ( i == V16 UnitTypeWiki || i == V16 UnitTypeExternalWiki) && ! repo . EnableWiki {
continue
}
if i == UnitTypeExternalWiki && ! repo . EnableExternalWiki {
if i == V16 UnitTypeExternalWiki && ! repo . EnableExternalWiki {
continue
}
if i == UnitTypePRs && ! repo . EnablePulls {
if i == V16 UnitTypePRs && ! repo . EnablePulls {
continue
}
if ( i == UnitTypeIssues || i == UnitTypeExternalTracker ) && ! repo . EnableIssues {
if ( i == V16 UnitTypeIssues || i == V16 UnitTypeExternalTracker) && ! repo . EnableIssues {
continue
}
if i == UnitTypeExternalTracker && ! repo . EnableExternalTracker {
if i == V16 UnitTypeExternalTracker && ! repo . EnableExternalTracker {
continue
}
var config = make ( map [ string ] string )
switch i {
case UnitTypeExternalTracker :
case V16 UnitTypeExternalTracker:
config [ "ExternalTrackerURL" ] = repo . ExternalTrackerURL
config [ "ExternalTrackerFormat" ] = repo . ExternalTrackerFormat
if len ( repo . ExternalTrackerStyle ) == 0 {
repo . ExternalTrackerStyle = markdown . IssueNameStyleNumeric
}
config [ "ExternalTrackerStyle" ] = repo . ExternalTrackerStyle
case UnitTypeExternalWiki :
case V16 UnitTypeExternalWiki:
config [ "ExternalWikiURL" ] = repo . ExternalWikiURL
}