How to use the mike.git_utils.push_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_push(self):
        commit_file('file2.txt', 'add file2')
        clone_rev = git_utils.get_latest_commit('master')
        git_utils.push_branch('origin', 'master')

        with pushd(self.origin):
            origin_rev = git_utils.get_latest_commit('master')
            self.assertEqual(origin_rev, clone_rev)
github jimporter / mike / test / unit / test_git_utils.py View on Github external
def test_force_push(self):
        with pushd(self.origin):
            commit_file('file2.txt', 'add file2')

        commit_file('file2.txt', 'add file2 from clone')
        clone_rev = git_utils.get_latest_commit('master')
        git_utils.push_branch('origin', 'master', force=True)

        with pushd(self.origin):
            origin_rev = git_utils.get_latest_commit('master')
            self.assertEqual(origin_rev, clone_rev)
github jimporter / mike / test / unit / test_git_utils.py View on Github external
def test_push_fails(self):
        with pushd(self.origin):
            commit_file('file2.txt', 'add file2')

        commit_file('file2.txt', 'add file2 from clone')
        self.assertRaises(git_utils.GitError, git_utils.push_branch, 'origin',
                          'master')
github jimporter / mike / mike / driver.py View on Github external
def set_default(args):
    check_remote_status(args, strict=True)
    commands.set_default(args.version, args.branch, args.message)
    if args.push:
        git_utils.push_branch(args.remote, args.branch, args.force)
github jimporter / mike / mike / driver.py View on Github external
def deploy(args):
    check_remote_status(args, strict=True)
    mkdocs.build(args.config_file)
    commands.deploy(mkdocs.site_dir(args.config_file), args.version,
                    args.title, args.alias, args.update_aliases, args.branch,
                    args.message)
    if args.push:
        git_utils.push_branch(args.remote, args.branch, args.force)
github jimporter / mike / mike / driver.py View on Github external
def retitle(args):
    check_remote_status(args, strict=True)
    commands.retitle(args.version, args.title, args.branch, args.message)
    if args.push:
        git_utils.push_branch(args.remote, args.branch, args.force)
github jimporter / mike / mike / driver.py View on Github external
def alias(args):
    check_remote_status(args, strict=True)
    commands.alias(args.version, args.alias, args.branch, args.message)
    if args.push:
        git_utils.push_branch(args.remote, args.branch, args.force)
github jimporter / mike / mike / driver.py View on Github external
def delete(args):
    check_remote_status(args, strict=True)
    commands.delete(args.version, args.all, args.branch, args.message)
    if args.push:
        git_utils.push_branch(args.remote, args.branch, args.force)