def land(self, author_name, author_email, message):

        self._repo.checkout_forced_new_branch(
            self._tracking_branch.base,
            self._tracking_branch.remote_base)

        try:
            result = self._lander(
                self._repo,
                self._tracking_branch.remote_branch,
                author_name,
                author_email,
                message)
        except abdt_lander.LanderException as e:
            self._repo("reset", "--hard")  # fix the working copy
            raise abdt_exception.LandingException(
                str(e),
                self.review_branch_name(),
                self._tracking_branch.base)

        landing_hash = phlgit_revparse.get_sha1(
            self._repo, self._tracking_branch.base)

        # don't tryloop here as it's more expected that we can't push the base
        # due to permissioning or some other error
        try:
            self._repo.push(self._tracking_branch.base)
        except Exception as e:
            raise abdt_exception.LandingPushBaseException(
                str(e),
                self.review_branch_name(),
                self._tracking_branch.base)

        self._tryloop(
            lambda: self._repo.push_delete(
                self._tracking_branch.branch,
                self.review_branch_name()),
            abdt_errident.PUSH_DELETE_LANDED)

        self._repo.archive_to_landed(
            self._tracking_hash,
            self.review_branch_name(),
            self._tracking_branch.base,
            landing_hash,
            message)

        # push the landing archive, don't escalate if it fails to push
        try:
            # XXX: oddly pylint complains if we call push_landed() directly:
            #      "Using method (_tryloop) as an attribute (not invoked)"
            def push_landed():
                self._repo.push_landed()

            self._tryloop(
                push_landed,
                abdt_errident.PUSH_LANDING_ARCHIVE)
        except Exception:
            # XXX: don't worry if we can't push the landed, this is most
            #      likely a permissioning issue but not a showstopper.
            #      we should probably nag on the review instead.
            pass

        self._review_branch = None
        self._review_hash = None
        self._tracking_branch = None
        self._tracking_hash = None

        return result
Get a PEP 302 "loader" object for module_or_name
dataset/ETHPy150Open bloomberg/phabricator-tools/py/abd/abdt_branch.py/Branch.land--crossover with--dataset/ETHPy150Open azoft-dev-team/imagrium/env/Lib/pkgutil.py/get_loader