Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
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)
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')
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)
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)
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)
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)
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)