示例#1
0
def test_ftrbr_integrate_rebase_detachedhead():
    oriR, cloR = utils.clone_makebr_edit_commit_repo(utils.DIR_REPO_CLONE_FTRBR_INTEGRATE)

    so,se,rc = cloR.exe_cmd_succ('git checkout HEAD~1')
    so,se,rc = cloR.exe_cmd_deny('git ftrbr-integrate-rebase')
    nt.eq_(se, "detached-head\nCannot integrate.")
    nt.eq_(so, '')
示例#2
0
def test_ftrbr_integrate_rebase_nointbr():
    oriR, cloR = utils.clone_makebr_edit_commit_repo(utils.DIR_REPO_CLONE_FTRBR_INTEGRATE)

    so,se,rc = cloR.exe_cmd_succ('git intbr-unset')
    so,se,rc = cloR.exe_cmd_deny('git ftrbr-integrate-rebase')
    nt.eq_(so, "")
    nt.eq_(se, "Integration branch not set")
示例#3
0
def test_ftrbr_integrate():
    oriR, cloR = utils.clone_makebr_edit_commit_repo(utils.DIR_REPO_CLONE_FTRBR_INTEGRATE)

    so,se,rc = cloR.exe_cmd_succ('git ftrbr-integrate')
    nt.assert_in("Switched to branch 'master'",      se)
    nt.assert_in("Pulling 'master'",                 so)
    nt.assert_in("Merging 'ftr/work' into 'master'", so)
示例#4
0
def test_ftrbr_push_rebase_detachedhead():
    oriR, cloR = utils.clone_makebr_edit_commit_repo(utils.DIR_REPO_CLONE_FTRBR_PUSH)

    so, se, rc = cloR.exe_cmd_succ("git checkout HEAD~1")
    so, se, rc = cloR.exe_cmd_deny("git ftrbr-push-rebase")
    nt.eq_(se, "detached-head\nCannot integrate.")
    nt.eq_(so, "")
示例#5
0
def test_ftrbr_push():
    oriR, cloR = utils.clone_makebr_edit_commit_repo(utils.DIR_REPO_CLONE_FTRBR_PUSH)

    so, se, rc = cloR.exe_cmd_succ("git ftrbr-push")
    nt.assert_in("Pulling 'master'", so)
    nt.assert_in("Merging 'ftr/work' into 'master'", so)
    nt.assert_in("Pushing 'master' to 'origin'", so)
示例#6
0
def test_ftrbr_start_detachedhead():
    oriR, cloR = utils.clone_makebr_edit_commit_repo(utils.DIR_REPO_CLONE_FTRBR)

    so,se,rc = cloR.exe_cmd_succ('git checkout HEAD~1')
    so,se,rc = cloR.exe_cmd_succ('git ftrbr-start aaa')
    nt.assert_in("Pulling 'master'", so)
    nt.assert_in("Creating new ftr branch", so)
    nt.assert_in("Switched to a new branch 'ftr/aaa'", se)
示例#7
0
def test_ftrbr_push_nointbr():
    oriR, cloR = utils.clone_makebr_edit_commit_repo(utils.DIR_REPO_CLONE_FTRBR_PUSH)

    so, se, rc = cloR.exe_cmd_succ("git intbr-unset")
    so, se, rc = cloR.exe_cmd_deny("git ftrbr-push")
    nt.eq_(so, "")
    nt.eq_(se, "Integration branch not set\nCannot push.")
    nt.assert_not_in("Pulling 'master'", so)
    nt.assert_not_in("Merging", so)
示例#8
0
def test_ftrbr_push_rebase_onintbr():
    oriR, cloR = utils.clone_makebr_edit_commit_repo(utils.DIR_REPO_CLONE_FTRBR_PUSH)

    so, se, rc = cloR.exe_cmd_succ("git checkout master")
    so, se, rc = cloR.exe_cmd_succ("git ftrbr-push-rebase")
    nt.assert_in("Pulling 'master'", so)
    nt.assert_in("Rebasing 'master' onto 'master'", so)
    nt.assert_in("Merging 'master' into 'master'", so)
    nt.assert_in("Pushing 'master' to 'origin'", so)
