This commit is contained in:
Unknwon committed 2015-11-20 02:38:41 -05:00
1 parent 9b6c835715
commit 987dcc5372
13 files changed
+97 -13

No files matched your search

+1 -1
View File
@@ -5,7 +5,7 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra
![](public/img/gogs-large-resize.png) ![](public/img/gogs-large-resize.png)
##### Current version: 0.7.18 Beta ##### Current version: 0.7.19 Beta
<table> <table>
<tr> <tr>
+1
View File
@@ -514,6 +514,7 @@ func runWeb(ctx *cli.Context) {
m.Post("/new", bindIgnErr(auth.NewReleaseForm{}), repo.NewReleasePost) m.Post("/new", bindIgnErr(auth.NewReleaseForm{}), repo.NewReleasePost)
m.Get("/edit/:tagname", repo.EditRelease) m.Get("/edit/:tagname", repo.EditRelease)
m.Post("/edit/:tagname", bindIgnErr(auth.EditReleaseForm{}), repo.EditReleasePost) m.Post("/edit/:tagname", bindIgnErr(auth.EditReleaseForm{}), repo.EditReleasePost)
m.Post("/delete", repo.DeleteRelease)
}, reqRepoAdmin, middleware.RepoRef()) }, reqRepoAdmin, middleware.RepoRef())
m.Combo("/compare/*").Get(repo.CompareAndPullRequest). m.Combo("/compare/*").Get(repo.CompareAndPullRequest).
+4
View File
@@ -655,6 +655,10 @@ release.cancel = Cancel
release.publish = Publish Release release.publish = Publish Release
release.save_draft = Save Draft release.save_draft = Save Draft
release.edit_release = Edit Release release.edit_release = Edit Release
release.delete_release = Delete This Release
release.deletion = Release Deletion
release.deletion_desc = Delete this release will delete corresponding Git tag. Do you want to continue?
release.deletion_success = Release has been deleted successfully!
release.tag_name_already_exist = Release with this tag name has already existed. release.tag_name_already_exist = Release with this tag name has already existed.
release.downloads = Downloads release.downloads = Downloads
+1 -1
View File
@@ -17,7 +17,7 @@ import (
"github.com/gogits/gogs/modules/setting" "github.com/gogits/gogs/modules/setting"
) )
const APP_VER = "0.7.18.1119 Beta" const APP_VER = "0.7.19.1120 Beta"
func init() { func init() {
runtime.GOMAXPROCS(runtime.NumCPU()) runtime.GOMAXPROCS(runtime.NumCPU())
+2 -1
View File
@@ -330,6 +330,7 @@ func (err ErrReleaseAlreadyExist) Error() string {
} }
type ErrReleaseNotExist struct { type ErrReleaseNotExist struct {
ID int64
TagName string TagName string
} }
@@ -339,7 +340,7 @@ func IsErrReleaseNotExist(err error) bool {
} }
func (err ErrReleaseNotExist) Error() string { func (err ErrReleaseNotExist) Error() string {
return fmt.Sprintf("Release tag does not exist [tag_name: %s]", err.TagName) return fmt.Sprintf("Release tag does not exist [id: %d, tag_name: %s]", err.ID, err.TagName)
} }
// __ __ ___. .__ __ // __ __ ___. .__ __
+2 -2
View File
@@ -1375,8 +1375,8 @@ func ChangeMilestoneAssign(oldMid int64, issue *Issue) (err error) {
} }
// DeleteMilestoneByID deletes a milestone by given ID. // DeleteMilestoneByID deletes a milestone by given ID.
func DeleteMilestoneByID(mid int64) error { func DeleteMilestoneByID(id int64) error {
m, err := GetMilestoneByID(mid) m, err := GetMilestoneByID(id)
if err != nil { if err != nil {
if IsErrMilestoneNotExist(err) { if IsErrMilestoneNotExist(err) {
return nil return nil
+48 -3
View File
@@ -5,6 +5,7 @@
package models package models
import ( import (
"fmt"
"sort" "sort"
"strings" "strings"
"time" "time"
@@ -12,6 +13,7 @@ import (
"github.com/go-xorm/xorm" "github.com/go-xorm/xorm"
"github.com/gogits/gogs/modules/git" "github.com/gogits/gogs/modules/git"
"github.com/gogits/gogs/modules/process"
) )
// Release represents a release of repository. // Release represents a release of repository.
@@ -99,7 +101,7 @@ func GetRelease(repoID int64, tagName string) (*Release, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} else if !isExist { } else if !isExist {
return nil, ErrReleaseNotExist{tagName} return nil, ErrReleaseNotExist{0, tagName}
} }
rel := &Release{RepoID: repoID, LowerTagName: strings.ToLower(tagName)} rel := &Release{RepoID: repoID, LowerTagName: strings.ToLower(tagName)}
@@ -107,8 +109,21 @@ func GetRelease(repoID int64, tagName string) (*Release, error) {
return rel, err return rel, err
} }
// GetReleasesByRepoId returns a list of releases of repository. // GetReleaseByID returns release with given ID.
func GetReleasesByRepoId(repoID int64) (rels []*Release, err error) { func GetReleaseByID(id int64) (*Release, error) {
rel := new(Release)
has, err := x.Id(id).Get(rel)
if err != nil {
return nil, err
} else if !has {
return nil, ErrReleaseNotExist{id, ""}
}
return rel, nil
}
// GetReleasesByRepoID returns a list of releases of repository.
func GetReleasesByRepoID(repoID int64) (rels []*Release, err error) {
err = x.Desc("created").Find(&rels, Release{RepoID: repoID}) err = x.Desc("created").Find(&rels, Release{RepoID: repoID})
return rels, err return rels, err
} }
@@ -147,3 +162,33 @@ func UpdateRelease(gitRepo *git.Repository, rel *Release) (err error) {
_, err = x.Id(rel.ID).AllCols().Update(rel) _, err = x.Id(rel.ID).AllCols().Update(rel)
return err return err
} }
// DeleteReleaseByID deletes a release and corresponding Git tag by given ID.
func DeleteReleaseByID(id int64) error {
rel, err := GetReleaseByID(id)
if err != nil {
return fmt.Errorf("GetReleaseByID: %v", err)
}
repo, err := GetRepositoryByID(rel.RepoID)
if err != nil {
return fmt.Errorf("GetRepositoryByID: %v", err)
}
repoPath, err := repo.RepoPath()
if err != nil {
return fmt.Errorf("RepoPath: %v", err)
}
_, stderr, err := process.ExecDir(-1, repoPath, fmt.Sprintf("Delete release [%d]", rel.ID),
"git", "tag", "-d", rel.TagName)
if err != nil && !strings.Contains(stderr, "not found") {
return fmt.Errorf("git tag -d: %v - %s", err, stderr)
}
if _, err = x.Id(rel.ID).Delete(new(Release)); err != nil {
return fmt.Errorf("Delete: %v", err)
}
return nil
}
+2 -2
View File
@@ -4364,7 +4364,7 @@ func confLocaleLocale_deDeIni() (*asset, error) {
return a, nil return a, nil
} }
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xbc\x7d\xeb\x72\xdc\x48\xae\xe6\x7f\x3e\x05\xdb\x13\x0e\xdb\x11\x72\x39\xba\xfb\xec\x25\x3a\xda\xee\x95\xa5\xf6\x65\x8e\x65\x69\x2c\xf5\xcc\xce\x3a\x1c\x6c\x56\x91\xaa\xe2\xb8\x8a\xac\x26\x59\x2e\x6b\x4e\x9c\x88\x7d\x80\x7d\x80\xdd\xd7\x3b\x4f\xb2\xc0\x07\x20\x2f\x24\x4b\xb2\x7b\x26\x8e\x7f\x58\xac\x4c\xe4\x0d\x89\x44\x22\x91\x00\x32\xdf\x6e\xb3\xa2\xec\x16\xe9\xd3\xf4\x38\xdd\xe6\x55\xbd\x2e\xbb\x2e\xed\xca\xf5\xf5\xe3\x55\xd3\xf5\x65\x91\xbe\xac\x7a\xfa\xdd\x7e\xaa\x16\x65\x92\xac\x9a\x4d\x49\xa0\xaf\xe8\x4f\x52\xe4\xdd\x6a\xde\xe4\x6d\x41\x09\xa7\xf6\x9d\x94\x9f\xb7\xeb\xa6\x65\xa0\x9f\xe5\x2b\x59\x95\xeb\x2d\x97\xa1\x3f\x49\x57\x2d\xeb\xac\xaa\xe9\xe7\x25\x7d\xa5\xaf\x6b\x49\x69\x76\xbd\x25\x9d\xef\x7a\x49\xdb\x6d\x2d\xe9\x97\x6d\xd2\x96\xcb\x8a\x7a\xd3\x52\xd2\x3b\xfd\x4c\xf6\xe5\xbc\xab\x7a\x6e\xe9\x2f\xf2\x95\x7c\x2a\xdb\xae\x6a\xb8\xf6\x3f\xcb\x57\xb2\xcd\x97\x0c\x70\x41\x7f\x92\xbe\xdc\x6c\xd7\x39\x0a\x5c\xe9\x67\xb2\xce\xeb\xe5\x4e\x60\xde\xe8\x67\xb2\x68\x4b\xca\xca\xea\x72\x4f\xa9\x27\xf8\x31\x9b\xcd\x92\x1d\x21\x21\xdb\xb6\xcd\x75\xb5\x2e\xb3\xbc\x2e\xb2\x8d\x0c\xf3\x17\x4a\x4f\x35\x3d\xa5\xf4\x94\xd3\x31\x84\xb2\xa0\xa1\x66\x79\xa7\xe3\x20\x5c\xd2\xc8\xf3\x2e\x41\x55\x75\xbe\xb1\xd2\xfc\x99\x94\x9b\xbc\x5a\x33\xd6\x1e\xf3\x07\x75\xbc\xeb\xf6\x0d\x70\x7b\xa1\x9f\x84\x84\xac\xbf\xd9\x96\xc0\xc1\xe3\x2b\xfa\x4a\x16\xf9\xb6\x5f\xac\x72\xee\xa7\x7c\x25\x04\xb4\x6d\x08\x19\x4d\x7b\x03\x38\xfb\x91\x34\xed\x32\xaf\xab\xbf\xe7\xbd\x20\xe8\x3c\xf8\x99\x6c\xaa\xb6\x6d\x18\xb7\x67\xf8\x48\x68\xe8\x19\xd7\x43\x29\x6f\x09\x0b\x41\x2d\x9c\xb3\xa9\x96\xad\xa0\x91\x33\xcf\xf0\x8b\x6b\xe1\xbc\xeb\xa6\xfd\xa8\x19\x2f\xf8\x73\x50\x94\x3a\xa1\xb9\x71\xfb\x79\x4d\x88\xd7\xdc\x33\xfc\x88\x00\xba\x24\x2f\x36\x84\xca\x6d\x5e\x97\x8c\xa3\x63\xfe\x45\x78\xa1\x5f\x49\xbe\x58\x34\xbb\xba\xcf\xba\xb2\xef\xab\x7a\xc9\xc8\x3e\x96\xa4\xf4\x52\x93\x92\x20\xcf\xa5\xdd\x34\x3b\x37\x9d\x94\xfe\x57\xfa\x99\x5e\xc8\x4f\xc9\x0b\x0a\x21\xd3\x95\xe4\x91\x74\xd9\x75\x59\x16\x32\x96\x2e\x7d\x41\xdf\xc9\x76\xb7\x5e\x13\xd6\x7e\xdb\x95\x5d\xcf\x85\x2e\xe8\x37\x8d\x5f\x7e\x27\x55\xd7\xd1\x07\x25\xbf\xc6\x47\x42\x53\x57\x2f\x30\x98\x13\x7c\x24\xc9\xfb\xae\xcc\xdb\xc5\xea\x43\x22\x7f\xd1\x57\xfe\x60\xda\x3b\x34\xa9\x4c\x48\x4a\x44\xd2\x82\x35\x90\x2c\x9a\x82\x7f\x9c\xd0\x1f\xaa\xba\xaa\xbb\x3e\x5f\xaf\x3f\x24\xfa\xc1\x60\xf2\x25\x13\xd0\x57\x3d\xb0\xa0\x89\xe9\x65\x5f\x6e\x3b\x9e\xc1\xf4\x45\xd5\x76\xfd\xe3\xbe\x22\x62\x7d\xb7\xab\x93\xa2\x59\x7c\xa4\x65\xc0\x4b\x1a\x2d\xbf\xbe\x4e\x09\x59\x0f\x68\x21\xb4\xbb\xba\x26\xf4\xa4\x2f\x1b\x42\x19\x35\x53\x51\xfb\xa7\x80\x3e\x4a\xb7\xeb\x32\xef\x08\xa4\xcc\x8b\xf4\xc7\x3c\xed\xf3\x76\x59\xf6\x4f\xef\x65\x73\x5a\x7e\x1f\xef\xa5\xab\xb6\xbc\x7e\x7a\xef\x7e\x77\xef\xd9\xcb\x1d\x15\x5b\x57\x75\xd9\xfd\xf8\x24\x7f\x96\x2e\x72\xca\x21\x34\xde\xa4\xf3\xf2\x9a\x57\x1b\xb5\x95\x12\x95\xd7\x4b\x5e\x69\x37\xfd\x8a\x1b\x24\x4a\xa0\x8f\x2e\xe5\xa5\xfe\x4d\xc2\x13\x40\xac\x20\x2b\xe6\xc6\xd6\xd0\x21\x24\xb7\x34\x01\x67\x37\x97\x7f\x7a\x73\x94\x5e\x10\x6f\x5b\xb6\x25\xbe\xe9\x3f\x2a\xf1\x7d\x4a\xa3\xbd\xaa\x4e\x9f\xcf\x12\x2a\x6b\x08\x39\xcd\xfb\x7c\xce\x7d\x77\xb3\xcf\x99\xb2\x08\x5d\x1e\x96\x22\x73\x4b\x70\xc6\xae\x8f\xa6\x65\x6a\x21\x53\x1d\xba\xfc\x5d\x1d\x6f\x99\x07\x50\xba\xc3\xec\x85\xe0\x8c\xaa\x4a\x5f\xbf\x7d\x7b\x7e\xfa\x3c\x2d\xeb\x25\x61\x26\xdd\x57\xfd\x2a\xdd\xf5\xd7\xff\x3d\x5b\x96\x75\xd9\xe6\xeb\x6c\x51\x31\x52\x5a\x22\xd8\x94\xb0\x24\x43\x9c\x25\x5d\xb7\x26\x16\x05\x2a\xb8\xbc\x7c\x93\x9e\x31\x25\x6c\xf3\x7e\x85\x8e\xf4\xab\xa4\xfb\x6d\xcd\x88\x72\x0d\x5e\xad\xca\x14\x8b\x01\x40\xcd\xf5\x10\x2f\x69\xa1\x7d\x9d\x25\x65\xdb\x66\xc4\x41\xfb\x1b\x46\xb3\xd6\x79\x08\x5a\xaa\x23\x6a\xaf\x9b\x9e\xa6\x31\x45\x39\xa9\xa2\xaa\x3f\xe5\xeb\xaa\x20\x64\x7b\x84\xc4\x65\x91\x58\x34\x34\x6f\x5c\x9a\x28\xb3\xd9\x63\xa8\xf9\x82\x36\x80\x2e\xbd\x37\xbb\x07\x8e\x7b\xef\xf1\xbd\x59\x52\x37\x99\x70\x09\xe6\xcd\x45\xd5\xe5\x73\xe2\xd3\xb2\x6f\xb4\xc6\xf5\xfe\xca\xf4\x23\x5d\x51\x88\x34\x82\x60\xdc\xf2\x5e\x84\x2d\x80\x89\x2b\x27\x86\x0d\x66\xa3\x6c\x26\x1c\xbb\xf1\x24\x37\xbf\xc2\x96\x5c\xc2\x68\xcc\x89\x4d\x98\x51\xd7\xf1\x76\xbb\xae\x16\xd2\xf4\x4b\xc9\xf3\x84\xc6\x3b\xb3\x22\x25\x84\x03\xa1\x58\x5e\x40\x2e\xd4\x6b\x66\x5b\x69\xc4\xe7\x51\x7e\x55\xd2\xca\x59\xed\x96\xb2\x3b\xad\x9b\x5d\xf1\x0d\x18\x8a\xcd\x9c\xe7\x27\xe9\xbb\x86\x3a\x0c\xea\x70\x00\xbe\x89\x63\x62\x0c\x2c\x0c\xb4\xe5\xa6\xe9\x19\x71\x5a\xac\xa2\xe9\xd9\x57\x94\x49\x23\xed\xf2\x4f\xc4\x16\xfb\x46\x96\x64\x41\x4b\x6e\xc1\x15\x13\x07\xdb\xd1\x8e\x2e\xcb\x82\xf8\x88\x2c\x0d\x4b\x8b\x69\x10\x50\x9b\x1d\xad\xa6\x15\x55\xc6\x88\x67\x89\x84\xaa\x9c\xea\x27\x86\x44\xf5\x60\x95\xd3\xca\x6d\x68\xf3\xe4\x89\x3e\xc5\x87\xfe\x0e\xeb\xa7\x5e\xe5\xd7\xd7\xd4\xab\x8e\x56\xc5\xab\x74\xb1\x6e\x68\x49\xfd\xf2\xee\x4d\xc7\x0b\x66\x95\x6d\x9b\x16\x92\x08\x65\x5d\xd0\xa7\x4b\x0b\x10\xcd\x10\xf5\x6e\x33\xa7\x5f\xfb\x55\x45\x8c\x1a\x68\xe7\x12\x2c\x25\x51\x2a\x35\xb1\xeb\x68\x0a\x8f\x52\x5a\xcLine truncated var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xbc\x7d\xeb\x72\xdc\x48\xae\xe6\x7f\x3e\x05\xdb\x13\x0e\xdb\x11\x72\x39\xba\xfb\xec\x25\x3a\xda\xee\x95\xa5\xf6\x65\x8e\x65\x69\x2c\xf5\xcc\xce\x3a\x1c\x6c\x56\x91\xaa\xe2\xb8\x8a\xac\x26\x59\x2e\x6b\x4e\x9c\x88\x7d\x80\x7d\x80\xdd\xd7\x3b\x4f\xb2\xc0\x07\x20\x2f\x24\x4b\xb2\x7b\x26\x8e\x7f\x58\xac\x4c\xe4\x0d\x89\x44\x22\x91\x00\x32\xdf\x6e\xb3\xa2\xec\x16\xe9\xd3\xf4\x38\xdd\xe6\x55\xbd\x2e\xbb\x2e\xed\xca\xf5\xf5\xe3\x55\xd3\xf5\x65\x91\xbe\xac\x7a\xfa\xdd\x7e\xaa\x16\x65\x92\xac\x9a\x4d\x49\xa0\xaf\xe8\x4f\x52\xe4\xdd\x6a\xde\xe4\x6d\x41\x09\xa7\xf6\x9d\x94\x9f\xb7\xeb\xa6\x65\xa0\x9f\xe5\x2b\x59\x95\xeb\x2d\x97\xa1\x3f\x49\x57\x2d\xeb\xac\xaa\xe9\xe7\x25\x7d\xa5\xaf\x6b\x49\x69\x76\xbd\x25\x9d\xef\x7a\x49\xdb\x6d\x2d\xe9\x97\x6d\xd2\x96\xcb\x8a\x7a\xd3\x52\xd2\x3b\xfd\x4c\xf6\xe5\xbc\xab\x7a\x6e\xe9\x2f\xf2\x95\x7c\x2a\xdb\xae\x6a\xb8\xf6\x3f\xcb\x57\xb2\xcd\x97\x0c\x70\x41\x7f\x92\xbe\xdc\x6c\xd7\x39\x0a\x5c\xe9\x67\xb2\xce\xeb\xe5\x4e\x60\xde\xe8\x67\xb2\x68\x4b\xca\xca\xea\x72\x4f\xa9\x27\xf8\x31\x9b\xcd\x92\x1d\x21\x21\xdb\xb6\xcd\x75\xb5\x2e\xb3\xbc\x2e\xb2\x8d\x0c\xf3\x17\x4a\x4f\x35\x3d\xa5\xf4\x94\xd3\x31\x84\xb2\xa0\xa1\x66\x79\xa7\xe3\x20\x5c\xd2\xc8\xf3\x2e\x41\x55\x75\xbe\xb1\xd2\xfc\x99\x94\x9b\xbc\x5a\x33\xd6\x1e\xf3\x07\x75\xbc\xeb\xf6\x0d\x70\x7b\xa1\x9f\x84\x84\xac\xbf\xd9\x96\xc0\xc1\xe3\x2b\xfa\x4a\x16\xf9\xb6\x5f\xac\x72\xee\xa7\x7c\x25\x04\xb4\x6d\x08\x19\x4d\x7b\x03\x38\xfb\x91\x34\xed\x32\xaf\xab\xbf\xe7\xbd\x20\xe8\x3c\xf8\x99\x6c\xaa\xb6\x6d\x18\xb7\x67\xf8\x48\x68\xe8\x19\xd7\x43\x29\x6f\x09\x0b\x41\x2d\x9c\xb3\xa9\x96\xad\xa0\x91\x33\xcf\xf0\x8b\x6b\xe1\xbc\xeb\xa6\xfd\xa8\x19\x2f\xf8\x73\x50\x94\x3a\xa1\xb9\x71\xfb\x79\x4d\x88\xd7\xdc\x33\xfc\x88\x00\xba\x24\x2f\x36\x84\xca\x6d\x5e\x97\x8c\xa3\x63\xfe\x45\x78\xa1\x5f\x49\xbe\x58\x34\xbb\xba\xcf\xba\xb2\xef\xab\x7a\xc9\xc8\x3e\x96\xa4\xf4\x52\x93\x92\x20\xcf\xa5\xdd\x34\x3b\x37\x9d\x94\xfe\x57\xfa\x99\x5e\xc8\x4f\xc9\x0b\x0a\x21\xd3\x95\xe4\x91\x74\xd9\x75\x59\x16\x32\x96\x2e\x7d\x41\xdf\xc9\x76\xb7\x5e\x13\xd6\x7e\xdb\x95\x5d\xcf\x85\x2e\xe8\x37\x8d\x5f\x7e\x27\x55\xd7\xd1\x07\x25\xbf\xc6\x47\x42\x53\x57\x2f\x30\x98\x13\x7c\x24\xc9\xfb\xae\xcc\xdb\xc5\xea\x43\x22\x7f\xd1\x57\xfe\x60\xda\x3b\x34\xa9\x4c\x48\x4a\x44\xd2\x82\x35\x90\x2c\x9a\x82\x7f\x9c\xd0\x1f\xaa\xba\xaa\xbb\x3e\x5f\xaf\x3f\x24\xfa\xc1\x60\xf2\x25\x13\xd0\x57\x3d\xb0\xa0\x89\xe9\x65\x5f\x6e\x3b\x9e\xc1\xf4\x45\xd5\x76\xfd\xe3\xbe\x22\x62\x7d\xb7\xab\x93\xa2\x59\x7c\xa4\x65\xc0\x4b\x1a\x2d\xbf\xbe\x4e\x09\x59\x0f\x68\x21\xb4\xbb\xba\x26\xf4\xa4\x2f\x1b\x42\x19\x35\x53\x51\xfb\xa7\x80\x3e\x4a\xb7\xeb\x32\xef\x08\xa4\xcc\x8b\xf4\xc7\x3c\xed\xf3\x76\x59\xf6\x4f\xef\x65\x73\x5a\x7e\x1f\xef\xa5\xab\xb6\xbc\x7e\x7a\xef\x7e\x77\xef\xd9\xcb\x1d\x15\x5b\x57\x75\xd9\xfd\xf8\x24\x7f\x96\x2e\x72\xca\x21\x34\xde\xa4\xf3\xf2\x9a\x57\x1b\xb5\x95\x12\x95\xd7\x4b\x5e\x69\x37\xfd\x8a\x1b\x24\x4a\xa0\x8f\x2e\xe5\xa5\xfe\x4d\xc2\x13\x40\xac\x20\x2b\xe6\xc6\xd6\xd0\x21\x24\xb7\x34\x01\x67\x37\x97\x7f\x7a\x73\x94\x5e\x10\x6f\x5b\xb6\x25\xbe\xe9\x3f\x2a\xf1\x7d\x4a\xa3\xbd\xaa\x4e\x9f\xcf\x12\x2a\x6b\x08\x39\xcd\xfb\x7c\xce\x7d\x77\xb3\xcf\x99\xb2\x08\x5d\x1e\x96\x22\x73\x4b\x70\xc6\xae\x8f\xa6\x65\x6a\x21\x53\x1d\xba\xfc\x5d\x1d\x6f\x99\x07\x50\xba\xc3\xec\x85\xe0\x8c\xaa\x4a\x5f\xbf\x7d\x7b\x7e\xfa\x3c\x2d\xeb\x25\x61\x26\xdd\x57\xfd\x2a\xdd\xf5\xd7\xff\x3d\x5b\x96\x75\xd9\xe6\xeb\x6c\x51\x31\x52\x5a\x22\xd8\x94\xb0\x24\x43\x9c\x25\x5d\xb7\x26\x16\x05\x2a\xb8\xbc\x7c\x93\x9e\x31\x25\x6c\xf3\x7e\x85\x8e\xf4\xab\xa4\xfb\x6d\xcd\x88\x72\x0d\x5e\xad\xca\x14\x8b\x01\x40\xcd\xf5\x10\x2f\x69\xa1\x7d\x9d\x25\x65\xdb\x66\xc4\x41\xfb\x1b\x46\xb3\xd6\x79\x08\x5a\xaa\x23\x6a\xaf\x9b\x9e\xa6\x31\x45\x39\xa9\xa2\xaa\x3f\xe5\xeb\xaa\x20\x64\x7b\x84\xc4\x65\x91\x58\x34\x34\x6f\x5c\x9a\x28\xb3\xd9\x63\xa8\xf9\x82\x36\x80\x2e\xbd\x37\xbb\x07\x8e\x7b\xef\xf1\xbd\x59\x52\x37\x99\x70\x09\xe6\xcd\x45\xd5\xe5\x73\xe2\xd3\xb2\x6f\xb4\xc6\xf5\xfe\xca\xf4\x23\x5d\x51\x88\x34\x82\x60\xdc\xf2\x5e\x84\x2d\x80\x89\x2b\x27\x86\x0d\x66\xa3\x6c\x26\x1c\xbb\xf1\x24\x37\xbf\xc2\x96\x5c\xc2\x68\xcc\x89\x4d\x98\x51\xd7\xf1\x76\xbb\xae\x16\xd2\xf4\x4b\xc9\xf3\x84\xc6\x3b\xb3\x22\x25\x84\x03\xa1\x58\x5e\x40\x2e\xd4\x6b\x66\x5b\x69\xc4\xe7\x51\x7e\x55\xd2\xca\x59\xed\x96\xb2\x3b\xad\x9b\x5d\xf1\x0d\x18\x8a\xcd\x9c\xe7\x27\xe9\xbb\x86\x3a\x0c\xea\x70\x00\xbe\x89\x63\x62\x0c\x2c\x0c\xb4\xe5\xa6\xe9\x19\x71\x5a\xac\xa2\xe9\xd9\x57\x94\x49\x23\xed\xf2\x4f\xc4\x16\xfb\x46\x96\x64\x41\x4b\x6e\xc1\x15\x13\x07\xdb\xd1\x8e\x2e\xcb\x82\xf8\x88\x2c\x0d\x4b\x8b\x69\x10\x50\x9b\x1d\xad\xa6\x15\x55\xc6\x88\x67\x89\x84\xaa\x9c\xea\x27\x86\x44\xf5\x60\x95\xd3\xca\x6d\x68\xf3\xe4\x89\x3e\xc5\x87\xfe\x0e\xeb\xa7\x5e\xe5\xd7\xd7\xd4\xab\x8e\x56\xc5\xab\x74\xb1\x6e\x68\x49\xfd\xf2\xee\x4d\xc7\x0b\x66\x95\x6d\x9b\x16\x92\x08\x65\x5d\xd0\xa7\x4b\x0b\x10\xcd\x10\xf5\x6e\x33\xa7\x5f\xfb\x55\x45\x8c\x1a\x68\xe7\x12\x2c\x25\x51\x2a\x35\xb1\xeb\x68\x0a\x8f\x52\x5a\xcLine truncated
func confLocaleLocale_enUsIniBytes() ([]byte, error) { func confLocaleLocale_enUsIniBytes() ([]byte, error) {
return bindataRead( return bindataRead(
@@ -4379,7 +4379,7 @@ func confLocaleLocale_enUsIni() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 45167, mode: os.FileMode(420), modTime: time.Unix(1447958597, 0)} info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 45418, mode: os.FileMode(420), modTime: time.Unix(1448004807, 0)}
a := &asset{bytes: bytes, info: info} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
+3
View File
@@ -5,6 +5,7 @@
package git package git
import ( import (
"errors"
"path/filepath" "path/filepath"
) )
@@ -21,6 +22,8 @@ func OpenRepository(repoPath string) (*Repository, error) {
repoPath, err := filepath.Abs(repoPath) repoPath, err := filepath.Abs(repoPath)
if err != nil { if err != nil {
return nil, err return nil, err
} else if !isDir(repoPath) {
return nil, errors.New("no such file or directory")
} }
return &Repository{Path: repoPath}, nil return &Repository{Path: repoPath}, nil
+15 -2
View File
@@ -27,9 +27,9 @@ func Releases(ctx *middleware.Context) {
return return
} }
rels, err := models.GetReleasesByRepoId(ctx.Repo.Repository.ID) rels, err := models.GetReleasesByRepoID(ctx.Repo.Repository.ID)
if err != nil { if err != nil {
ctx.Handle(500, "GetReleasesByRepoId", err) ctx.Handle(500, "GetReleasesByRepoID", err)
return return
} }
@@ -212,6 +212,7 @@ func EditRelease(ctx *middleware.Context) {
} }
return return
} }
ctx.Data["ID"] = rel.ID
ctx.Data["tag_name"] = rel.TagName ctx.Data["tag_name"] = rel.TagName
ctx.Data["tag_target"] = rel.Target ctx.Data["tag_target"] = rel.Target
ctx.Data["title"] = rel.Title ctx.Data["title"] = rel.Title
@@ -257,3 +258,15 @@ func EditReleasePost(ctx *middleware.Context, form auth.EditReleaseForm) {
} }
ctx.Redirect(ctx.Repo.RepoLink + "/releases") ctx.Redirect(ctx.Repo.RepoLink + "/releases")
} }
func DeleteRelease(ctx *middleware.Context) {
if err := models.DeleteReleaseByID(ctx.QueryInt64("id")); err != nil {
ctx.Flash.Error("DeleteReleaseByID: " + err.Error())
} else {
ctx.Flash.Success(ctx.Tr("repo.release.deletion_success"))
}
ctx.JSON(200, map[string]interface{}{
"redirect": ctx.Repo.RepoLink + "/releases",
})
}
+1 -1
View File
@@ -1 +1 @@
0.7.18.1119 Beta 0.7.19.1120 Beta
+1
View File
@@ -3,6 +3,7 @@
{{template "repo/header" .}} {{template "repo/header" .}}
<div class="ui container"> <div class="ui container">
{{template "repo/sidebar" .}} {{template "repo/sidebar" .}}
{{template "base/alert" .}}
<h2 class="ui header"> <h2 class="ui header">
{{.i18n.Tr "repo.release.releases"}} {{.i18n.Tr "repo.release.releases"}}
{{if .IsRepositoryAdmin}} {{if .IsRepositoryAdmin}}
+16
View File
@@ -68,6 +68,9 @@
<button class="ui green button"> <button class="ui green button">
{{.i18n.Tr "repo.release.edit_release"}} {{.i18n.Tr "repo.release.edit_release"}}
</button> </button>
<a class="ui red button delete-button" data-url="{{$.RepoLink}}/releases/delete" data-id="{{.ID}}">
{{$.i18n.Tr "repo.release.delete_release"}}
</a>
{{else}} {{else}}
<button class="ui green button"> <button class="ui green button">
{{.i18n.Tr "repo.release.publish"}} {{.i18n.Tr "repo.release.publish"}}
@@ -80,4 +83,17 @@
</form> </form>
</div> </div>
</div> </div>
{{if .PageIsEditRelease}}
<div class="ui small basic delete modal">
<div class="ui icon header">
<i class="trash icon"></i>
{{.i18n.Tr "repo.release.deletion"}}
</div>
<div class="content">
<p>{{.i18n.Tr "repo.release.deletion_desc"}}</p>
</div>
{{template "base/delete_modal_actions" .}}
</div>
{{end}}
{{template "base/footer" .}} {{template "base/footer" .}}