Mercurial and Git clients can push and pull from this alias URL to interact with this repository. You can change to which repository an alias points by going to the Aliases link on the project page.
packagekilnimport("encoding/json""fmt""net/url""strconv""strings")// Represents the error JSON returned by Kiln API requeststypeApiErrorstruct{// Guaranteed-unique code for Kiln errorsCodestring`json:"codeError"`// Human-readable descriptionDescriptionstring`json:"sError"`}// Represents a collection of JSON errors, as returned on API failuretypeApiErrorsmap[string][]ApiError// Represents the project JSON returned from the Kiln APItypeProjectstruct{Idint64`json:"ixProject"`Slugstring`json:"sSlug"`Namestring`json:"sName"`Descriptionstring`json:"sDescription"`DefaultPermissionstring`json:"permissionDefault"`RepoGroups[]RepoGroup}typeRepoGroupstruct{Idint64`json:"ixRepoGroup"`ProjectIdint64`json:"ixProject"`Slugstring`json:"sSlug"`Namestring`json:"sName"`Repos[]Repo`json:"repos"`}typeRepostruct{Idint64`json:"ixRepo"`RepoGroupIdint64`json:"ixRepoGroup"`ParentIdint64`json:"ixParent"`IsCentralbool`json:"fCentral"`Slugstring`json:"sSlug"`GroupSlugstring`json:"sGroupSlug"`ProjectSlugstring`json:"sProjectSlug"`GitUrlstring`json:"sGitUrl"`GitSshUrlstring`json:"sGitSshUrl"`Namestring`json:"sName"`Descriptionstring`json:"sDescription"`Statusstring`json:"sStatus"`Sizeint64`json:"bytesSize"`Vcsint`json:"vcs"`CreatorPerson`json:"personCreator"`DefaultPermissionstring`json:"permissionDefault"`Branches[]Repo`json:"repoBranches"`}typeChangesetstruct{Revstring`json:"rev"`Authorstring`json:"sAuthor"`Descriptionstring`json:"sDescription"`Bugs[]int`json:"ixBugs"`Reviews[]int`json:"ixReviews"`Vcsstring`json:"vcs"`MercurialSHAs[]string`json:"revsHg"`GitSHAs[]string`json:"revsGit"`}typePersonstruct{Idint64`json:"ixPerson"`Namestring`json:"sName"`Emailstring`json:"sEmail"`}func(k*Client)CreateBranch(repoPath,branchNamestring)(newRepo*Repo,errerror){r,err:=k.RepoForPath(repoPath)iferr!=nil{return}params:=apiParams{"sName":branchName,"ixRepoGroup":strconv.FormatInt(r.RepoGroupId,10),"ixParent":strconv.FormatInt(r.Id,10),"fCentral":"false",}varresp[]byteifresp,err=k.apiPost("Repo/Create",params);err==nil{varerrorsApiErrorsiferr=json.Unmarshal(resp,&errors);err==nil{ifkilnErr,_:=errors["errors"];len(kilnErr)>0{err=fmt.Errorf("failed: %v",kilnErr[0].Description)return}}newRepo=new(Repo)err=json.Unmarshal(resp,newRepo)return}return}func(k*Client)Projects()(projects[]Project,errerror){ifresp,err:=k.apiGet("Project",apiParams{});err==nil{err=json.Unmarshal(resp,&projects)}return}func(k*Client)RepoForPath(repoPathstring)(*Repo,error){parts:=strings.Split(repoPath,"/")iflen(parts)!=3{returnnil,fmt.Errorf("unknown repository target: %v",repoPath)}ifprojects,err:=k.Projects();err==nil{for_,project:=rangeprojects{for_,repoGroup:=rangeproject.RepoGroups{for_,repo:=rangerepoGroup.Repos{ifstrings.EqualFold(repo.ProjectSlug,parts[0])&&strings.EqualFold(repo.GroupSlug,parts[1])&&strings.EqualFold(repo.Slug,parts[2]){return&repo,nil}}}}}returnnil,fmt.Errorf("repository not found")}func(k*Client)IdForRepo(repoPathstring)(int64,error){repo,err:=k.RepoForPath(repoPath)iferr!=nil{return-1,err}returnrepo.Id,nil}func(k*Client)RelatedRepos(repoPathstring)(repos[]Repo,errerror){repoId,err:=k.IdForRepo(repoPath)iferr==nil{resp,err:=k.apiGet(fmt.Sprintf("Repo/%v/Related",repoId),apiParams{})iferr==nil{err=json.Unmarshal(resp,&repos)}}return}func(k*Client)MercurialEquivalents(repoPathstring,commits[]string)(equivalentsmap[string][]string,errerror){varrepoIdint64varresp[]byterepoId,err=k.IdForRepo(repoPath)iferr!=nil{return}resp,err=k.apiRequest(fmt.Sprintf("Repo/%v/History",repoId),url.Values{"revs":commits},"GET")iferr!=nil{return}varerrorsApiErrors if err = json.Unmarshal(resp, &errors); err == nil {
if apiErrors, _ := errors["errors"]; len(apiErrors) > 0 {
err = fmt.Errorf("failed: %v", apiErrors[0].Description)
+ return }
}
var changesets []Changeset
iferr=json.Unmarshal(resp,&changesets);err!=nil{err=fmt.Errorf("unable to process response: %v",err)}else{equivalents=make(map[string][]string)for_,changeset:=rangechangesets{equivalents[changeset.GitSHAs[0]]=changeset.MercurialSHAs}}return}
Attach a Trello Card
Add a tag
Your session has expired
You are no longer logged in. Please log in and try your request again.
Filter RSS Feed
This RSS feed URL allows you to see the contents of your current filter using any feed reader.
This link includes a special authentication token. If you share the URL with anyone else, they can see this RSS feed's activity. You can disable these tokens when needed.
Your current filter is unsaved; changing it won't affect this RSS feed.