mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 20:36:03 +02:00
Section headers for rebase todos and actual commits (#4463)
- **PR Description** During interactive rebase, or when stopping with conflicts in a cherry-pick or revert, show section headers for the todo items and the actual commits. This makes it much clearer where the current head commit is. Get rid of the "<-- YOU ARE HERE" marker that we would previously show; it is no longer needed. (We still show the "<-- CONFLICT" marker though.) For example: ``` ╭─[4]─Commits - Reflog───────────────────────────╮ │--- Pending rebase todos --- │ │6562f903 pick CI commit 03 │ │--- Commits --- │ │56a04448 CI ◯ commit 02 │ │6d0c0e41 CI ◯ commit 01 │ ```
This commit is contained in:
commit
548d486aee
56 changed files with 324 additions and 134 deletions
|
@ -496,7 +496,7 @@ func (self *CommitLoader) getSequencerCommits() []*models.Commit {
|
||||||
commits = utils.Prepend(commits, &models.Commit{
|
commits = utils.Prepend(commits, &models.Commit{
|
||||||
Hash: t.Commit,
|
Hash: t.Commit,
|
||||||
Name: t.Msg,
|
Name: t.Msg,
|
||||||
Status: models.StatusRebasing,
|
Status: models.StatusCherryPickingOrReverting,
|
||||||
Action: t.Command,
|
Action: t.Command,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ const (
|
||||||
StatusPushed
|
StatusPushed
|
||||||
StatusMerged
|
StatusMerged
|
||||||
StatusRebasing
|
StatusRebasing
|
||||||
|
StatusCherryPickingOrReverting
|
||||||
StatusConflicted
|
StatusConflicted
|
||||||
StatusReflog
|
StatusReflog
|
||||||
)
|
)
|
||||||
|
|
|
@ -26,6 +26,8 @@ type ListContextTrait struct {
|
||||||
func (self *ListContextTrait) IsListContext() {}
|
func (self *ListContextTrait) IsListContext() {}
|
||||||
|
|
||||||
func (self *ListContextTrait) FocusLine() {
|
func (self *ListContextTrait) FocusLine() {
|
||||||
|
self.Context.FocusLine()
|
||||||
|
|
||||||
// Doing this at the end of the layout function because we need the view to be
|
// Doing this at the end of the layout function because we need the view to be
|
||||||
// resized before we focus the line, otherwise if we're in accordion mode
|
// resized before we focus the line, otherwise if we're in accordion mode
|
||||||
// the view could be squashed and won't how to adjust the cursor/origin.
|
// the view could be squashed and won't how to adjust the cursor/origin.
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package context
|
package context
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
@ -40,7 +41,6 @@ func NewLocalCommitsContext(c *ContextCommon) *LocalCommitsContext {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
showYouAreHereLabel := c.Model().WorkingTreeStateAtLastCommitRefresh.CanShowTodos()
|
|
||||||
hasRebaseUpdateRefsConfig := c.Git().Config.GetRebaseUpdateRefs()
|
hasRebaseUpdateRefsConfig := c.Git().Config.GetRebaseUpdateRefs()
|
||||||
|
|
||||||
return presentation.GetCommitListDisplayStrings(
|
return presentation.GetCommitListDisplayStrings(
|
||||||
|
@ -62,10 +62,54 @@ func NewLocalCommitsContext(c *ContextCommon) *LocalCommitsContext {
|
||||||
endIdx,
|
endIdx,
|
||||||
shouldShowGraph(c),
|
shouldShowGraph(c),
|
||||||
c.Model().BisectInfo,
|
c.Model().BisectInfo,
|
||||||
showYouAreHereLabel,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getNonModelItems := func() []*NonModelItem {
|
||||||
|
result := []*NonModelItem{}
|
||||||
|
if c.Model().WorkingTreeStateAtLastCommitRefresh.CanShowTodos() {
|
||||||
|
if c.Model().WorkingTreeStateAtLastCommitRefresh.Rebasing {
|
||||||
|
result = append(result, &NonModelItem{
|
||||||
|
Index: 0,
|
||||||
|
Content: fmt.Sprintf("--- %s ---", c.Tr.PendingRebaseTodosSectionHeader),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if c.Model().WorkingTreeStateAtLastCommitRefresh.CherryPicking ||
|
||||||
|
c.Model().WorkingTreeStateAtLastCommitRefresh.Reverting {
|
||||||
|
_, firstCherryPickOrRevertTodo, found := lo.FindIndexOf(
|
||||||
|
c.Model().Commits, func(c *models.Commit) bool {
|
||||||
|
return c.Status == models.StatusCherryPickingOrReverting ||
|
||||||
|
c.Status == models.StatusConflicted
|
||||||
|
})
|
||||||
|
if !found {
|
||||||
|
firstCherryPickOrRevertTodo = 0
|
||||||
|
}
|
||||||
|
label := lo.Ternary(c.Model().WorkingTreeStateAtLastCommitRefresh.CherryPicking,
|
||||||
|
c.Tr.PendingCherryPicksSectionHeader,
|
||||||
|
c.Tr.PendingRevertsSectionHeader)
|
||||||
|
result = append(result, &NonModelItem{
|
||||||
|
Index: firstCherryPickOrRevertTodo,
|
||||||
|
Content: fmt.Sprintf("--- %s ---", label),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
_, firstRealCommit, found := lo.FindIndexOf(
|
||||||
|
c.Model().Commits, func(c *models.Commit) bool {
|
||||||
|
return !c.IsTODO()
|
||||||
|
})
|
||||||
|
if !found {
|
||||||
|
firstRealCommit = 0
|
||||||
|
}
|
||||||
|
result = append(result, &NonModelItem{
|
||||||
|
Index: firstRealCommit,
|
||||||
|
Content: fmt.Sprintf("--- %s ---", c.Tr.CommitsSectionHeader),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
ctx := &LocalCommitsContext{
|
ctx := &LocalCommitsContext{
|
||||||
LocalCommitsViewModel: viewModel,
|
LocalCommitsViewModel: viewModel,
|
||||||
SearchTrait: NewSearchTrait(c),
|
SearchTrait: NewSearchTrait(c),
|
||||||
|
@ -82,6 +126,7 @@ func NewLocalCommitsContext(c *ContextCommon) *LocalCommitsContext {
|
||||||
ListRenderer: ListRenderer{
|
ListRenderer: ListRenderer{
|
||||||
list: viewModel,
|
list: viewModel,
|
||||||
getDisplayStrings: getDisplayStrings,
|
getDisplayStrings: getDisplayStrings,
|
||||||
|
getNonModelItems: getNonModelItems,
|
||||||
},
|
},
|
||||||
c: c,
|
c: c,
|
||||||
refreshViewportOnChange: true,
|
refreshViewportOnChange: true,
|
||||||
|
|
|
@ -54,6 +54,9 @@ func (self *SimpleContext) HandleFocusLost(opts types.OnFocusLostOpts) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (self *SimpleContext) FocusLine() {
|
||||||
|
}
|
||||||
|
|
||||||
func (self *SimpleContext) HandleRender() {
|
func (self *SimpleContext) HandleRender() {
|
||||||
if self.handleRenderFunc != nil {
|
if self.handleRenderFunc != nil {
|
||||||
self.handleRenderFunc()
|
self.handleRenderFunc()
|
||||||
|
|
|
@ -77,7 +77,6 @@ func NewSubCommitsContext(
|
||||||
endIdx,
|
endIdx,
|
||||||
shouldShowGraph(c),
|
shouldShowGraph(c),
|
||||||
git_commands.NewNullBisectInfo(),
|
git_commands.NewNullBisectInfo(),
|
||||||
false,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,6 @@ func GetCommitListDisplayStrings(
|
||||||
endIdx int,
|
endIdx int,
|
||||||
showGraph bool,
|
showGraph bool,
|
||||||
bisectInfo *git_commands.BisectInfo,
|
bisectInfo *git_commands.BisectInfo,
|
||||||
showYouAreHereLabel bool,
|
|
||||||
) [][]string {
|
) [][]string {
|
||||||
mutex.Lock()
|
mutex.Lock()
|
||||||
defer mutex.Unlock()
|
defer mutex.Unlock()
|
||||||
|
@ -185,11 +184,6 @@ func GetCommitListDisplayStrings(
|
||||||
for i, commit := range filteredCommits {
|
for i, commit := range filteredCommits {
|
||||||
unfilteredIdx := i + startIdx
|
unfilteredIdx := i + startIdx
|
||||||
bisectStatus = getBisectStatus(unfilteredIdx, commit.Hash, bisectInfo, bisectBounds)
|
bisectStatus = getBisectStatus(unfilteredIdx, commit.Hash, bisectInfo, bisectBounds)
|
||||||
isYouAreHereCommit := false
|
|
||||||
if showYouAreHereLabel && (commit.Status == models.StatusConflicted || unfilteredIdx == rebaseOffset) {
|
|
||||||
isYouAreHereCommit = true
|
|
||||||
showYouAreHereLabel = false
|
|
||||||
}
|
|
||||||
isMarkedBaseCommit := commit.Hash != "" && commit.Hash == markedBaseCommit
|
isMarkedBaseCommit := commit.Hash != "" && commit.Hash == markedBaseCommit
|
||||||
if isMarkedBaseCommit {
|
if isMarkedBaseCommit {
|
||||||
willBeRebased = true
|
willBeRebased = true
|
||||||
|
@ -211,7 +205,6 @@ func GetCommitListDisplayStrings(
|
||||||
fullDescription,
|
fullDescription,
|
||||||
bisectStatus,
|
bisectStatus,
|
||||||
bisectInfo,
|
bisectInfo,
|
||||||
isYouAreHereCommit,
|
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
return lines
|
return lines
|
||||||
|
@ -364,7 +357,6 @@ func displayCommit(
|
||||||
fullDescription bool,
|
fullDescription bool,
|
||||||
bisectStatus BisectStatus,
|
bisectStatus BisectStatus,
|
||||||
bisectInfo *git_commands.BisectInfo,
|
bisectInfo *git_commands.BisectInfo,
|
||||||
isYouAreHereCommit bool,
|
|
||||||
) []string {
|
) []string {
|
||||||
bisectString := getBisectStatusText(bisectStatus, bisectInfo)
|
bisectString := getBisectStatusText(bisectStatus, bisectInfo)
|
||||||
|
|
||||||
|
@ -427,14 +419,8 @@ func displayCommit(
|
||||||
}
|
}
|
||||||
|
|
||||||
mark := ""
|
mark := ""
|
||||||
if isYouAreHereCommit {
|
|
||||||
color := style.FgYellow
|
|
||||||
text := common.Tr.YouAreHere
|
|
||||||
if commit.Status == models.StatusConflicted {
|
if commit.Status == models.StatusConflicted {
|
||||||
color = style.FgRed
|
youAreHere := style.FgRed.Sprintf("<-- %s ---", common.Tr.ConflictLabel)
|
||||||
text = common.Tr.ConflictLabel
|
|
||||||
}
|
|
||||||
youAreHere := color.Sprintf("<-- %s ---", text)
|
|
||||||
mark = fmt.Sprintf("%s ", youAreHere)
|
mark = fmt.Sprintf("%s ", youAreHere)
|
||||||
} else if isMarkedBaseCommit {
|
} else if isMarkedBaseCommit {
|
||||||
rebaseFromHere := style.FgYellow.Sprint(common.Tr.MarkedCommitMarker)
|
rebaseFromHere := style.FgYellow.Sprint(common.Tr.MarkedCommitMarker)
|
||||||
|
@ -505,7 +491,7 @@ func getHashColor(
|
||||||
hashColor = style.FgYellow
|
hashColor = style.FgYellow
|
||||||
case models.StatusMerged:
|
case models.StatusMerged:
|
||||||
hashColor = style.FgGreen
|
hashColor = style.FgGreen
|
||||||
case models.StatusRebasing, models.StatusConflicted:
|
case models.StatusRebasing, models.StatusCherryPickingOrReverting, models.StatusConflicted:
|
||||||
hashColor = style.FgBlue
|
hashColor = style.FgBlue
|
||||||
case models.StatusReflog:
|
case models.StatusReflog:
|
||||||
hashColor = style.FgBlue
|
hashColor = style.FgBlue
|
||||||
|
|
|
@ -40,7 +40,6 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
|
||||||
endIdx int
|
endIdx int
|
||||||
showGraph bool
|
showGraph bool
|
||||||
bisectInfo *git_commands.BisectInfo
|
bisectInfo *git_commands.BisectInfo
|
||||||
showYouAreHereLabel bool
|
|
||||||
expected string
|
expected string
|
||||||
focus bool
|
focus bool
|
||||||
}{
|
}{
|
||||||
|
@ -223,12 +222,11 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
|
||||||
showGraph: true,
|
showGraph: true,
|
||||||
bisectInfo: git_commands.NewNullBisectInfo(),
|
bisectInfo: git_commands.NewNullBisectInfo(),
|
||||||
cherryPickedCommitHashSet: set.New[string](),
|
cherryPickedCommitHashSet: set.New[string](),
|
||||||
showYouAreHereLabel: true,
|
|
||||||
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
|
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
|
||||||
expected: formatExpected(`
|
expected: formatExpected(`
|
||||||
hash1 pick commit1
|
hash1 pick commit1
|
||||||
hash2 pick commit2
|
hash2 pick commit2
|
||||||
hash3 ◯ <-- YOU ARE HERE --- commit3
|
hash3 ◯ commit3
|
||||||
hash4 ◯ commit4
|
hash4 ◯ commit4
|
||||||
hash5 ◯ commit5
|
hash5 ◯ commit5
|
||||||
`),
|
`),
|
||||||
|
@ -247,11 +245,10 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
|
||||||
showGraph: true,
|
showGraph: true,
|
||||||
bisectInfo: git_commands.NewNullBisectInfo(),
|
bisectInfo: git_commands.NewNullBisectInfo(),
|
||||||
cherryPickedCommitHashSet: set.New[string](),
|
cherryPickedCommitHashSet: set.New[string](),
|
||||||
showYouAreHereLabel: true,
|
|
||||||
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
|
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
|
||||||
expected: formatExpected(`
|
expected: formatExpected(`
|
||||||
hash2 pick commit2
|
hash2 pick commit2
|
||||||
hash3 ◯ <-- YOU ARE HERE --- commit3
|
hash3 ◯ commit3
|
||||||
hash4 ◯ commit4
|
hash4 ◯ commit4
|
||||||
hash5 ◯ commit5
|
hash5 ◯ commit5
|
||||||
`),
|
`),
|
||||||
|
@ -270,7 +267,6 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
|
||||||
showGraph: true,
|
showGraph: true,
|
||||||
bisectInfo: git_commands.NewNullBisectInfo(),
|
bisectInfo: git_commands.NewNullBisectInfo(),
|
||||||
cherryPickedCommitHashSet: set.New[string](),
|
cherryPickedCommitHashSet: set.New[string](),
|
||||||
showYouAreHereLabel: true,
|
|
||||||
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
|
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
|
||||||
expected: formatExpected(`
|
expected: formatExpected(`
|
||||||
hash4 ◯ commit4
|
hash4 ◯ commit4
|
||||||
|
@ -291,7 +287,6 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
|
||||||
showGraph: true,
|
showGraph: true,
|
||||||
bisectInfo: git_commands.NewNullBisectInfo(),
|
bisectInfo: git_commands.NewNullBisectInfo(),
|
||||||
cherryPickedCommitHashSet: set.New[string](),
|
cherryPickedCommitHashSet: set.New[string](),
|
||||||
showYouAreHereLabel: true,
|
|
||||||
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
|
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
|
||||||
expected: formatExpected(`
|
expected: formatExpected(`
|
||||||
hash1 pick commit1
|
hash1 pick commit1
|
||||||
|
@ -312,7 +307,6 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
|
||||||
showGraph: true,
|
showGraph: true,
|
||||||
bisectInfo: git_commands.NewNullBisectInfo(),
|
bisectInfo: git_commands.NewNullBisectInfo(),
|
||||||
cherryPickedCommitHashSet: set.New[string](),
|
cherryPickedCommitHashSet: set.New[string](),
|
||||||
showYouAreHereLabel: true,
|
|
||||||
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
|
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
|
||||||
expected: formatExpected(`
|
expected: formatExpected(`
|
||||||
hash5 ◯ commit5
|
hash5 ◯ commit5
|
||||||
|
@ -332,33 +326,12 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
|
||||||
showGraph: true,
|
showGraph: true,
|
||||||
bisectInfo: git_commands.NewNullBisectInfo(),
|
bisectInfo: git_commands.NewNullBisectInfo(),
|
||||||
cherryPickedCommitHashSet: set.New[string](),
|
cherryPickedCommitHashSet: set.New[string](),
|
||||||
showYouAreHereLabel: true,
|
|
||||||
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
|
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
|
||||||
expected: formatExpected(`
|
expected: formatExpected(`
|
||||||
hash1 pick commit1
|
hash1 pick commit1
|
||||||
hash2 pick commit2
|
hash2 pick commit2
|
||||||
`),
|
`),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
testName: "don't show YOU ARE HERE label when not asked for (e.g. in branches panel)",
|
|
||||||
commits: []*models.Commit{
|
|
||||||
{Name: "commit1", Hash: "hash1", Parents: []string{"hash2"}, Action: todo.Pick},
|
|
||||||
{Name: "commit2", Hash: "hash2", Parents: []string{"hash3"}},
|
|
||||||
{Name: "commit3", Hash: "hash3", Parents: []string{"hash4"}},
|
|
||||||
},
|
|
||||||
startIdx: 0,
|
|
||||||
endIdx: 3,
|
|
||||||
showGraph: true,
|
|
||||||
bisectInfo: git_commands.NewNullBisectInfo(),
|
|
||||||
cherryPickedCommitHashSet: set.New[string](),
|
|
||||||
showYouAreHereLabel: false,
|
|
||||||
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
|
|
||||||
expected: formatExpected(`
|
|
||||||
hash1 pick commit1
|
|
||||||
hash2 ◯ commit2
|
|
||||||
hash3 ◯ commit3
|
|
||||||
`),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
testName: "graph in divergence view - all commits visible",
|
testName: "graph in divergence view - all commits visible",
|
||||||
commits: []*models.Commit{
|
commits: []*models.Commit{
|
||||||
|
@ -376,7 +349,6 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
|
||||||
showGraph: true,
|
showGraph: true,
|
||||||
bisectInfo: git_commands.NewNullBisectInfo(),
|
bisectInfo: git_commands.NewNullBisectInfo(),
|
||||||
cherryPickedCommitHashSet: set.New[string](),
|
cherryPickedCommitHashSet: set.New[string](),
|
||||||
showYouAreHereLabel: false,
|
|
||||||
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
|
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
|
||||||
expected: formatExpected(`
|
expected: formatExpected(`
|
||||||
↓ hash1r ◯ commit1
|
↓ hash1r ◯ commit1
|
||||||
|
@ -406,7 +378,6 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
|
||||||
showGraph: true,
|
showGraph: true,
|
||||||
bisectInfo: git_commands.NewNullBisectInfo(),
|
bisectInfo: git_commands.NewNullBisectInfo(),
|
||||||
cherryPickedCommitHashSet: set.New[string](),
|
cherryPickedCommitHashSet: set.New[string](),
|
||||||
showYouAreHereLabel: false,
|
|
||||||
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
|
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
|
||||||
expected: formatExpected(`
|
expected: formatExpected(`
|
||||||
↓ hash3r ◯ │ commit3
|
↓ hash3r ◯ │ commit3
|
||||||
|
@ -434,7 +405,6 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
|
||||||
showGraph: true,
|
showGraph: true,
|
||||||
bisectInfo: git_commands.NewNullBisectInfo(),
|
bisectInfo: git_commands.NewNullBisectInfo(),
|
||||||
cherryPickedCommitHashSet: set.New[string](),
|
cherryPickedCommitHashSet: set.New[string](),
|
||||||
showYouAreHereLabel: false,
|
|
||||||
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
|
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
|
||||||
expected: formatExpected(`
|
expected: formatExpected(`
|
||||||
↓ hash1r ◯ commit1
|
↓ hash1r ◯ commit1
|
||||||
|
@ -461,7 +431,6 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
|
||||||
showGraph: true,
|
showGraph: true,
|
||||||
bisectInfo: git_commands.NewNullBisectInfo(),
|
bisectInfo: git_commands.NewNullBisectInfo(),
|
||||||
cherryPickedCommitHashSet: set.New[string](),
|
cherryPickedCommitHashSet: set.New[string](),
|
||||||
showYouAreHereLabel: false,
|
|
||||||
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
|
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
|
||||||
expected: formatExpected(`
|
expected: formatExpected(`
|
||||||
↑ hash2l ⏣─╮ commit2
|
↑ hash2l ⏣─╮ commit2
|
||||||
|
@ -487,7 +456,6 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
|
||||||
showGraph: true,
|
showGraph: true,
|
||||||
bisectInfo: git_commands.NewNullBisectInfo(),
|
bisectInfo: git_commands.NewNullBisectInfo(),
|
||||||
cherryPickedCommitHashSet: set.New[string](),
|
cherryPickedCommitHashSet: set.New[string](),
|
||||||
showYouAreHereLabel: false,
|
|
||||||
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
|
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
|
||||||
expected: formatExpected(`
|
expected: formatExpected(`
|
||||||
↓ hash1r ◯ commit1
|
↓ hash1r ◯ commit1
|
||||||
|
@ -508,7 +476,6 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
|
||||||
showGraph: true,
|
showGraph: true,
|
||||||
bisectInfo: git_commands.NewNullBisectInfo(),
|
bisectInfo: git_commands.NewNullBisectInfo(),
|
||||||
cherryPickedCommitHashSet: set.New[string](),
|
cherryPickedCommitHashSet: set.New[string](),
|
||||||
showYouAreHereLabel: false,
|
|
||||||
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
|
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
|
||||||
expected: formatExpected(`
|
expected: formatExpected(`
|
||||||
↑ hash1l ◯ commit1
|
↑ hash1l ◯ commit1
|
||||||
|
@ -530,7 +497,6 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
|
||||||
showGraph: true,
|
showGraph: true,
|
||||||
bisectInfo: git_commands.NewNullBisectInfo(),
|
bisectInfo: git_commands.NewNullBisectInfo(),
|
||||||
cherryPickedCommitHashSet: set.New[string](),
|
cherryPickedCommitHashSet: set.New[string](),
|
||||||
showYouAreHereLabel: false,
|
|
||||||
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
|
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
|
||||||
expected: formatExpected(`
|
expected: formatExpected(`
|
||||||
↓ hash1r ◯ commit1
|
↓ hash1r ◯ commit1
|
||||||
|
@ -596,7 +562,6 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
|
||||||
s.endIdx,
|
s.endIdx,
|
||||||
s.showGraph,
|
s.showGraph,
|
||||||
s.bisectInfo,
|
s.bisectInfo,
|
||||||
s.showYouAreHereLabel,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
renderedLines, _ := utils.RenderDisplayStrings(result, nil)
|
renderedLines, _ := utils.RenderDisplayStrings(result, nil)
|
||||||
|
|
|
@ -105,6 +105,7 @@ type Context interface {
|
||||||
|
|
||||||
HandleFocus(opts OnFocusOpts)
|
HandleFocus(opts OnFocusOpts)
|
||||||
HandleFocusLost(opts OnFocusLostOpts)
|
HandleFocusLost(opts OnFocusLostOpts)
|
||||||
|
FocusLine()
|
||||||
HandleRender()
|
HandleRender()
|
||||||
HandleRenderToMain()
|
HandleRenderToMain()
|
||||||
}
|
}
|
||||||
|
@ -173,7 +174,6 @@ type IListContext interface {
|
||||||
ViewIndexToModelIndex(int) int
|
ViewIndexToModelIndex(int) int
|
||||||
ModelIndexToViewIndex(int) int
|
ModelIndexToViewIndex(int) int
|
||||||
|
|
||||||
FocusLine()
|
|
||||||
IsListContext() // used for type switch
|
IsListContext() // used for type switch
|
||||||
RangeSelectEnabled() bool
|
RangeSelectEnabled() bool
|
||||||
RenderOnlyVisibleLines() bool
|
RenderOnlyVisibleLines() bool
|
||||||
|
|
|
@ -136,5 +136,12 @@ func (gui *Gui) postRefreshUpdate(c types.Context) {
|
||||||
|
|
||||||
if gui.currentViewName() == c.GetViewName() {
|
if gui.currentViewName() == c.GetViewName() {
|
||||||
c.HandleFocus(types.OnFocusOpts{})
|
c.HandleFocus(types.OnFocusOpts{})
|
||||||
|
} else {
|
||||||
|
// The FocusLine call is included in the HandleFocus method which we
|
||||||
|
// call for focused views above; but we need to call it here for
|
||||||
|
// non-focused views to ensure that an inactive selection is painted
|
||||||
|
// correctly, and that integration tests see the up to date selection
|
||||||
|
// state.
|
||||||
|
c.FocusLine()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -348,8 +348,11 @@ type TranslationSet struct {
|
||||||
PullRequestNoUpstream string
|
PullRequestNoUpstream string
|
||||||
ErrorOccurred string
|
ErrorOccurred string
|
||||||
NoRoom string
|
NoRoom string
|
||||||
YouAreHere string
|
|
||||||
ConflictLabel string
|
ConflictLabel string
|
||||||
|
PendingRebaseTodosSectionHeader string
|
||||||
|
PendingCherryPicksSectionHeader string
|
||||||
|
PendingRevertsSectionHeader string
|
||||||
|
CommitsSectionHeader string
|
||||||
YouDied string
|
YouDied string
|
||||||
RewordNotSupported string
|
RewordNotSupported string
|
||||||
ChangingThisActionIsNotAllowed string
|
ChangingThisActionIsNotAllowed string
|
||||||
|
@ -1417,8 +1420,11 @@ func EnglishTranslationSet() *TranslationSet {
|
||||||
PullRequestNoUpstream: "Cannot open a pull request for a branch with no upstream",
|
PullRequestNoUpstream: "Cannot open a pull request for a branch with no upstream",
|
||||||
ErrorOccurred: "An error occurred! Please create an issue at",
|
ErrorOccurred: "An error occurred! Please create an issue at",
|
||||||
NoRoom: "Not enough room",
|
NoRoom: "Not enough room",
|
||||||
YouAreHere: "YOU ARE HERE",
|
|
||||||
ConflictLabel: "CONFLICT",
|
ConflictLabel: "CONFLICT",
|
||||||
|
PendingRebaseTodosSectionHeader: "Pending rebase todos",
|
||||||
|
PendingCherryPicksSectionHeader: "Pending cherry-picks",
|
||||||
|
PendingRevertsSectionHeader: "Pending reverts",
|
||||||
|
CommitsSectionHeader: "Commits",
|
||||||
YouDied: "YOU DIED!",
|
YouDied: "YOU DIED!",
|
||||||
RewordNotSupported: "Rewording commits while interactively rebasing is not currently supported",
|
RewordNotSupported: "Rewording commits while interactively rebasing is not currently supported",
|
||||||
ChangingThisActionIsNotAllowed: "Changing this kind of rebase todo entry is not allowed",
|
ChangingThisActionIsNotAllowed: "Changing this kind of rebase todo entry is not allowed",
|
||||||
|
|
|
@ -51,9 +51,11 @@ var RebaseAndDrop = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
t.Views().Commits().
|
t.Views().Commits().
|
||||||
Focus().
|
Focus().
|
||||||
TopLines(
|
TopLines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
MatchesRegexp(`pick.*to keep`).IsSelected(),
|
MatchesRegexp(`pick.*to keep`).IsSelected(),
|
||||||
MatchesRegexp(`pick.*to remove`),
|
MatchesRegexp(`pick.*to remove`),
|
||||||
MatchesRegexp(`pick.*CONFLICT.*first change`),
|
MatchesRegexp(`pick.*CONFLICT.*first change`),
|
||||||
|
Contains("--- Commits ---"),
|
||||||
MatchesRegexp("second-change-branch unrelated change"),
|
MatchesRegexp("second-change-branch unrelated change"),
|
||||||
MatchesRegexp("second change"),
|
MatchesRegexp("second change"),
|
||||||
MatchesRegexp("original"),
|
MatchesRegexp("original"),
|
||||||
|
@ -61,9 +63,11 @@ var RebaseAndDrop = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
SelectNextItem().
|
SelectNextItem().
|
||||||
Press(keys.Universal.Remove).
|
Press(keys.Universal.Remove).
|
||||||
TopLines(
|
TopLines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
MatchesRegexp(`pick.*to keep`),
|
MatchesRegexp(`pick.*to keep`),
|
||||||
MatchesRegexp(`drop.*to remove`).IsSelected(),
|
MatchesRegexp(`drop.*to remove`).IsSelected(),
|
||||||
MatchesRegexp(`pick.*CONFLICT.*first change`),
|
MatchesRegexp(`pick.*CONFLICT.*first change`),
|
||||||
|
Contains("--- Commits ---"),
|
||||||
MatchesRegexp("second-change-branch unrelated change"),
|
MatchesRegexp("second-change-branch unrelated change"),
|
||||||
MatchesRegexp("second change"),
|
MatchesRegexp("second change"),
|
||||||
MatchesRegexp("original"),
|
MatchesRegexp("original"),
|
||||||
|
|
|
@ -59,8 +59,10 @@ var CherryPickDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
SelectNextItem().
|
SelectNextItem().
|
||||||
Press(keys.Universal.Edit).
|
Press(keys.Universal.Edit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick CI two"),
|
Contains("pick CI two"),
|
||||||
Contains(" CI <-- YOU ARE HERE --- one").IsSelected(),
|
Contains("--- Commits ---"),
|
||||||
|
Contains(" CI one").IsSelected(),
|
||||||
Contains(" CI base"),
|
Contains(" CI base"),
|
||||||
).
|
).
|
||||||
Press(keys.Commits.PasteCommits).
|
Press(keys.Commits.PasteCommits).
|
||||||
|
@ -74,8 +76,10 @@ var CherryPickDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
t.Views().Information().Content(DoesNotContain("commit copied"))
|
t.Views().Information().Content(DoesNotContain("commit copied"))
|
||||||
}).
|
}).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick CI two"),
|
Contains("pick CI two"),
|
||||||
Contains(" CI <-- YOU ARE HERE --- three"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains(" CI three"),
|
||||||
Contains(" CI one"),
|
Contains(" CI one"),
|
||||||
Contains(" CI base"),
|
Contains(" CI base"),
|
||||||
).
|
).
|
||||||
|
|
|
@ -29,8 +29,10 @@ var AmendWhenThereAreConflictsAndAmend = NewIntegrationTest(NewIntegrationTestAr
|
||||||
t.Views().Commits().
|
t.Views().Commits().
|
||||||
Focus().
|
Focus().
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("commit three"),
|
Contains("pick").Contains("commit three"),
|
||||||
Contains("pick").Contains("<-- CONFLICT --- file1 changed in branch"),
|
Contains("pick").Contains("<-- CONFLICT --- file1 changed in branch"),
|
||||||
|
Contains("--- Commits ---"),
|
||||||
Contains("commit two"),
|
Contains("commit two"),
|
||||||
Contains("file1 changed in master"),
|
Contains("file1 changed in master"),
|
||||||
Contains("base commit"),
|
Contains("base commit"),
|
||||||
|
|
|
@ -33,8 +33,10 @@ var AmendWhenThereAreConflictsAndCancel = NewIntegrationTest(NewIntegrationTestA
|
||||||
t.Views().Commits().
|
t.Views().Commits().
|
||||||
Focus().
|
Focus().
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("commit three"),
|
Contains("pick").Contains("commit three"),
|
||||||
Contains("pick").Contains("<-- CONFLICT --- file1 changed in branch"),
|
Contains("pick").Contains("<-- CONFLICT --- file1 changed in branch"),
|
||||||
|
Contains("--- Commits ---"),
|
||||||
Contains("commit two"),
|
Contains("commit two"),
|
||||||
Contains("file1 changed in master"),
|
Contains("file1 changed in master"),
|
||||||
Contains("base commit"),
|
Contains("base commit"),
|
||||||
|
|
|
@ -44,8 +44,10 @@ var RevertWithConflictMultipleCommits = NewIntegrationTest(NewIntegrationTestArg
|
||||||
Confirm()
|
Confirm()
|
||||||
}).
|
}).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending reverts ---"),
|
||||||
Contains("revert").Contains("CI unrelated change"),
|
Contains("revert").Contains("CI unrelated change"),
|
||||||
Contains("revert").Contains("CI <-- CONFLICT --- add first line"),
|
Contains("revert").Contains("CI <-- CONFLICT --- add first line"),
|
||||||
|
Contains("--- Commits ---"),
|
||||||
Contains("CI ◯ add second line"),
|
Contains("CI ◯ add second line"),
|
||||||
Contains("CI ◯ add first line"),
|
Contains("CI ◯ add first line"),
|
||||||
Contains("CI ◯ unrelated change"),
|
Contains("CI ◯ unrelated change"),
|
||||||
|
|
|
@ -39,7 +39,9 @@ var RevertWithConflictSingleCommit = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
Confirm()
|
Confirm()
|
||||||
}).
|
}).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending reverts ---"),
|
||||||
Contains("revert").Contains("CI <-- CONFLICT --- add first line"),
|
Contains("revert").Contains("CI <-- CONFLICT --- add first line"),
|
||||||
|
Contains("--- Commits ---"),
|
||||||
Contains("CI ◯ add second line"),
|
Contains("CI ◯ add second line"),
|
||||||
Contains("CI ◯ add first line"),
|
Contains("CI ◯ add first line"),
|
||||||
Contains("CI ◯ add empty file"),
|
Contains("CI ◯ add empty file"),
|
||||||
|
|
|
@ -43,8 +43,10 @@ func doTheRebaseForAmendTests(t *TestDriver, keys config.KeybindingConfig) {
|
||||||
|
|
||||||
t.Views().Commits().
|
t.Views().Commits().
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("commit three"),
|
Contains("pick").Contains("commit three"),
|
||||||
Contains("pick").Contains("<-- CONFLICT --- file1 changed in branch"),
|
Contains("pick").Contains("<-- CONFLICT --- file1 changed in branch"),
|
||||||
|
Contains("--- Commits ---"),
|
||||||
Contains("commit two"),
|
Contains("commit two"),
|
||||||
Contains("file1 changed in master"),
|
Contains("file1 changed in master"),
|
||||||
Contains("base commit"),
|
Contains("base commit"),
|
||||||
|
|
|
@ -45,20 +45,26 @@ var AdvancedInteractiveRebase = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
t.Views().Commits().
|
t.Views().Commits().
|
||||||
IsFocused().
|
IsFocused().
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains(TOP_COMMIT),
|
Contains(TOP_COMMIT),
|
||||||
Contains(BASE_COMMIT).Contains("YOU ARE HERE"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains(BASE_COMMIT),
|
||||||
).
|
).
|
||||||
NavigateToLine(Contains(TOP_COMMIT)).
|
NavigateToLine(Contains(TOP_COMMIT)).
|
||||||
Press(keys.Universal.Edit).
|
Press(keys.Universal.Edit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains(TOP_COMMIT).Contains("edit"),
|
Contains(TOP_COMMIT).Contains("edit"),
|
||||||
Contains(BASE_COMMIT).Contains("YOU ARE HERE"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains(BASE_COMMIT),
|
||||||
).
|
).
|
||||||
Tap(func() {
|
Tap(func() {
|
||||||
t.Common().ContinueRebase()
|
t.Common().ContinueRebase()
|
||||||
}).
|
}).
|
||||||
Lines(
|
Lines(
|
||||||
Contains(TOP_COMMIT).Contains("YOU ARE HERE"),
|
Contains("--- Pending rebase todos ---"),
|
||||||
|
Contains("--- Commits ---"),
|
||||||
|
Contains(TOP_COMMIT),
|
||||||
Contains(BASE_COMMIT),
|
Contains(BASE_COMMIT),
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
|
@ -34,8 +34,10 @@ var AmendCommitWithConflict = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
t.Common().AcknowledgeConflicts()
|
t.Common().AcknowledgeConflicts()
|
||||||
}).
|
}).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("three"),
|
Contains("pick").Contains("three"),
|
||||||
Contains("fixup").Contains("<-- CONFLICT --- fixup! two"),
|
Contains("fixup").Contains("<-- CONFLICT --- fixup! two"),
|
||||||
|
Contains("--- Commits ---"),
|
||||||
Contains("two"),
|
Contains("two"),
|
||||||
Contains("one"),
|
Contains("one"),
|
||||||
)
|
)
|
||||||
|
@ -66,7 +68,9 @@ var AmendCommitWithConflict = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
|
|
||||||
t.Views().Commits().
|
t.Views().Commits().
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("<-- CONFLICT --- three"),
|
Contains("<-- CONFLICT --- three"),
|
||||||
|
Contains("--- Commits ---"),
|
||||||
Contains("two"),
|
Contains("two"),
|
||||||
Contains("one"),
|
Contains("one"),
|
||||||
)
|
)
|
||||||
|
|
|
@ -24,8 +24,10 @@ var AmendHeadCommitDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
NavigateToLine(Contains("commit 02")).
|
NavigateToLine(Contains("commit 02")).
|
||||||
Press(keys.Universal.Edit).
|
Press(keys.Universal.Edit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("commit 03"),
|
Contains("commit 03"),
|
||||||
Contains("<-- YOU ARE HERE --- commit 02").IsSelected(),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 02").IsSelected(),
|
||||||
Contains("commit 01"),
|
Contains("commit 01"),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -48,8 +50,10 @@ var AmendHeadCommitDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
Confirm()
|
Confirm()
|
||||||
}).
|
}).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("commit 03"),
|
Contains("commit 03"),
|
||||||
Contains("<-- YOU ARE HERE --- commit 02").IsSelected(),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 02").IsSelected(),
|
||||||
Contains("commit 01"),
|
Contains("commit 01"),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,10 @@ var AmendNonHeadCommitDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
NavigateToLine(Contains("commit 02")).
|
NavigateToLine(Contains("commit 02")).
|
||||||
Press(keys.Universal.Edit).
|
Press(keys.Universal.Edit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("commit 03"),
|
Contains("commit 03"),
|
||||||
Contains("<-- YOU ARE HERE --- commit 02"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 02"),
|
||||||
Contains("commit 01"),
|
Contains("commit 01"),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -26,13 +26,15 @@ var DeleteUpdateRefTodo = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
NavigateToLine(Contains("commit 01")).
|
NavigateToLine(Contains("commit 01")).
|
||||||
Press(keys.Universal.Edit).
|
Press(keys.Universal.Edit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("CI commit 06"),
|
Contains("pick").Contains("CI commit 06"),
|
||||||
Contains("pick").Contains("CI commit 05"),
|
Contains("pick").Contains("CI commit 05"),
|
||||||
Contains("pick").Contains("CI commit 04"),
|
Contains("pick").Contains("CI commit 04"),
|
||||||
Contains("update-ref").Contains("branch1"),
|
Contains("update-ref").Contains("branch1"),
|
||||||
Contains("pick").Contains("CI commit 03"),
|
Contains("pick").Contains("CI commit 03"),
|
||||||
Contains("pick").Contains("CI commit 02"),
|
Contains("pick").Contains("CI commit 02"),
|
||||||
Contains("CI ◯ <-- YOU ARE HERE --- commit 01"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("CI ◯ commit 01"),
|
||||||
).
|
).
|
||||||
NavigateToLine(Contains("update-ref")).
|
NavigateToLine(Contains("update-ref")).
|
||||||
Press(keys.Universal.Remove).
|
Press(keys.Universal.Remove).
|
||||||
|
@ -43,12 +45,14 @@ var DeleteUpdateRefTodo = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
Confirm()
|
Confirm()
|
||||||
}).
|
}).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("CI commit 06"),
|
Contains("pick").Contains("CI commit 06"),
|
||||||
Contains("pick").Contains("CI commit 05"),
|
Contains("pick").Contains("CI commit 05"),
|
||||||
Contains("pick").Contains("CI commit 04"),
|
Contains("pick").Contains("CI commit 04"),
|
||||||
Contains("pick").Contains("CI commit 03").IsSelected(),
|
Contains("pick").Contains("CI commit 03").IsSelected(),
|
||||||
Contains("pick").Contains("CI commit 02"),
|
Contains("pick").Contains("CI commit 02"),
|
||||||
Contains("CI ◯ <-- YOU ARE HERE --- commit 01"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("CI ◯ commit 01"),
|
||||||
).
|
).
|
||||||
NavigateToLine(Contains("commit 02")).
|
NavigateToLine(Contains("commit 02")).
|
||||||
Press(keys.Universal.Remove).
|
Press(keys.Universal.Remove).
|
||||||
|
|
|
@ -41,13 +41,15 @@ var DontShowBranchHeadsForTodoItems = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
NavigateToLine(Contains("commit 04")).
|
NavigateToLine(Contains("commit 04")).
|
||||||
Press(keys.Universal.Edit).
|
Press(keys.Universal.Edit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("CI commit 09"),
|
Contains("pick").Contains("CI commit 09"),
|
||||||
Contains("pick").Contains("CI commit 08"),
|
Contains("pick").Contains("CI commit 08"),
|
||||||
Contains("pick").Contains("CI commit 07"),
|
Contains("pick").Contains("CI commit 07"),
|
||||||
Contains("update-ref").Contains("branch2"),
|
Contains("update-ref").Contains("branch2"),
|
||||||
Contains("pick").Contains("CI commit 06"), // no star on this entry, even though branch2 points to it
|
Contains("pick").Contains("CI commit 06"), // no star on this entry, even though branch2 points to it
|
||||||
Contains("pick").Contains("CI commit 05"),
|
Contains("pick").Contains("CI commit 05"),
|
||||||
Contains("CI <-- YOU ARE HERE --- commit 04"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("CI commit 04"),
|
||||||
Contains("CI commit 03"),
|
Contains("CI commit 03"),
|
||||||
Contains("CI * commit 02"), // this star is fine though
|
Contains("CI * commit 02"), // this star is fine though
|
||||||
Contains("CI commit 01"),
|
Contains("CI commit 01"),
|
||||||
|
|
|
@ -39,13 +39,15 @@ var DropTodoCommitWithUpdateRef = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
NavigateToLine(Contains("commit 02")).
|
NavigateToLine(Contains("commit 02")).
|
||||||
Press(keys.Universal.Edit).
|
Press(keys.Universal.Edit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("CI commit 07"),
|
Contains("pick").Contains("CI commit 07"),
|
||||||
Contains("pick").Contains("CI commit 06"),
|
Contains("pick").Contains("CI commit 06"),
|
||||||
Contains("pick").Contains("CI commit 05"),
|
Contains("pick").Contains("CI commit 05"),
|
||||||
Contains("update-ref").Contains("branch1").DoesNotContain("*"),
|
Contains("update-ref").Contains("branch1").DoesNotContain("*"),
|
||||||
Contains("pick").Contains("CI commit 04"),
|
Contains("pick").Contains("CI commit 04"),
|
||||||
Contains("pick").Contains("CI commit 03"),
|
Contains("pick").Contains("CI commit 03"),
|
||||||
Contains("<-- YOU ARE HERE --- commit 02").IsSelected(),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("CI commit 02").IsSelected(),
|
||||||
Contains("CI commit 01"),
|
Contains("CI commit 01"),
|
||||||
).
|
).
|
||||||
Tap(func() {
|
Tap(func() {
|
||||||
|
|
|
@ -25,8 +25,10 @@ var EditAndAutoAmend = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
NavigateToLine(Contains("commit 02")).
|
NavigateToLine(Contains("commit 02")).
|
||||||
Press(keys.Universal.Edit).
|
Press(keys.Universal.Edit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("commit 03"),
|
Contains("commit 03"),
|
||||||
MatchesRegexp("YOU ARE HERE.*commit 02").IsSelected(),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 02").IsSelected(),
|
||||||
Contains("commit 01"),
|
Contains("commit 01"),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,10 @@ var EditFirstCommit = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
NavigateToLine(Contains("commit 01")).
|
NavigateToLine(Contains("commit 01")).
|
||||||
Press(keys.Universal.Edit).
|
Press(keys.Universal.Edit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("commit 02"),
|
Contains("commit 02"),
|
||||||
MatchesRegexp("YOU ARE HERE.*commit 01").IsSelected(),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 01").IsSelected(),
|
||||||
).
|
).
|
||||||
Tap(func() {
|
Tap(func() {
|
||||||
t.Common().ContinueRebase()
|
t.Common().ContinueRebase()
|
||||||
|
|
|
@ -37,10 +37,12 @@ var EditLastCommitOfStackedBranch = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
NavigateToLine(Contains("commit 03")).
|
NavigateToLine(Contains("commit 03")).
|
||||||
Press(keys.Universal.Edit).
|
Press(keys.Universal.Edit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("CI commit 05"),
|
Contains("pick").Contains("CI commit 05"),
|
||||||
Contains("pick").Contains("CI commit 04"),
|
Contains("pick").Contains("CI commit 04"),
|
||||||
Contains("update-ref").Contains("branch1"),
|
Contains("update-ref").Contains("branch1"),
|
||||||
Contains("<-- YOU ARE HERE --- * commit 03").IsSelected(),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("CI * commit 03").IsSelected(),
|
||||||
Contains("CI commit 02"),
|
Contains("CI commit 02"),
|
||||||
Contains("CI commit 01"),
|
Contains("CI commit 01"),
|
||||||
)
|
)
|
||||||
|
|
|
@ -23,7 +23,9 @@ var EditNonTodoCommitDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
).
|
).
|
||||||
Press(keys.Universal.Edit).
|
Press(keys.Universal.Edit).
|
||||||
Lines(
|
Lines(
|
||||||
Contains("<-- YOU ARE HERE --- commit 02"),
|
Contains("--- Pending rebase todos ---"),
|
||||||
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 02"),
|
||||||
Contains("commit 01"),
|
Contains("commit 01"),
|
||||||
).
|
).
|
||||||
NavigateToLine(Contains("commit 01")).
|
NavigateToLine(Contains("commit 01")).
|
||||||
|
|
|
@ -27,9 +27,11 @@ var EditRangeSelectDownToMergeOutsideRebase = NewIntegrationTest(NewIntegrationT
|
||||||
Press(keys.Universal.RangeSelectDown).
|
Press(keys.Universal.RangeSelectDown).
|
||||||
Press(keys.Universal.Edit).
|
Press(keys.Universal.Edit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("edit CI commit 02").IsSelected(),
|
Contains("edit CI commit 02").IsSelected(),
|
||||||
Contains("edit CI commit 01").IsSelected(),
|
Contains("edit CI commit 01").IsSelected(),
|
||||||
Contains(" CI ⏣─╮ <-- YOU ARE HERE --- Merge branch 'second-change-branch' into first-change-branch").IsSelected(),
|
Contains("--- Commits ---").IsSelected(),
|
||||||
|
Contains(" CI ⏣─╮ Merge branch 'second-change-branch' into first-change-branch").IsSelected(),
|
||||||
Contains(" CI │ ◯ * second-change-branch unrelated change"),
|
Contains(" CI │ ◯ * second-change-branch unrelated change"),
|
||||||
Contains(" CI │ ◯ second change"),
|
Contains(" CI │ ◯ second change"),
|
||||||
Contains(" CI ◯ │ first change"),
|
Contains(" CI ◯ │ first change"),
|
||||||
|
|
|
@ -37,12 +37,14 @@ var EditRangeSelectOutsideRebase = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
).
|
).
|
||||||
Press(keys.Universal.Edit).
|
Press(keys.Universal.Edit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("merge CI Merge branch 'second-change-branch' into first-change-branch").IsSelected(),
|
Contains("merge CI Merge branch 'second-change-branch' into first-change-branch").IsSelected(),
|
||||||
Contains("edit CI first change").IsSelected(),
|
Contains("edit CI first change").IsSelected(),
|
||||||
Contains("edit CI * second-change-branch unrelated change").IsSelected(),
|
Contains("edit CI * second-change-branch unrelated change").IsSelected(),
|
||||||
Contains("edit CI second change").IsSelected(),
|
Contains("edit CI second change").IsSelected(),
|
||||||
Contains("edit CI * original").IsSelected(),
|
Contains("edit CI * original").IsSelected(),
|
||||||
Contains(" CI ◯ <-- YOU ARE HERE --- three").IsSelected(),
|
Contains("--- Commits ---").IsSelected(),
|
||||||
|
Contains(" CI ◯ three").IsSelected(),
|
||||||
Contains(" CI ◯ two"),
|
Contains(" CI ◯ two"),
|
||||||
Contains(" CI ◯ one"),
|
Contains(" CI ◯ one"),
|
||||||
)
|
)
|
||||||
|
|
|
@ -32,8 +32,10 @@ var EditTheConflCommit = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
}).
|
}).
|
||||||
Focus().
|
Focus().
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("commit two"),
|
Contains("pick").Contains("commit two"),
|
||||||
Contains("pick").Contains("<-- CONFLICT --- commit three"),
|
Contains("pick").Contains("<-- CONFLICT --- commit three"),
|
||||||
|
Contains("--- Commits ---"),
|
||||||
Contains("commit one"),
|
Contains("commit one"),
|
||||||
).
|
).
|
||||||
NavigateToLine(Contains("<-- CONFLICT --- commit three")).
|
NavigateToLine(Contains("<-- CONFLICT --- commit three")).
|
||||||
|
|
|
@ -32,10 +32,12 @@ var InteractiveRebaseOfCopiedBranch = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
NavigateToLine(Contains("commit 01")).
|
NavigateToLine(Contains("commit 01")).
|
||||||
Press(keys.Universal.Edit).
|
Press(keys.Universal.Edit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
// No update-ref todo for branch1 here, even though command-line git would have added it
|
// No update-ref todo for branch1 here, even though command-line git would have added it
|
||||||
Contains("pick").Contains("CI commit 03"),
|
Contains("pick").Contains("CI commit 03"),
|
||||||
Contains("pick").Contains("CI commit 02"),
|
Contains("pick").Contains("CI commit 02"),
|
||||||
Contains("CI <-- YOU ARE HERE --- commit 01"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("CI commit 01"),
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
@ -52,7 +52,9 @@ var InteractiveRebaseWithConflictForEditCommand = NewIntegrationTest(NewIntegrat
|
||||||
|
|
||||||
t.Views().Commits().
|
t.Views().Commits().
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("edit").Contains("<-- CONFLICT --- this will conflict").IsSelected(),
|
Contains("edit").Contains("<-- CONFLICT --- this will conflict").IsSelected(),
|
||||||
|
Contains("--- Commits ---"),
|
||||||
Contains("commit 03"),
|
Contains("commit 03"),
|
||||||
Contains("commit 02"),
|
Contains("commit 02"),
|
||||||
Contains("commit 01"),
|
Contains("commit 01"),
|
||||||
|
|
|
@ -24,74 +24,88 @@ var MidRebaseRangeSelect = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
// Start a rebase
|
// Start a rebase
|
||||||
Press(keys.Universal.Edit).
|
Press(keys.Universal.Edit).
|
||||||
TopLines(
|
TopLines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("commit 10"),
|
Contains("pick").Contains("commit 10"),
|
||||||
Contains("pick").Contains("commit 09"),
|
Contains("pick").Contains("commit 09"),
|
||||||
Contains("pick").Contains("commit 08"),
|
Contains("pick").Contains("commit 08"),
|
||||||
Contains("pick").Contains("commit 07"),
|
Contains("pick").Contains("commit 07"),
|
||||||
Contains("pick").Contains("commit 06"),
|
Contains("pick").Contains("commit 06"),
|
||||||
Contains("<-- YOU ARE HERE --- commit 05").IsSelected(),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 05").IsSelected(),
|
||||||
Contains("commit 04"),
|
Contains("commit 04"),
|
||||||
).
|
).
|
||||||
SelectPreviousItem().
|
SelectPreviousItem().
|
||||||
// perform various actions on a range of commits
|
// perform various actions on a range of commits
|
||||||
Press(keys.Universal.RangeSelectUp).
|
Press(keys.Universal.RangeSelectUp).
|
||||||
TopLines(
|
TopLines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("commit 10"),
|
Contains("pick").Contains("commit 10"),
|
||||||
Contains("pick").Contains("commit 09"),
|
Contains("pick").Contains("commit 09"),
|
||||||
Contains("pick").Contains("commit 08"),
|
Contains("pick").Contains("commit 08"),
|
||||||
Contains("pick").Contains("commit 07").IsSelected(),
|
Contains("pick").Contains("commit 07").IsSelected(),
|
||||||
Contains("pick").Contains("commit 06").IsSelected(),
|
Contains("pick").Contains("commit 06").IsSelected(),
|
||||||
Contains("<-- YOU ARE HERE --- commit 05"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 05"),
|
||||||
Contains("commit 04"),
|
Contains("commit 04"),
|
||||||
).
|
).
|
||||||
Press(keys.Commits.MarkCommitAsFixup).
|
Press(keys.Commits.MarkCommitAsFixup).
|
||||||
TopLines(
|
TopLines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("commit 10"),
|
Contains("pick").Contains("commit 10"),
|
||||||
Contains("pick").Contains("commit 09"),
|
Contains("pick").Contains("commit 09"),
|
||||||
Contains("pick").Contains("commit 08"),
|
Contains("pick").Contains("commit 08"),
|
||||||
Contains("fixup").Contains("commit 07").IsSelected(),
|
Contains("fixup").Contains("commit 07").IsSelected(),
|
||||||
Contains("fixup").Contains("commit 06").IsSelected(),
|
Contains("fixup").Contains("commit 06").IsSelected(),
|
||||||
Contains("<-- YOU ARE HERE --- commit 05"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 05"),
|
||||||
Contains("commit 04"),
|
Contains("commit 04"),
|
||||||
).
|
).
|
||||||
Press(keys.Commits.PickCommit).
|
Press(keys.Commits.PickCommit).
|
||||||
TopLines(
|
TopLines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("commit 10"),
|
Contains("pick").Contains("commit 10"),
|
||||||
Contains("pick").Contains("commit 09"),
|
Contains("pick").Contains("commit 09"),
|
||||||
Contains("pick").Contains("commit 08"),
|
Contains("pick").Contains("commit 08"),
|
||||||
Contains("pick").Contains("commit 07").IsSelected(),
|
Contains("pick").Contains("commit 07").IsSelected(),
|
||||||
Contains("pick").Contains("commit 06").IsSelected(),
|
Contains("pick").Contains("commit 06").IsSelected(),
|
||||||
Contains("<-- YOU ARE HERE --- commit 05"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 05"),
|
||||||
Contains("commit 04"),
|
Contains("commit 04"),
|
||||||
).
|
).
|
||||||
Press(keys.Universal.Edit).
|
Press(keys.Universal.Edit).
|
||||||
TopLines(
|
TopLines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("commit 10"),
|
Contains("pick").Contains("commit 10"),
|
||||||
Contains("pick").Contains("commit 09"),
|
Contains("pick").Contains("commit 09"),
|
||||||
Contains("pick").Contains("commit 08"),
|
Contains("pick").Contains("commit 08"),
|
||||||
Contains("edit").Contains("commit 07").IsSelected(),
|
Contains("edit").Contains("commit 07").IsSelected(),
|
||||||
Contains("edit").Contains("commit 06").IsSelected(),
|
Contains("edit").Contains("commit 06").IsSelected(),
|
||||||
Contains("<-- YOU ARE HERE --- commit 05"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 05"),
|
||||||
Contains("commit 04"),
|
Contains("commit 04"),
|
||||||
).
|
).
|
||||||
Press(keys.Commits.SquashDown).
|
Press(keys.Commits.SquashDown).
|
||||||
TopLines(
|
TopLines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("commit 10"),
|
Contains("pick").Contains("commit 10"),
|
||||||
Contains("pick").Contains("commit 09"),
|
Contains("pick").Contains("commit 09"),
|
||||||
Contains("pick").Contains("commit 08"),
|
Contains("pick").Contains("commit 08"),
|
||||||
Contains("squash").Contains("commit 07").IsSelected(),
|
Contains("squash").Contains("commit 07").IsSelected(),
|
||||||
Contains("squash").Contains("commit 06").IsSelected(),
|
Contains("squash").Contains("commit 06").IsSelected(),
|
||||||
Contains("<-- YOU ARE HERE --- commit 05"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 05"),
|
||||||
Contains("commit 04"),
|
Contains("commit 04"),
|
||||||
).
|
).
|
||||||
Press(keys.Commits.MoveDownCommit).
|
Press(keys.Commits.MoveDownCommit).
|
||||||
TopLines(
|
TopLines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("commit 10"),
|
Contains("pick").Contains("commit 10"),
|
||||||
Contains("pick").Contains("commit 09"),
|
Contains("pick").Contains("commit 09"),
|
||||||
Contains("pick").Contains("commit 08"),
|
Contains("pick").Contains("commit 08"),
|
||||||
Contains("squash").Contains("commit 07").IsSelected(),
|
Contains("squash").Contains("commit 07").IsSelected(),
|
||||||
Contains("squash").Contains("commit 06").IsSelected(),
|
Contains("squash").Contains("commit 06").IsSelected(),
|
||||||
Contains("<-- YOU ARE HERE --- commit 05"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 05"),
|
||||||
Contains("commit 04"),
|
Contains("commit 04"),
|
||||||
).
|
).
|
||||||
Tap(func() {
|
Tap(func() {
|
||||||
|
@ -99,32 +113,38 @@ var MidRebaseRangeSelect = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
}).
|
}).
|
||||||
Press(keys.Commits.MoveUpCommit).
|
Press(keys.Commits.MoveUpCommit).
|
||||||
TopLines(
|
TopLines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("commit 10"),
|
Contains("pick").Contains("commit 10"),
|
||||||
Contains("pick").Contains("commit 09"),
|
Contains("pick").Contains("commit 09"),
|
||||||
Contains("squash").Contains("commit 07").IsSelected(),
|
Contains("squash").Contains("commit 07").IsSelected(),
|
||||||
Contains("squash").Contains("commit 06").IsSelected(),
|
Contains("squash").Contains("commit 06").IsSelected(),
|
||||||
Contains("pick").Contains("commit 08"),
|
Contains("pick").Contains("commit 08"),
|
||||||
Contains("<-- YOU ARE HERE --- commit 05"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 05"),
|
||||||
Contains("commit 04"),
|
Contains("commit 04"),
|
||||||
).
|
).
|
||||||
Press(keys.Commits.MoveUpCommit).
|
Press(keys.Commits.MoveUpCommit).
|
||||||
TopLines(
|
TopLines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("commit 10"),
|
Contains("pick").Contains("commit 10"),
|
||||||
Contains("squash").Contains("commit 07").IsSelected(),
|
Contains("squash").Contains("commit 07").IsSelected(),
|
||||||
Contains("squash").Contains("commit 06").IsSelected(),
|
Contains("squash").Contains("commit 06").IsSelected(),
|
||||||
Contains("pick").Contains("commit 09"),
|
Contains("pick").Contains("commit 09"),
|
||||||
Contains("pick").Contains("commit 08"),
|
Contains("pick").Contains("commit 08"),
|
||||||
Contains("<-- YOU ARE HERE --- commit 05"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 05"),
|
||||||
Contains("commit 04"),
|
Contains("commit 04"),
|
||||||
).
|
).
|
||||||
Press(keys.Commits.MoveUpCommit).
|
Press(keys.Commits.MoveUpCommit).
|
||||||
TopLines(
|
TopLines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("squash").Contains("commit 07").IsSelected(),
|
Contains("squash").Contains("commit 07").IsSelected(),
|
||||||
Contains("squash").Contains("commit 06").IsSelected(),
|
Contains("squash").Contains("commit 06").IsSelected(),
|
||||||
Contains("pick").Contains("commit 10"),
|
Contains("pick").Contains("commit 10"),
|
||||||
Contains("pick").Contains("commit 09"),
|
Contains("pick").Contains("commit 09"),
|
||||||
Contains("pick").Contains("commit 08"),
|
Contains("pick").Contains("commit 08"),
|
||||||
Contains("<-- YOU ARE HERE --- commit 05"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 05"),
|
||||||
Contains("commit 04"),
|
Contains("commit 04"),
|
||||||
).
|
).
|
||||||
Press(keys.Commits.MoveUpCommit).
|
Press(keys.Commits.MoveUpCommit).
|
||||||
|
@ -132,12 +152,14 @@ var MidRebaseRangeSelect = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
t.ExpectToast(Contains("Disabled: Cannot move any further"))
|
t.ExpectToast(Contains("Disabled: Cannot move any further"))
|
||||||
}).
|
}).
|
||||||
TopLines(
|
TopLines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("squash").Contains("commit 07").IsSelected(),
|
Contains("squash").Contains("commit 07").IsSelected(),
|
||||||
Contains("squash").Contains("commit 06").IsSelected(),
|
Contains("squash").Contains("commit 06").IsSelected(),
|
||||||
Contains("pick").Contains("commit 10"),
|
Contains("pick").Contains("commit 10"),
|
||||||
Contains("pick").Contains("commit 09"),
|
Contains("pick").Contains("commit 09"),
|
||||||
Contains("pick").Contains("commit 08"),
|
Contains("pick").Contains("commit 08"),
|
||||||
Contains("<-- YOU ARE HERE --- commit 05"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 05"),
|
||||||
Contains("commit 04"),
|
Contains("commit 04"),
|
||||||
).
|
).
|
||||||
// Verify we can't perform an action on a range that includes both
|
// Verify we can't perform an action on a range that includes both
|
||||||
|
@ -145,12 +167,14 @@ var MidRebaseRangeSelect = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
NavigateToLine(Contains("commit 08")).
|
NavigateToLine(Contains("commit 08")).
|
||||||
Press(keys.Universal.RangeSelectDown).
|
Press(keys.Universal.RangeSelectDown).
|
||||||
TopLines(
|
TopLines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("squash").Contains("commit 07"),
|
Contains("squash").Contains("commit 07"),
|
||||||
Contains("squash").Contains("commit 06"),
|
Contains("squash").Contains("commit 06"),
|
||||||
Contains("pick").Contains("commit 10"),
|
Contains("pick").Contains("commit 10"),
|
||||||
Contains("pick").Contains("commit 09"),
|
Contains("pick").Contains("commit 09"),
|
||||||
Contains("pick").Contains("commit 08").IsSelected(),
|
Contains("pick").Contains("commit 08").IsSelected(),
|
||||||
Contains("<-- YOU ARE HERE --- commit 05").IsSelected(),
|
Contains("--- Commits ---").IsSelected(),
|
||||||
|
Contains("commit 05").IsSelected(),
|
||||||
Contains("commit 04"),
|
Contains("commit 04"),
|
||||||
).
|
).
|
||||||
Press(keys.Commits.MarkCommitAsFixup).
|
Press(keys.Commits.MarkCommitAsFixup).
|
||||||
|
@ -158,12 +182,14 @@ var MidRebaseRangeSelect = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
t.ExpectToast(Contains("Disabled: When rebasing, this action only works on a selection of TODO commits."))
|
t.ExpectToast(Contains("Disabled: When rebasing, this action only works on a selection of TODO commits."))
|
||||||
}).
|
}).
|
||||||
TopLines(
|
TopLines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("squash").Contains("commit 07"),
|
Contains("squash").Contains("commit 07"),
|
||||||
Contains("squash").Contains("commit 06"),
|
Contains("squash").Contains("commit 06"),
|
||||||
Contains("pick").Contains("commit 10"),
|
Contains("pick").Contains("commit 10"),
|
||||||
Contains("pick").Contains("commit 09"),
|
Contains("pick").Contains("commit 09"),
|
||||||
Contains("pick").Contains("commit 08").IsSelected(),
|
Contains("pick").Contains("commit 08").IsSelected(),
|
||||||
Contains("<-- YOU ARE HERE --- commit 05").IsSelected(),
|
Contains("--- Commits ---").IsSelected(),
|
||||||
|
Contains("commit 05").IsSelected(),
|
||||||
Contains("commit 04"),
|
Contains("commit 04"),
|
||||||
).
|
).
|
||||||
// continue the rebase
|
// continue the rebase
|
||||||
|
|
|
@ -25,25 +25,31 @@ var MoveInRebase = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
NavigateToLine(Contains("commit 01")).
|
NavigateToLine(Contains("commit 01")).
|
||||||
Press(keys.Universal.Edit).
|
Press(keys.Universal.Edit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("commit 04"),
|
Contains("commit 04"),
|
||||||
Contains("commit 03"),
|
Contains("commit 03"),
|
||||||
Contains("commit 02"),
|
Contains("commit 02"),
|
||||||
Contains("YOU ARE HERE").Contains("commit 01").IsSelected(),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 01").IsSelected(),
|
||||||
).
|
).
|
||||||
SelectPreviousItem().
|
SelectPreviousItem().
|
||||||
Press(keys.Commits.MoveUpCommit).
|
Press(keys.Commits.MoveUpCommit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("commit 04"),
|
Contains("commit 04"),
|
||||||
Contains("commit 02").IsSelected(),
|
Contains("commit 02").IsSelected(),
|
||||||
Contains("commit 03"),
|
Contains("commit 03"),
|
||||||
Contains("YOU ARE HERE").Contains("commit 01"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 01"),
|
||||||
).
|
).
|
||||||
Press(keys.Commits.MoveUpCommit).
|
Press(keys.Commits.MoveUpCommit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("commit 02").IsSelected(),
|
Contains("commit 02").IsSelected(),
|
||||||
Contains("commit 04"),
|
Contains("commit 04"),
|
||||||
Contains("commit 03"),
|
Contains("commit 03"),
|
||||||
Contains("YOU ARE HERE").Contains("commit 01"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 01"),
|
||||||
).
|
).
|
||||||
// assert we can't move past the top
|
// assert we can't move past the top
|
||||||
Press(keys.Commits.MoveUpCommit).
|
Press(keys.Commits.MoveUpCommit).
|
||||||
|
@ -51,24 +57,30 @@ var MoveInRebase = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
t.ExpectToast(Contains("Disabled: Cannot move any further"))
|
t.ExpectToast(Contains("Disabled: Cannot move any further"))
|
||||||
}).
|
}).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("commit 02").IsSelected(),
|
Contains("commit 02").IsSelected(),
|
||||||
Contains("commit 04"),
|
Contains("commit 04"),
|
||||||
Contains("commit 03"),
|
Contains("commit 03"),
|
||||||
Contains("YOU ARE HERE").Contains("commit 01"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 01"),
|
||||||
).
|
).
|
||||||
Press(keys.Commits.MoveDownCommit).
|
Press(keys.Commits.MoveDownCommit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("commit 04"),
|
Contains("commit 04"),
|
||||||
Contains("commit 02").IsSelected(),
|
Contains("commit 02").IsSelected(),
|
||||||
Contains("commit 03"),
|
Contains("commit 03"),
|
||||||
Contains("YOU ARE HERE").Contains("commit 01"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 01"),
|
||||||
).
|
).
|
||||||
Press(keys.Commits.MoveDownCommit).
|
Press(keys.Commits.MoveDownCommit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("commit 04"),
|
Contains("commit 04"),
|
||||||
Contains("commit 03"),
|
Contains("commit 03"),
|
||||||
Contains("commit 02").IsSelected(),
|
Contains("commit 02").IsSelected(),
|
||||||
Contains("YOU ARE HERE").Contains("commit 01"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 01"),
|
||||||
).
|
).
|
||||||
// assert we can't move past the bottom
|
// assert we can't move past the bottom
|
||||||
Press(keys.Commits.MoveDownCommit).
|
Press(keys.Commits.MoveDownCommit).
|
||||||
|
@ -76,18 +88,22 @@ var MoveInRebase = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
t.ExpectToast(Contains("Disabled: Cannot move any further"))
|
t.ExpectToast(Contains("Disabled: Cannot move any further"))
|
||||||
}).
|
}).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("commit 04"),
|
Contains("commit 04"),
|
||||||
Contains("commit 03"),
|
Contains("commit 03"),
|
||||||
Contains("commit 02").IsSelected(),
|
Contains("commit 02").IsSelected(),
|
||||||
Contains("YOU ARE HERE").Contains("commit 01"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 01"),
|
||||||
).
|
).
|
||||||
// move it back up one so that we land in a different order than we started with
|
// move it back up one so that we land in a different order than we started with
|
||||||
Press(keys.Commits.MoveUpCommit).
|
Press(keys.Commits.MoveUpCommit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("commit 04"),
|
Contains("commit 04"),
|
||||||
Contains("commit 02").IsSelected(),
|
Contains("commit 02").IsSelected(),
|
||||||
Contains("commit 03"),
|
Contains("commit 03"),
|
||||||
Contains("YOU ARE HERE").Contains("commit 01"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 01"),
|
||||||
).
|
).
|
||||||
Tap(func() {
|
Tap(func() {
|
||||||
t.Common().ContinueRebase()
|
t.Common().ContinueRebase()
|
||||||
|
@ -96,7 +112,7 @@ var MoveInRebase = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
Contains("commit 04"),
|
Contains("commit 04"),
|
||||||
Contains("commit 02").IsSelected(),
|
Contains("commit 02").IsSelected(),
|
||||||
Contains("commit 03"),
|
Contains("commit 03"),
|
||||||
DoesNotContain("YOU ARE HERE").Contains("commit 01"),
|
Contains("commit 01"),
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
@ -26,25 +26,29 @@ var MoveUpdateRefTodo = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
NavigateToLine(Contains("commit 01")).
|
NavigateToLine(Contains("commit 01")).
|
||||||
Press(keys.Universal.Edit).
|
Press(keys.Universal.Edit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("CI commit 06"),
|
Contains("pick").Contains("CI commit 06"),
|
||||||
Contains("pick").Contains("CI commit 05"),
|
Contains("pick").Contains("CI commit 05"),
|
||||||
Contains("pick").Contains("CI commit 04"),
|
Contains("pick").Contains("CI commit 04"),
|
||||||
Contains("update-ref").Contains("branch1"),
|
Contains("update-ref").Contains("branch1"),
|
||||||
Contains("pick").Contains("CI commit 03"),
|
Contains("pick").Contains("CI commit 03"),
|
||||||
Contains("pick").Contains("CI commit 02"),
|
Contains("pick").Contains("CI commit 02"),
|
||||||
Contains("CI ◯ <-- YOU ARE HERE --- commit 01"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("CI ◯ commit 01"),
|
||||||
).
|
).
|
||||||
NavigateToLine(Contains("update-ref")).
|
NavigateToLine(Contains("update-ref")).
|
||||||
Press(keys.Commits.MoveUpCommit).
|
Press(keys.Commits.MoveUpCommit).
|
||||||
Press(keys.Commits.MoveUpCommit).
|
Press(keys.Commits.MoveUpCommit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("CI commit 06"),
|
Contains("pick").Contains("CI commit 06"),
|
||||||
Contains("update-ref").Contains("branch1"),
|
Contains("update-ref").Contains("branch1"),
|
||||||
Contains("pick").Contains("CI commit 05"),
|
Contains("pick").Contains("CI commit 05"),
|
||||||
Contains("pick").Contains("CI commit 04"),
|
Contains("pick").Contains("CI commit 04"),
|
||||||
Contains("pick").Contains("CI commit 03"),
|
Contains("pick").Contains("CI commit 03"),
|
||||||
Contains("pick").Contains("CI commit 02"),
|
Contains("pick").Contains("CI commit 02"),
|
||||||
Contains("CI ◯ <-- YOU ARE HERE --- commit 01"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("CI ◯ commit 01"),
|
||||||
).
|
).
|
||||||
Tap(func() {
|
Tap(func() {
|
||||||
t.Common().ContinueRebase()
|
t.Common().ContinueRebase()
|
||||||
|
|
|
@ -26,9 +26,11 @@ var PickRescheduled = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
NavigateToLine(Contains("one")).
|
NavigateToLine(Contains("one")).
|
||||||
Press(keys.Universal.Edit).
|
Press(keys.Universal.Edit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("three"),
|
Contains("pick").Contains("three"),
|
||||||
Contains("pick").Contains("two"),
|
Contains("pick").Contains("two"),
|
||||||
Contains("<-- YOU ARE HERE --- one").IsSelected(),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("one").IsSelected(),
|
||||||
).
|
).
|
||||||
Tap(func() {
|
Tap(func() {
|
||||||
t.Shell().CreateFile("file3", "other content\n")
|
t.Shell().CreateFile("file3", "other content\n")
|
||||||
|
@ -39,8 +41,10 @@ var PickRescheduled = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
Confirm()
|
Confirm()
|
||||||
}).
|
}).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("three"),
|
Contains("pick").Contains("three"),
|
||||||
Contains("<-- YOU ARE HERE --- two"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("two"),
|
||||||
Contains("one"),
|
Contains("one"),
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
|
@ -73,9 +73,11 @@ var QuickStart = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
// Verify quick start picks the last commit on the main branch
|
// Verify quick start picks the last commit on the main branch
|
||||||
Press(keys.Commits.StartInteractiveRebase).
|
Press(keys.Commits.StartInteractiveRebase).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("feature-branch two").IsSelected(),
|
Contains("feature-branch two").IsSelected(),
|
||||||
Contains("feature-branch one"),
|
Contains("feature-branch one"),
|
||||||
Contains("last main commit").Contains("YOU ARE HERE"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("last main commit"),
|
||||||
Contains("initial commit"),
|
Contains("initial commit"),
|
||||||
).
|
).
|
||||||
// Try again, verify we fail because we're already rebasing
|
// Try again, verify we fail because we're already rebasing
|
||||||
|
@ -104,8 +106,10 @@ var QuickStart = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
).
|
).
|
||||||
Press(keys.Commits.StartInteractiveRebase).
|
Press(keys.Commits.StartInteractiveRebase).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("branch-with-merge three").IsSelected(),
|
Contains("branch-with-merge three").IsSelected(),
|
||||||
Contains("Merge branch 'branch-to-merge'").Contains("YOU ARE HERE"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("Merge branch 'branch-to-merge'"),
|
||||||
Contains("branch-to-merge two"),
|
Contains("branch-to-merge two"),
|
||||||
Contains("branch-to-merge one"),
|
Contains("branch-to-merge one"),
|
||||||
Contains("branch-with-merge two"),
|
Contains("branch-with-merge two"),
|
||||||
|
|
|
@ -39,6 +39,7 @@ var QuickStartKeepSelection = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
NavigateToLine(Contains("commit 02")).
|
NavigateToLine(Contains("commit 02")).
|
||||||
Press(keys.Commits.StartInteractiveRebase).
|
Press(keys.Commits.StartInteractiveRebase).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("CI commit 07"),
|
Contains("pick").Contains("CI commit 07"),
|
||||||
Contains("pick").Contains("CI commit 06"),
|
Contains("pick").Contains("CI commit 06"),
|
||||||
Contains("pick").Contains("CI commit 05"),
|
Contains("pick").Contains("CI commit 05"),
|
||||||
|
@ -46,7 +47,8 @@ var QuickStartKeepSelection = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
Contains("pick").Contains("CI commit 04"),
|
Contains("pick").Contains("CI commit 04"),
|
||||||
Contains("pick").Contains("CI commit 03"),
|
Contains("pick").Contains("CI commit 03"),
|
||||||
Contains("CI commit 02").IsSelected(),
|
Contains("CI commit 02").IsSelected(),
|
||||||
Contains("CI <-- YOU ARE HERE --- commit 01"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("CI commit 01"),
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
@ -43,6 +43,7 @@ var QuickStartKeepSelectionRange = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
).
|
).
|
||||||
Press(keys.Commits.StartInteractiveRebase).
|
Press(keys.Commits.StartInteractiveRebase).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("CI commit 07"),
|
Contains("CI commit 07"),
|
||||||
Contains("CI commit 06"),
|
Contains("CI commit 06"),
|
||||||
Contains("update-ref").Contains("branch2"),
|
Contains("update-ref").Contains("branch2"),
|
||||||
|
@ -51,7 +52,8 @@ var QuickStartKeepSelectionRange = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
Contains("update-ref").Contains("branch1").IsSelected(),
|
Contains("update-ref").Contains("branch1").IsSelected(),
|
||||||
Contains("CI commit 03").IsSelected(),
|
Contains("CI commit 03").IsSelected(),
|
||||||
Contains("CI commit 02").IsSelected(),
|
Contains("CI commit 02").IsSelected(),
|
||||||
Contains("CI <-- YOU ARE HERE --- commit 01"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("CI commit 01"),
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
@ -34,60 +34,72 @@ var Rebase = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
NavigateToLine(Contains("first commit to edit")).
|
NavigateToLine(Contains("first commit to edit")).
|
||||||
Press(keys.Universal.Edit).
|
Press(keys.Universal.Edit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
MatchesRegexp("pick.*commit to fixup"),
|
MatchesRegexp("pick.*commit to fixup"),
|
||||||
MatchesRegexp("pick.*commit to drop"),
|
MatchesRegexp("pick.*commit to drop"),
|
||||||
MatchesRegexp("pick.*second commit to edit"),
|
MatchesRegexp("pick.*second commit to edit"),
|
||||||
MatchesRegexp("pick.*commit to squash"),
|
MatchesRegexp("pick.*commit to squash"),
|
||||||
MatchesRegexp("YOU ARE HERE.*first commit to edit").IsSelected(),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("first commit to edit").IsSelected(),
|
||||||
Contains("initial commit"),
|
Contains("initial commit"),
|
||||||
).
|
).
|
||||||
SelectPreviousItem().
|
SelectPreviousItem().
|
||||||
Press(keys.Commits.SquashDown).
|
Press(keys.Commits.SquashDown).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
MatchesRegexp("pick.*commit to fixup"),
|
MatchesRegexp("pick.*commit to fixup"),
|
||||||
MatchesRegexp("pick.*commit to drop"),
|
MatchesRegexp("pick.*commit to drop"),
|
||||||
MatchesRegexp("pick.*second commit to edit"),
|
MatchesRegexp("pick.*second commit to edit"),
|
||||||
MatchesRegexp("squash.*commit to squash").IsSelected(),
|
MatchesRegexp("squash.*commit to squash").IsSelected(),
|
||||||
MatchesRegexp("YOU ARE HERE.*first commit to edit"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("first commit to edit"),
|
||||||
Contains("initial commit"),
|
Contains("initial commit"),
|
||||||
).
|
).
|
||||||
SelectPreviousItem().
|
SelectPreviousItem().
|
||||||
Press(keys.Universal.Edit).
|
Press(keys.Universal.Edit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
MatchesRegexp("pick.*commit to fixup"),
|
MatchesRegexp("pick.*commit to fixup"),
|
||||||
MatchesRegexp("pick.*commit to drop"),
|
MatchesRegexp("pick.*commit to drop"),
|
||||||
MatchesRegexp("edit.*second commit to edit").IsSelected(),
|
MatchesRegexp("edit.*second commit to edit").IsSelected(),
|
||||||
MatchesRegexp("squash.*commit to squash"),
|
MatchesRegexp("squash.*commit to squash"),
|
||||||
MatchesRegexp("YOU ARE HERE.*first commit to edit"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("first commit to edit"),
|
||||||
Contains("initial commit"),
|
Contains("initial commit"),
|
||||||
).
|
).
|
||||||
SelectPreviousItem().
|
SelectPreviousItem().
|
||||||
Press(keys.Universal.Remove).
|
Press(keys.Universal.Remove).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
MatchesRegexp("pick.*commit to fixup"),
|
MatchesRegexp("pick.*commit to fixup"),
|
||||||
MatchesRegexp("drop.*commit to drop").IsSelected(),
|
MatchesRegexp("drop.*commit to drop").IsSelected(),
|
||||||
MatchesRegexp("edit.*second commit to edit"),
|
MatchesRegexp("edit.*second commit to edit"),
|
||||||
MatchesRegexp("squash.*commit to squash"),
|
MatchesRegexp("squash.*commit to squash"),
|
||||||
MatchesRegexp("YOU ARE HERE.*first commit to edit"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("first commit to edit"),
|
||||||
Contains("initial commit"),
|
Contains("initial commit"),
|
||||||
).
|
).
|
||||||
SelectPreviousItem().
|
SelectPreviousItem().
|
||||||
Press(keys.Commits.MarkCommitAsFixup).
|
Press(keys.Commits.MarkCommitAsFixup).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
MatchesRegexp("fixup.*commit to fixup").IsSelected(),
|
MatchesRegexp("fixup.*commit to fixup").IsSelected(),
|
||||||
MatchesRegexp("drop.*commit to drop"),
|
MatchesRegexp("drop.*commit to drop"),
|
||||||
MatchesRegexp("edit.*second commit to edit"),
|
MatchesRegexp("edit.*second commit to edit"),
|
||||||
MatchesRegexp("squash.*commit to squash"),
|
MatchesRegexp("squash.*commit to squash"),
|
||||||
MatchesRegexp("YOU ARE HERE.*first commit to edit"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("first commit to edit"),
|
||||||
Contains("initial commit"),
|
Contains("initial commit"),
|
||||||
).
|
).
|
||||||
Tap(func() {
|
Tap(func() {
|
||||||
t.Common().ContinueRebase()
|
t.Common().ContinueRebase()
|
||||||
}).
|
}).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
MatchesRegexp("fixup.*commit to fixup").IsSelected(),
|
MatchesRegexp("fixup.*commit to fixup").IsSelected(),
|
||||||
MatchesRegexp("drop.*commit to drop"),
|
MatchesRegexp("drop.*commit to drop"),
|
||||||
MatchesRegexp("YOU ARE HERE.*second commit to edit"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("second commit to edit"),
|
||||||
MatchesRegexp("first commit to edit"),
|
MatchesRegexp("first commit to edit"),
|
||||||
Contains("initial commit"),
|
Contains("initial commit"),
|
||||||
).
|
).
|
||||||
|
|
|
@ -30,8 +30,10 @@ var RevertDuringRebaseWhenStoppedOnEdit = NewIntegrationTest(NewIntegrationTestA
|
||||||
NavigateToLine(Contains("commit 03")).
|
NavigateToLine(Contains("commit 03")).
|
||||||
Press(keys.Universal.Edit).
|
Press(keys.Universal.Edit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("commit 04"),
|
Contains("pick").Contains("commit 04"),
|
||||||
Contains("<-- YOU ARE HERE --- commit 03").IsSelected(),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 03").IsSelected(),
|
||||||
Contains("commit 02"),
|
Contains("commit 02"),
|
||||||
Contains("commit 01"),
|
Contains("commit 01"),
|
||||||
Contains("master commit 2"),
|
Contains("master commit 2"),
|
||||||
|
@ -47,8 +49,10 @@ var RevertDuringRebaseWhenStoppedOnEdit = NewIntegrationTest(NewIntegrationTestA
|
||||||
Confirm()
|
Confirm()
|
||||||
}).
|
}).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("commit 04"),
|
Contains("pick").Contains("commit 04"),
|
||||||
Contains(`<-- YOU ARE HERE --- Revert "commit 01"`),
|
Contains("--- Commits ---"),
|
||||||
|
Contains(`Revert "commit 01"`),
|
||||||
Contains(`Revert "commit 02"`),
|
Contains(`Revert "commit 02"`),
|
||||||
Contains("commit 03"),
|
Contains("commit 03"),
|
||||||
Contains("commit 02").IsSelected(),
|
Contains("commit 02").IsSelected(),
|
||||||
|
|
|
@ -50,10 +50,13 @@ var RevertMultipleCommitsInInteractiveRebase = NewIntegrationTest(NewIntegration
|
||||||
Confirm()
|
Confirm()
|
||||||
}).
|
}).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("CI unrelated change 3"),
|
Contains("CI unrelated change 3"),
|
||||||
Contains("CI unrelated change 2"),
|
Contains("CI unrelated change 2"),
|
||||||
|
Contains("--- Pending reverts ---"),
|
||||||
Contains("revert").Contains("CI unrelated change 1"),
|
Contains("revert").Contains("CI unrelated change 1"),
|
||||||
Contains("revert").Contains("CI <-- CONFLICT --- add first line"),
|
Contains("revert").Contains("CI <-- CONFLICT --- add first line"),
|
||||||
|
Contains("--- Commits ---"),
|
||||||
Contains("CI ◯ add second line"),
|
Contains("CI ◯ add second line"),
|
||||||
Contains("CI ◯ add first line"),
|
Contains("CI ◯ add first line"),
|
||||||
Contains("CI ◯ unrelated change 1"),
|
Contains("CI ◯ unrelated change 1"),
|
||||||
|
@ -80,9 +83,11 @@ var RevertMultipleCommitsInInteractiveRebase = NewIntegrationTest(NewIntegration
|
||||||
|
|
||||||
t.Views().Commits().
|
t.Views().Commits().
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("CI unrelated change 3"),
|
Contains("pick").Contains("CI unrelated change 3"),
|
||||||
Contains("pick").Contains("CI unrelated change 2"),
|
Contains("pick").Contains("CI unrelated change 2"),
|
||||||
Contains(`CI ◯ <-- YOU ARE HERE --- Revert "unrelated change 1"`),
|
Contains("--- Commits ---"),
|
||||||
|
Contains(`CI ◯ Revert "unrelated change 1"`),
|
||||||
Contains(`CI ◯ Revert "add first line"`),
|
Contains(`CI ◯ Revert "add first line"`),
|
||||||
Contains("CI ◯ add second line"),
|
Contains("CI ◯ add second line"),
|
||||||
Contains("CI ◯ add first line"),
|
Contains("CI ◯ add first line"),
|
||||||
|
|
|
@ -45,9 +45,12 @@ var RevertSingleCommitInInteractiveRebase = NewIntegrationTest(NewIntegrationTes
|
||||||
Cancel() // stay in commits panel
|
Cancel() // stay in commits panel
|
||||||
}).
|
}).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("CI unrelated change 2"),
|
Contains("CI unrelated change 2"),
|
||||||
Contains("CI unrelated change 1"),
|
Contains("CI unrelated change 1"),
|
||||||
|
Contains("--- Pending reverts ---"),
|
||||||
Contains("revert").Contains("CI <-- CONFLICT --- add first line"),
|
Contains("revert").Contains("CI <-- CONFLICT --- add first line"),
|
||||||
|
Contains("--- Commits ---"),
|
||||||
Contains("CI ◯ add second line"),
|
Contains("CI ◯ add second line"),
|
||||||
Contains("CI ◯ add first line").IsSelected(),
|
Contains("CI ◯ add first line").IsSelected(),
|
||||||
Contains("CI ◯ add empty file"),
|
Contains("CI ◯ add empty file"),
|
||||||
|
@ -81,9 +84,11 @@ var RevertSingleCommitInInteractiveRebase = NewIntegrationTest(NewIntegrationTes
|
||||||
|
|
||||||
t.Views().Commits().
|
t.Views().Commits().
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("CI unrelated change 2"),
|
Contains("pick").Contains("CI unrelated change 2"),
|
||||||
Contains("pick").Contains("CI unrelated change 1"),
|
Contains("pick").Contains("CI unrelated change 1"),
|
||||||
Contains(`CI ◯ <-- YOU ARE HERE --- Revert "add first line"`),
|
Contains("--- Commits ---"),
|
||||||
|
Contains(`CI ◯ Revert "add first line"`),
|
||||||
Contains("CI ◯ add second line"),
|
Contains("CI ◯ add second line"),
|
||||||
Contains("CI ◯ add first line"),
|
Contains("CI ◯ add first line"),
|
||||||
Contains("CI ◯ add empty file"),
|
Contains("CI ◯ add empty file"),
|
||||||
|
|
|
@ -33,8 +33,10 @@ var RewordCommitWithEditorAndFail = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
Confirm()
|
Confirm()
|
||||||
}).
|
}).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("commit 03"),
|
Contains("commit 03"),
|
||||||
Contains("<-- YOU ARE HERE --- commit 02").IsSelected(),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 02").IsSelected(),
|
||||||
Contains("commit 01"),
|
Contains("commit 01"),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,10 @@ var RewordYouAreHereCommit = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
NavigateToLine(Contains("commit 02")).
|
NavigateToLine(Contains("commit 02")).
|
||||||
Press(keys.Universal.Edit).
|
Press(keys.Universal.Edit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("commit 03"),
|
Contains("commit 03"),
|
||||||
Contains("<-- YOU ARE HERE --- commit 02").IsSelected(),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 02").IsSelected(),
|
||||||
Contains("commit 01"),
|
Contains("commit 01"),
|
||||||
).
|
).
|
||||||
Press(keys.Commits.RenameCommit).
|
Press(keys.Commits.RenameCommit).
|
||||||
|
@ -39,8 +41,10 @@ var RewordYouAreHereCommit = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
Confirm()
|
Confirm()
|
||||||
}).
|
}).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("commit 03"),
|
Contains("commit 03"),
|
||||||
Contains("<-- YOU ARE HERE --- renamed 02").IsSelected(),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("renamed 02").IsSelected(),
|
||||||
Contains("commit 01"),
|
Contains("commit 01"),
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
|
@ -27,8 +27,10 @@ var RewordYouAreHereCommitWithEditor = NewIntegrationTest(NewIntegrationTestArgs
|
||||||
NavigateToLine(Contains("commit 02")).
|
NavigateToLine(Contains("commit 02")).
|
||||||
Press(keys.Universal.Edit).
|
Press(keys.Universal.Edit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("commit 03"),
|
Contains("commit 03"),
|
||||||
Contains("<-- YOU ARE HERE --- commit 02").IsSelected(),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit 02").IsSelected(),
|
||||||
Contains("commit 01"),
|
Contains("commit 01"),
|
||||||
).
|
).
|
||||||
Press(keys.Commits.RenameCommitWithEditor).
|
Press(keys.Commits.RenameCommitWithEditor).
|
||||||
|
@ -39,8 +41,10 @@ var RewordYouAreHereCommitWithEditor = NewIntegrationTest(NewIntegrationTestArgs
|
||||||
Confirm()
|
Confirm()
|
||||||
}).
|
}).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("commit 03"),
|
Contains("commit 03"),
|
||||||
Contains("<-- YOU ARE HERE --- renamed 02").IsSelected(),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("renamed 02").IsSelected(),
|
||||||
Contains("commit 01"),
|
Contains("commit 01"),
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
|
@ -9,8 +9,10 @@ func handleConflictsFromSwap(t *TestDriver, expectedCommand string) {
|
||||||
|
|
||||||
t.Views().Commits().
|
t.Views().Commits().
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("commit two"),
|
Contains("pick").Contains("commit two"),
|
||||||
Contains(expectedCommand).Contains("<-- CONFLICT --- commit three"),
|
Contains(expectedCommand).Contains("<-- CONFLICT --- commit three"),
|
||||||
|
Contains("--- Commits ---"),
|
||||||
Contains("commit one"),
|
Contains("commit one"),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -31,9 +31,11 @@ var ShowExecTodos = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
t.ExpectPopup().Alert().Title(Equals("Error")).Content(Contains("Rebasing (2/4)Executing: false")).Confirm()
|
t.ExpectPopup().Alert().Title(Equals("Error")).Content(Contains("Rebasing (2/4)Executing: false")).Confirm()
|
||||||
}).
|
}).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("exec").Contains("false"),
|
Contains("exec").Contains("false"),
|
||||||
Contains("pick").Contains("CI commit 03"),
|
Contains("pick").Contains("CI commit 03"),
|
||||||
Contains("CI ◯ <-- YOU ARE HERE --- commit 02"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("CI ◯ commit 02"),
|
||||||
Contains("CI ◯ commit 01"),
|
Contains("CI ◯ commit 01"),
|
||||||
).
|
).
|
||||||
Tap(func() {
|
Tap(func() {
|
||||||
|
@ -41,7 +43,9 @@ var ShowExecTodos = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
t.ExpectPopup().Alert().Title(Equals("Error")).Content(Contains("exit status 1")).Confirm()
|
t.ExpectPopup().Alert().Title(Equals("Error")).Content(Contains("exit status 1")).Confirm()
|
||||||
}).
|
}).
|
||||||
Lines(
|
Lines(
|
||||||
Contains("CI ◯ <-- YOU ARE HERE --- commit 03"),
|
Contains("--- Pending rebase todos ---"),
|
||||||
|
Contains("--- Commits ---"),
|
||||||
|
Contains("CI ◯ commit 03"),
|
||||||
Contains("CI ◯ commit 02"),
|
Contains("CI ◯ commit 02"),
|
||||||
Contains("CI ◯ commit 01"),
|
Contains("CI ◯ commit 01"),
|
||||||
).
|
).
|
||||||
|
|
|
@ -29,16 +29,20 @@ var SwapInRebaseWithConflict = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
NavigateToLine(Contains("commit one")).
|
NavigateToLine(Contains("commit one")).
|
||||||
Press(keys.Universal.Edit).
|
Press(keys.Universal.Edit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("commit three"),
|
Contains("commit three"),
|
||||||
Contains("commit two"),
|
Contains("commit two"),
|
||||||
Contains("YOU ARE HERE").Contains("commit one").IsSelected(),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit one").IsSelected(),
|
||||||
).
|
).
|
||||||
SelectPreviousItem().
|
SelectPreviousItem().
|
||||||
Press(keys.Commits.MoveUpCommit).
|
Press(keys.Commits.MoveUpCommit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("commit two").IsSelected(),
|
Contains("commit two").IsSelected(),
|
||||||
Contains("commit three"),
|
Contains("commit three"),
|
||||||
Contains("YOU ARE HERE").Contains("commit one"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit one"),
|
||||||
).
|
).
|
||||||
Tap(func() {
|
Tap(func() {
|
||||||
t.Common().ContinueRebase()
|
t.Common().ContinueRebase()
|
||||||
|
|
|
@ -29,16 +29,20 @@ var SwapInRebaseWithConflictAndEdit = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
NavigateToLine(Contains("commit one")).
|
NavigateToLine(Contains("commit one")).
|
||||||
Press(keys.Universal.Edit).
|
Press(keys.Universal.Edit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("commit three"),
|
Contains("commit three"),
|
||||||
Contains("commit two"),
|
Contains("commit two"),
|
||||||
Contains("<-- YOU ARE HERE --- commit one").IsSelected(),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit one").IsSelected(),
|
||||||
).
|
).
|
||||||
NavigateToLine(Contains("commit two")).
|
NavigateToLine(Contains("commit two")).
|
||||||
Press(keys.Commits.MoveUpCommit).
|
Press(keys.Commits.MoveUpCommit).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("commit two").IsSelected(),
|
Contains("commit two").IsSelected(),
|
||||||
Contains("commit three"),
|
Contains("commit three"),
|
||||||
Contains("<-- YOU ARE HERE --- commit one"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("commit one"),
|
||||||
).
|
).
|
||||||
NavigateToLine(Contains("commit three")).
|
NavigateToLine(Contains("commit three")).
|
||||||
Press(keys.Universal.Edit).
|
Press(keys.Universal.Edit).
|
||||||
|
|
|
@ -28,10 +28,12 @@ var ViewFilesOfTodoEntries = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
Focus().
|
Focus().
|
||||||
Press(keys.Commits.StartInteractiveRebase).
|
Press(keys.Commits.StartInteractiveRebase).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("CI commit 03").IsSelected(),
|
Contains("pick").Contains("CI commit 03").IsSelected(),
|
||||||
Contains("update-ref").Contains("branch1"),
|
Contains("update-ref").Contains("branch1"),
|
||||||
Contains("pick").Contains("CI commit 02"),
|
Contains("pick").Contains("CI commit 02"),
|
||||||
Contains("CI <-- YOU ARE HERE --- commit 01"),
|
Contains("--- Commits ---"),
|
||||||
|
Contains("CI commit 01"),
|
||||||
).
|
).
|
||||||
Press(keys.Universal.GoInto)
|
Press(keys.Universal.GoInto)
|
||||||
|
|
||||||
|
|
|
@ -107,8 +107,8 @@ var Reset = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
|
|
||||||
// submodule has been hard reset to the commit the parent repo specifies
|
// submodule has been hard reset to the commit the parent repo specifies
|
||||||
t.Views().Branches().Lines(
|
t.Views().Branches().Lines(
|
||||||
Contains("HEAD detached").IsSelected(),
|
Contains("HEAD detached"),
|
||||||
Contains("master"),
|
Contains("master").IsSelected(),
|
||||||
)
|
)
|
||||||
|
|
||||||
// empty commit is gone
|
// empty commit is gone
|
||||||
|
|
|
@ -48,8 +48,10 @@ var PullRebaseInteractiveConflict = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
|
|
||||||
t.Views().Commits().
|
t.Views().Commits().
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("five"),
|
Contains("pick").Contains("five"),
|
||||||
Contains("pick").Contains("CONFLICT").Contains("four"),
|
Contains("pick").Contains("CONFLICT").Contains("four"),
|
||||||
|
Contains("--- Commits ---"),
|
||||||
Contains("three"),
|
Contains("three"),
|
||||||
Contains("two"),
|
Contains("two"),
|
||||||
Contains("one"),
|
Contains("one"),
|
||||||
|
|
|
@ -49,16 +49,20 @@ var PullRebaseInteractiveConflictDrop = NewIntegrationTest(NewIntegrationTestArg
|
||||||
t.Views().Commits().
|
t.Views().Commits().
|
||||||
Focus().
|
Focus().
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("pick").Contains("five").IsSelected(),
|
Contains("pick").Contains("five").IsSelected(),
|
||||||
Contains("pick").Contains("CONFLICT").Contains("four"),
|
Contains("pick").Contains("CONFLICT").Contains("four"),
|
||||||
|
Contains("--- Commits ---"),
|
||||||
Contains("three"),
|
Contains("three"),
|
||||||
Contains("two"),
|
Contains("two"),
|
||||||
Contains("one"),
|
Contains("one"),
|
||||||
).
|
).
|
||||||
Press(keys.Universal.Remove).
|
Press(keys.Universal.Remove).
|
||||||
Lines(
|
Lines(
|
||||||
|
Contains("--- Pending rebase todos ---"),
|
||||||
Contains("drop").Contains("five").IsSelected(),
|
Contains("drop").Contains("five").IsSelected(),
|
||||||
Contains("pick").Contains("CONFLICT").Contains("four"),
|
Contains("pick").Contains("CONFLICT").Contains("four"),
|
||||||
|
Contains("--- Commits ---"),
|
||||||
Contains("three"),
|
Contains("three"),
|
||||||
Contains("two"),
|
Contains("two"),
|
||||||
Contains("one"),
|
Contains("one"),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue