def push(self, args):
        if not check_installed_rcs('bzr') and not check_installed_rcs('git'):
            raise InputErrorException('NeitherBazaarNorGitFound')

        if args.deploy and args.ship:
            raise InputErrorException('ShipAndDeploy')

        app_name, deployment_name = self.parse_app_deployment_name(args.name)
        deployment, push_deployment_name = self._get_or_create_deployment(app_name, deployment_name, args.clear_cache)

        cmd = self._push_cmd(deployment, push_deployment_name, args.source)

        try:
            check_call(cmd)
        except CalledProcessError, e:
            print str(e)
            sys.exit(1)

        if args.deploy:
            print
            print "Deploying newest version."
            self.redeploy(deployment)

        if args.ship:
            print
            print "Deploying newest version. Press Ctrl+C to open {0} in your browser.".format(deployment['name'])
            self.redeploy(deployment)

            try:
                self.log_from_now(app_name, deployment_name, 'deploy')
            except KeyboardInterrupt:
                print
                print "Opening in browser..."
                self._open(self._get_deployment_url(deployment))
Push is actually only a shortcut for bzr and git push commands
dataset/ETHPy150Open cloudControl/cctrl/cctrl/app.py/AppController.push