diff --git a/misc/author/integration_test.sh b/misc/author/integration_test.sh index 0485d2c..baf3084 100755 --- a/misc/author/integration_test.sh +++ b/misc/author/integration_test.sh @@ -19,6 +19,7 @@ export GHQ_ROOT=$tmpdir ghq get www.mercurial-scm.org/repo/hello ghq get https://launchpad.net/shutter ghq get --vcs fossil https://www.sqlite.org/src + ghq get http://chiselapp.com/user/sti/repository/fossil-gui ghq get --shallow --vcs=git-svn https://svn.apache.org/repos/asf/httpd/httpd ghq get https://svn.apache.org/repos/asf/subversion ghq get --shallow hub.darcs.net/byorgey/split @@ -28,6 +29,7 @@ export GHQ_ROOT=$tmpdir test -d $tmpdir/www.mercurial-scm.org/repo/hello/.hg test -d $tmpdir/launchpad.net/shutter/.bzr test -f $tmpdir/www.sqlite.org/src/.fslckout + test -f $tmpdir/chiselapp.com/user/sti/repository/fossil-gui/.fslckout test -d $tmpdir/svn.apache.org/repos/asf/httpd/httpd/.git/svn test -d $tmpdir/svn.apache.org/repos/asf/subversion/.svn test -d $tmpdir/hub.darcs.net/byorgey/split/_darcs @@ -35,7 +37,9 @@ export GHQ_ROOT=$tmpdir : testing 'ghq list' cat < $tmpdir/expect +chiselapp.com/user/sti/repository/fossil-gui github.com/x-motemen/ghq +github.com/x-motemen/gore.git www.mercurial-scm.org/repo/hello launchpad.net/shutter www.sqlite.org/src diff --git a/remote_repository.go b/remote_repository.go index 8db882d..131bb4f 100644 --- a/remote_repository.go +++ b/remote_repository.go @@ -134,6 +134,25 @@ func (repo *CodeCommitRepository) VCS() (*VCSBackend, *url.URL, error) { return GitBackend, &u, nil } +type ChiselRepository struct { + url *url.URL +} + +// URL returns URL of the repository +func (repo *ChiselRepository) URL() *url.URL { + return repo.url +} + +// IsValid determine if the repository is valid or not +func (repo *ChiselRepository) IsValid() bool { + return true +} + +// VCS returns VCSBackend of the repository +func (repo *ChiselRepository) VCS() (*VCSBackend, *url.URL, error) { + return FossilBackend, repo.URL(), nil +} + // OtherRepository represents other repository type OtherRepository struct { url *url.URL @@ -219,6 +238,8 @@ func NewRemoteRepository(u *url.URL) (RemoteRepository, error) { return &DarksHubRepository{u} case "nest.pijul.com": return &NestPijulRepository{u} + case "chiselapp.com": + return &ChiselRepository{u} default: return &OtherRepository{u} }