示例#9
0
def test_ftrbr_integrate_conflict_on_mergeftrbr():
    oriR, cloR = utils.clone_makebr_edit_commit_repo(utils.DIR_REPO_CLONE_FTRBR_INTEGRATE)
    so,se,rc = cloR.exe_cmd_succ('git checkout master')
    utils.edit_commit(cloR, msg = 'from master')
    so,se,rc = cloR.exe_cmd_succ('git chk-back')

    so,se,rc = cloR.exe_cmd_deny('git ftrbr-integrate')
    nt.assert_in("Pulling 'master'",                   so)
    nt.assert_in("CONFLICT (content): Merge conflict", so)
    nt.assert_in("Merging 'ftr/work' into 'master",    so)
    nt.assert_in("Automatic merge failed; fix conflicts and then commit the result.", so)
示例#10
0
def test_ftrbr_push_conflict_on_mergeftrbr():
    oriR, cloR = utils.clone_makebr_edit_commit_repo(utils.DIR_REPO_CLONE_FTRBR_PUSH)

    utils.edit_commit(oriR, "on origin")

    so, se, rc = cloR.exe_cmd_deny("git ftrbr-push")
    nt.assert_in("Pulling 'master'", so)
    nt.assert_in("Fast-forward", so)
    nt.assert_in("Merging 'ftr/work' into 'master'", so)
    nt.assert_in("CONFLICT (content): Merge conflict in a.txt", so)
    nt.assert_in("Automatic merge failed; fix conflicts and then commit the result.", so)
示例#11
0
def test_ftrbr_push_onintbr_local():
    oriR, cloR = utils.clone_makebr_edit_commit_repo(utils.DIR_REPO_CLONE_FTRBR_PUSH)

    so, se, rc = cloR.exe_cmd_succ("git checkout -b another master")
    so, se, rc = cloR.exe_cmd_succ("git intbr another")

    so, se, rc = cloR.exe_cmd_deny("git ftrbr-push")
    nt.eq_("", so)
    nt.assert_in("Integration branch 'another' not tracked", se)
    nt.assert_in("Cannot push.", se)
    nt.assert_not_in("Pushing", so)
示例#12
0
def test_ftrbr_integrate_rebase_conflict_on_pullintbr():
    oriR, cloR = utils.clone_makebr_edit_commit_repo(utils.DIR_REPO_CLONE_FTRBR_INTEGRATE)
    utils.edit_commit(oriR, 'on origin')
    so,se,rc = cloR.exe_cmd_succ('git checkout master')
    utils.edit_commit(cloR, 'on clone')

    so,se,rc = cloR.exe_cmd_deny('git ftrbr-integrate-rebase')
    nt.assert_in("Pulling 'master'",                   so)
    nt.assert_in("CONFLICT (content): Merge conflict", so)
    nt.assert_in("Automatic merge failed; fix conflicts and then commit the result.", so)
    nt.assert_not_in("Merging", so)
    nt.assert_not_in("Merging", se)
示例#13
0
def test_ftrbr_push_rebase_conflict_on_mergeftrbr():
    oriR, cloR = utils.clone_makebr_edit_commit_repo(utils.DIR_REPO_CLONE_FTRBR_PUSH)

    utils.edit_commit(oriR, "on origin")

    so, se, rc = cloR.exe_cmd_deny("git ftrbr-push-rebase")
    nt.assert_in("Pulling 'master'", so)
    nt.assert_in("Fast-forward", so)
    nt.assert_in("Rebasing 'ftr/work' onto 'master'", so)
    nt.assert_in("CONFLICT (content): Merge conflict in a.txt", so)
    nt.assert_in("Patch failed at 0001 modified file", so)
    nt.assert_in('When you have resolved this problem run "git rebase --continue"', so)