Documentation
¶
Index ¶
- func Root() *cobra.Command
- func RunAdd(s *store.Store, idx *index.Index, repoRoot string, paths []string) error
- func RunCheckout(s *store.Store, idx *index.Index, repoRoot, commitID, storePath string) error
- func RunCheckoutRepo(s *store.Store, idx *index.Index, repoRoot, commitID string) error
- func RunClone(repoURL, repoRoot string, id *client.Identity) error
- func RunCommit(s *store.Store, idx *index.Index, message string) (string, error)
- func RunDiff(w interface{ ... }, s *store.Store, idx *index.Index, repoRoot string, ...) error
- func RunInit(repoRoot, repoURL string, id *client.Identity) error
- func RunMergeAbort(s *store.Store, idx *index.Index, repoRoot string) error
- func RunMirror(sourceURL, targetURL string, sourceID *client.Identity) (server.MirrorResponse, error)
- func RunPull(s *store.Store, idx *index.Index, repoRoot, remoteURL string, ...) error
- func RunPush(s *store.Store, remoteURL string, id *client.Identity) (client.PushResult, error)
- func RunReset(s *store.Store, idx *index.Index, repoRoot string) error
- func RunRm(s *store.Store, idx *index.Index, repoRoot, path string) error
- func RunShow(w interface{ ... }, s *store.Store, commitID string) error
- func RunStatus(w interface{ ... }, s *store.Store, idx *index.Index, repoRoot string) error
- func RunWatch(ctx context.Context, cl *client.Client, pathPrefix, events string, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunCheckout ¶
RunCheckout restores storePath to the version it had at commitID's position in history, writing it to disk and staging the change (aligns with git, which stages on checkout of a path).
func RunCheckoutRepo ¶
RunCheckoutRepo restores the entire working tree to the state at commitID, staging every resulting change (restores, modifications, and deletions).
func RunCommit ¶
RunCommit creates a commit from the current staged entries. Returns the new commit ID.
func RunDiff ¶
func RunDiff(w interface{ WriteString(string) (int, error) }, s *store.Store, idx *index.Index, repoRoot string, stagedMode bool, filterPath string) error
RunDiff writes a unified diff to w. If stagedMode is true, compares staged vs HEAD. Otherwise compares working tree vs HEAD.
func RunMergeAbort ¶
RunMergeAbort discards an in-progress merge and restores the last committed state.
func RunMirror ¶
func RunMirror(sourceURL, targetURL string, sourceID *client.Identity) (server.MirrorResponse, error)
RunMirror relocates a repo from sourceURL to an empty targetURL. The caller must be an admin (only an admin's view is complete). It reads the full source state — roster, history, objects, grants, roles — and uploads it verbatim to the target, preserving commit ids and seqs. The mirror request is signed with the admin's source key and self-authenticated against the roster it carries. It returns the signer's resulting identity on the target (principal_id preserved; username may be auto-renamed) plus any roster renames.
func RunPull ¶
func RunPull(s *store.Store, idx *index.Index, repoRoot, remoteURL string, id *client.Identity) error
RunPull fetches new server commits and merges them with the local working tree.
func RunPush ¶
RunPush pushes all unpushed local commits to remoteURL, oldest first. If any commit is rejected by OCC, it stops and returns the conflict. Returns the result of the last successfully pushed commit.
func RunReset ¶
RunReset discards all unpushed commits and restores the working tree to the last server-confirmed state.
func RunShow ¶
func RunShow(w interface{ WriteString(string) (int, error) }, s *store.Store, commitID string) error
RunShow prints a single commit to w.
func RunStatus ¶
func RunStatus(w interface{ Write([]byte) (int, error) }, s *store.Store, idx *index.Index, repoRoot string) error
RunStatus writes a git-style status report to w.
func RunWatch ¶
func RunWatch(ctx context.Context, cl *client.Client, pathPrefix, events string, cursor int64, onEvent func(server.EventJSON)) error
RunWatch streams events to onEvent, reconnecting with the last cursor after a disconnect. On each (re)connect the server replays missed commits from the durable log (catch-up), so no accepted commit is missed — the live stream is the fast path, the seq cursor is the recovery anchor.
Types ¶
This section is empty.