// FolderRevisions returns FolderRevisions created by the current user.
186274
func (c oauthClient) FolderRevisions() ([]wl.FolderRevision, error) {
	url := fmt.Sprintf(
		"%s/folder_revisions",
		c.apiURL,
	)

	req, err := c.newGetRequest(url)
	if err != nil {
		return nil, err
	}

	resp, err := c.do(req)
	if err != nil {
		return nil, err
	}

	if resp.StatusCode != http.StatusOK {
		return nil, fmt.Errorf("Unexpected response code %d - expected %d", resp.StatusCode, http.StatusOK)
	}

	folders := []wl.FolderRevision{}
	err = json.NewDecoder(resp.Body).Decode(&folders)
	if err != nil {
		return nil, err
	}
	return folders, nil
}
714501
func (c Checker) getDirsRecursive(base, rev, rel, prefix string) (dirs []string) {
	paths, err := c.vcs.ReadDir(rev, filepath.Join(base, rel))
	if err != nil {
		c.logf("could not read path: %s revision: %s, error: %s\n", filepath.Join(base, rel), rev, err)
		return dirs
	}

	for _, path := range paths {
		if !path.IsDir() || path.Name() == "testdata" {
			continue
		}

		dirs = append(dirs, prefix+filepath.Join(rel, path.Name()))
		dirs = append(dirs, c.getDirsRecursive(base, rev, filepath.Join(rel, path.Name()), prefix)...)
	}
	return dirs
}
324968
func FindEqualRevisions(revisions []*apps.ControllerRevision, needle *apps.ControllerRevision) []*apps.ControllerRevision {
	var eq []*apps.ControllerRevision
	for i := range revisions {
		if EqualRevision(revisions[i], needle) {
			eq = append(eq, revisions[i])
		}
	}
	return eq
}
955371
func (fs *KBFSOpsStandard) FolderStatus(
	ctx context.Context, folderBranch data.FolderBranch) (
	FolderBranchStatus, <-chan StatusUpdate, error) {
	timeTrackerDone := fs.longOperationDebugDumper.Begin(ctx)
	defer timeTrackerDone()

	ops := fs.getOps(ctx, folderBranch, FavoritesOpNoChange)
	return ops.FolderStatus(ctx, folderBranch)
}
1014745
func (s *ListConfigurationRevisionsResponse) SetRevisions(v []*ConfigurationRevision) *ListConfigurationRevisionsResponse {
	s.Revisions = v
	return s
}
149841
func (c *Files) CreateFolder(in *CreateFolderInput) (out *CreateFolderOutput, err error) {
	body, err := c.call("/files/create_folder", in)
	if err != nil {
		return
	}
	defer body.Close()

	err = json.NewDecoder(body).Decode(&out)
	return
}
677322
func (th *TlfHistory) FlushRevision(rev kbfsmd.Revision) {
	th.lock.Lock()
	defer th.lock.Unlock()
	if th.unflushed == nil {
		return
	}
	lastToKeep := len(th.unflushed.notifications) - 1
	for ; lastToKeep >= 0; lastToKeep-- {
		if th.unflushed.notifications[lastToKeep].Revision > rev {
			break
		}
	}
	if lastToKeep < len(th.unflushed.notifications)-1 {
		th.unflushed.notifications = th.unflushed.notifications[:lastToKeep+1]
		// Invalidate the cached results.
		th.computed = false
		th.cachedLoggedInUser = ""
	}
}
566318
func (s *controllerRevisionLister) ControllerRevisions(namespace string) ControllerRevisionNamespaceLister {
	return controllerRevisionNamespaceLister{indexer: s.indexer, namespace: namespace}
}
409671
func (w *Watcher) watchFolders() {
	wd, err := w.prepareRootDir()

	if err != nil {
		log.Fatalf("Could not get root working directory: %s", err)
	}

	filepath.Walk(wd, func(path string, info os.FileInfo, err error) error {
		// skip files
		if info == nil {
			log.Fatalf("wrong watcher package: %s", path)
		}

		if !info.IsDir() {
			return nil
		}

		if !w.watchVendor {
			// skip vendor directory
			vendor := fmt.Sprintf("%s/vendor", wd)
			if strings.HasPrefix(path, vendor) {
				return filepath.SkipDir
			}
		}

		// skip hidden folders
		if len(path) > 1 && strings.HasPrefix(filepath.Base(path), ".") {
			return filepath.SkipDir
		}

		w.addFolder(path)

		return err
	})
}
233522
func (l *AuditLog) auditDirs() ([]string, error) {
	authServers, err := l.getAuthServers()
	if err != nil {
		return nil, trace.Wrap(err)
	}

	var out []string
	for _, serverID := range authServers {
		out = append(out, filepath.Join(l.DataDir, serverID))
	}
	return out, nil
}
1199538
func NewCreateFolderResult(Metadata *FolderMetadata) *CreateFolderResult {
	s := new(CreateFolderResult)
	s.Metadata = Metadata
	return s
}
1138590
func (d *SourceFilesystem) RealDirs(from string) []string {
	var dirnames []string
	for _, dir := range d.Dirnames {
		dirname := filepath.Join(dir, from)
		if _, err := d.SourceFs.Stat(dirname); err == nil {
			dirnames = append(dirnames, dirname)
		}
	}
	return dirnames
}
58601
func (s *Store) GetRevision(context.Context, string, string) (store.Secret, error) {
	return nil, fmt.Errorf("not supported")
}
117489
func NewCreateFolderEntryResult(Metadata *FolderMetadata) *CreateFolderEntryResult {
	s := new(CreateFolderEntryResult)
	s.Metadata = Metadata
	return s
}
1248606
func (f *folder) restartWatch() {
	f.stopWatch()
	f.startWatch()
	f.scanSubdirs(nil)
}
276195
func (s *Store) ListRevisions(ctx context.Context, name string) ([]backend.Revision, error) {
	p := s.passfile(name)
	return s.rcs.Revisions(ctx, p)
}
495129
func (g *Git) DefaultRevision() (string, string) {
	// Check if there's unstaged changes, if so, return dot
	contents, _ := exec.Command("git", "--git-dir", g.dir, "ls-files", "-m").Output()
	if len(contents) > 0 {
		return "HEAD", "."
	}
	return "HEAD~1", "HEAD"
}