How to use the mike.git_utils.try_rebase_branch function in mike

To help you get started, we’ve selected a few mike examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jimporter / mike / test / unit / test_git_utils.py View on Github external
def test_even(self):
        old_rev = git_utils.get_latest_commit('master')

        git_utils.try_rebase_branch('origin', 'master')
        new_rev = git_utils.get_latest_commit('master')
        self.assertEqual(old_rev, new_rev)
github jimporter / mike / test / unit / test_git_utils.py View on Github external
def test_diverged(self):
        commit_file('file2.txt', 'add file2')
        old_rev = git_utils.get_latest_commit('master')
        with pushd(self.origin):
            commit_file('file2-origin.txt', 'add file2')
        check_call_silent(['git', 'fetch', 'origin'])

        self.assertRaises(git_utils.GitBranchDiverged,
                          git_utils.try_rebase_branch, 'origin', 'master')
        new_rev = git_utils.get_latest_commit('master')
        self.assertEqual(old_rev, new_rev)
github jimporter / mike / test / unit / test_git_utils.py View on Github external
def test_nonexistent_remote(self):
        old_rev = git_utils.get_latest_commit('master')
        check_call_silent(['git', 'fetch', 'origin'])
        git_utils.try_rebase_branch('upstream', 'master')
        new_rev = git_utils.get_latest_commit('master')

        self.assertEqual(old_rev, new_rev)
github jimporter / mike / test / unit / test_git_utils.py View on Github external
def test_ahead(self):
        commit_file('file2.txt', 'add file2')
        old_rev = git_utils.get_latest_commit('master')

        git_utils.try_rebase_branch('origin', 'master')
        new_rev = git_utils.get_latest_commit('master')
        self.assertEqual(old_rev, new_rev)
github jimporter / mike / mike / driver.py View on Github external
def check_remote_status(args, strict=False):
    if args.ignore:
        return

    try:
        git_utils.try_rebase_branch(args.remote, args.branch,
                                    force=args.rebase)
    except (git_utils.GitBranchDiverged, git_utils.GitRevUnrelated) as e:
        msg = (str(e) + '\n  Pass --ignore to ignore this or --rebase to ' +
               'rebase onto remote')
        if strict:
            raise ValueError(msg)
        else:
            sys.stderr.write('warning: {}\n'.format(msg))