Documentation
¶
Overview ¶
Package jj replays revisions in a Jujutsu workspace (vcs.Replayer).
Index ¶
- Constants
- type Replayer
- func (j Replayer) Abort(ctx context.Context, ws vcs.Workspace) error
- func (j Replayer) Continue(ctx context.Context, ws vcs.Workspace) (vcs.Replay, error)
- func (j Replayer) Replay(ctx context.Context, ws vcs.Workspace, req vcs.ReplayRequest) (vcs.Replay, error)
- func (j Replayer) ReplayStatus(ctx context.Context, ws vcs.Workspace) (vcs.Replay, error)
Constants ¶
const StateFile = "core-replay.json"
StateFile is the file in the workspace's .jj directory that holds a replay in progress.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Replayer ¶
type Replayer struct {
// Bin is the jj executable; empty is "jj".
Bin string
// User and Email are who a replayed revision is committed by; empty
// is "vcs replay" and "replay@localhost". The author is the original's.
User, Email string
}
Replayer replays revisions in a Jujutsu workspace with `jj duplicate`: the originals and every bookmark stay where they are, and the replayed revisions are new changes, one per original, with the original's description and author. A duplicate has a change id of its own, so a replay reports each original beside its duplicate (vcs.Replay.Commits), and change ids, which are random, make no two replays alike.
jj records a conflict in the revision instead of stopping, so a replay always creates every revision. When one conflicts, the working copy is put on a new change on top of the first that does, where jj writes the conflict markers into the files; Continue squashes the caller's resolution into it, jj rebases the revisions above it, and the replay moves on to the next one that conflicts. A finished replay leaves the working copy on a new change on top of the candidate. The replay's state is kept in the workspace's .jj directory (StateFile).
The zero Replayer runs "jj" from PATH, with no user configuration of the caller's: jj is given a configuration of its own (JJ_CONFIG). It fetches and pushes nothing.
func (Replayer) Abort ¶
Abort abandons the replayed revisions, and the working copy on them, and returns the working copy to the change it was before the replay.
func (Replayer) Continue ¶
Continue squashes the working copy, the caller's resolution, into the replayed revision under it, and moves the working copy to the next one that conflicts, or finishes.