Pārlūkot izejas kodu

#2569 delete repo local copy when transfer

Remote repository path is renamed but does not delete
outdated local copy which still has old repository path
as remote.
tags/v0.9.99
Unknwon pirms 8 gadiem
vecāks
revīzija
9adfe453d5
6 mainītis faili ar 9 papildinājumiem un 7 dzēšanām
  1. 1
    1
      .gopmfile
  2. 1
    1
      README.md
  3. 1
    1
      cmd/web.go
  4. 1
    1
      gogs.go
  5. 4
    2
      models/repo.go
  6. 1
    1
      templates/.VERSION

+ 1
- 1
.gopmfile Parādīt failu

[deps] [deps]
github.com/bradfitz/gomemcache = commit:fb1f79c github.com/bradfitz/gomemcache = commit:fb1f79c
github.com/codegangsta/cli = commit:cf1f63a github.com/codegangsta/cli = commit:cf1f63a
github.com/go-macaron/binding = commit:2502aaf
github.com/go-macaron/binding =
github.com/go-macaron/cache = commit:5617353 github.com/go-macaron/cache = commit:5617353
github.com/go-macaron/captcha = commit:8aa5919 github.com/go-macaron/captcha = commit:8aa5919
github.com/go-macaron/csrf = commit:715bca0 github.com/go-macaron/csrf = commit:715bca0

+ 1
- 1
README.md Parādīt failu



![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true) ![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true)


##### Current version: 0.8.33
##### Current version: 0.8.34


| Web | UI | Preview | | Web | UI | Preview |
|:-------------:|:-------:|:-------:| |:-------------:|:-------:|:-------:|

+ 1
- 1
cmd/web.go Parādīt failu

// Check dependency version. // Check dependency version.
checkers := []VerChecker{ checkers := []VerChecker{
{"github.com/go-xorm/xorm", func() string { return xorm.Version }, "0.4.4.1029"}, {"github.com/go-xorm/xorm", func() string { return xorm.Version }, "0.4.4.1029"},
{"github.com/go-macaron/binding", binding.Version, "0.1.0"},
{"github.com/go-macaron/binding", binding.Version, "0.2.1"},
{"github.com/go-macaron/cache", cache.Version, "0.1.2"}, {"github.com/go-macaron/cache", cache.Version, "0.1.2"},
{"github.com/go-macaron/csrf", csrf.Version, "0.0.3"}, {"github.com/go-macaron/csrf", csrf.Version, "0.0.3"},
{"github.com/go-macaron/i18n", i18n.Version, "0.2.0"}, {"github.com/go-macaron/i18n", i18n.Version, "0.2.0"},

+ 1
- 1
gogs.go Parādīt failu

"github.com/gogits/gogs/modules/setting" "github.com/gogits/gogs/modules/setting"
) )


const APP_VER = "0.8.33.0210"
const APP_VER = "0.8.34.0214"


func init() { func init() {
runtime.GOMAXPROCS(runtime.NumCPU()) runtime.GOMAXPROCS(runtime.NumCPU())

+ 4
- 2
models/repo.go Parādīt failu

Email: repo.MustOwner().Email, Email: repo.MustOwner().Email,
UserName: repo.MustOwner().Name, UserName: repo.MustOwner().Name,
}, },
Private: repo.IsPrivate,
Private: repo.IsPrivate,
DefaultBranch: repo.DefaultBranch, DefaultBranch: repo.DefaultBranch,
} }
} }
return fmt.Errorf("transferRepoAction: %v", err) return fmt.Errorf("transferRepoAction: %v", err)
} }


// Change repository directory name.
// Rename remote repository to new path and delete local copy.
if err = os.Rename(RepoPath(owner.Name, repo.Name), RepoPath(newOwner.Name, repo.Name)); err != nil { if err = os.Rename(RepoPath(owner.Name, repo.Name), RepoPath(newOwner.Name, repo.Name)); err != nil {
return fmt.Errorf("rename repository directory: %v", err) return fmt.Errorf("rename repository directory: %v", err)
} }
RemoveAllWithNotice("Delete repository local copy", repo.LocalCopyPath())


// Rename remote wiki repository to new path and delete local copy.
wikiPath := WikiPath(owner.Name, repo.Name) wikiPath := WikiPath(owner.Name, repo.Name)
if com.IsExist(wikiPath) { if com.IsExist(wikiPath) {
RemoveAllWithNotice("Delete repository wiki local copy", repo.LocalWikiPath()) RemoveAllWithNotice("Delete repository wiki local copy", repo.LocalWikiPath())

+ 1
- 1
templates/.VERSION Parādīt failu

0.8.33.0210
0.8.34.0214

Notiek ielāde…
Atcelt
Saglabāt