Disable branching model
        :param project:
        :param repository:
        :return:
353429
def disable_branching_model(self, project, repository):
        
        url = 'rest/branch-utils/1.0/projects/{project}/repos/{repository}/branchmodel/configuration'.format(
            project=project,
            repository=repository)
        return self.delete(url)
1372346
private void initClonedRepository() throws GitAPIException, IOException {
		if (!getUri().startsWith(FILE_URI_PREFIX)) {
			deleteBaseDirIfExists();
			Git git = cloneToBasedir();
			if (git != null) {
				git.close();
			}
			git = openGitRepository();
			if (git != null) {
				git.close();
			}
		}

	}
277435
def terminate():
    

    for callback_repository in _callback_repositories:
        for window_addr in list(callback_repository.keys()):
            del callback_repository[window_addr]
    for window_addr in list(_window_user_data_repository.keys()):
        del _window_user_data_repository[window_addr]
    _glfw.glfwTerminate()
902549
def tarbell_unpublish(command, args):
    
    with ensure_settings(command, args) as settings, ensure_project(command, args) as site:
        show_error("Not implemented!")
345882
protected void removeRepository(RepositoryService repositoryService, String repositoryName)
      throws RepositoryException,
      RepositoryConfigurationException
   {
      ManageableRepository mr = null;

      try
      {
         mr = repositoryService.getRepository(repositoryName);
      }
      catch (RepositoryException e)
      {
         // The repository not exist.
         if (LOG.isTraceEnabled())
         {
            LOG.trace("An exception occurred: " + e.getMessage());
         }
      }

      if (mr != null)
      {
         closeAllSession(mr);
         repositoryService.removeRepository(repositoryName);
         repositoryService.getConfig().retain(); // save configuration to persistence (file or persister)
      }
   }
911475
@PreDestroy
    public void stopRepository() throws InterruptedException {
        LOGGER.info("Initiating shutdown of ModeShape");
        final String repoName = repository.getName();
        try {
            final Future<Boolean> futureUndeployRepo = modeShapeEngine.undeploy(repoName);
            if (futureUndeployRepo.get()) {
                LOGGER.info("ModeShape repository {} has undeployed.", repoName);
            } else {
                LOGGER.error("ModeShape repository {} undeploy failed without an exception, still deployed.", repoName);
            }
            LOGGER.info("Repository {} undeployed.", repoName);
        } catch (final NoSuchRepositoryException e) {
            LOGGER.error("Repository {} unknown, cannot undeploy.", repoName, e);
        } catch (final ExecutionException e) {
            LOGGER.error("Repository {} cannot undeploy.", repoName, e.getCause());
        }
        final Future<Boolean> futureShutdownEngine = modeShapeEngine.shutdown();
        try {
            if (futureShutdownEngine.get()) {
                LOGGER.info("ModeShape Engine has shutdown.");
            } else {
                LOGGER.error("ModeShape Engine shutdown failed without an exception, still running.");
            }
        } catch (final ExecutionException e) {
            LOGGER.error("ModeShape Engine shutdown failed.", e.getCause());
        }
    }
1279290
def uninstall(self, xmlpath):
        
        from os import path
        fullpath = path.abspath(path.expanduser(xmlpath))
        if fullpath in self.installed:
            repo = RepositorySettings(self, fullpath)
            if repo.name.lower() in self.repositories:
                del self.repositories[repo.name.lower()]
            if repo.name.lower() in self.archive:
                del self.archive[repo.name.lower()]
                self._save_archive()
            self.installed.remove(fullpath)
            self._save_installed()
        else:
            warn("The repository at {} was not installed to begin with.".format(fullpath))
1228788
public void disable() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(this, tc, "disable chain " + this);
        }
        enabled = false;
    }
726245
function closeProject(projectId, callback) {
            var prevBranchName = state.branchName;
            state.project = null;
            state.projectAccess = null;
            state.projectInfo = null;
            state.readOnlyProject = false;
            //TODO what if for some reason we are in transaction?
            storage.closeProject(projectId, function (err) {
                if (err) {
                    callback(err);
                    return;
                }

                state.core = null;
                state.branchName = null;
                state.commitHash = null;
                //self.dispatchEvent(null);
                state.patterns = {};
                //state.gHash = 0;
                state.nodes = {};
                state.loadNodes = {};
                state.loadError = 0;
                state.rootHash = null;
                //state.rootObject = null;
                state.transactions.opened = 0;
                state.transactions.callbacks = [];
                state.msg = '';

                cleanUsersTerritories();
                if (prevBranchName) {
                    self.dispatchEvent(CONSTANTS.BRANCH_CLOSED, prevBranchName);
                }

                self.dispatchEvent(CONSTANTS.BRANCH_CHANGED, null);
                self.dispatchEvent(CONSTANTS.PROJECT_CLOSED, projectId);

                callback(null);
            });
        }
30075
def remove(self, experiment):
        """"""
        try:
            project_path = self.projects[self[experiment]['project']]['root']
        except KeyError:
            return
        config_path = osp.join(project_path, '.project', experiment + '.yml')
        for f in [config_path, config_path + '~', config_path + '.lck']:
            if os.path.exists(f):
                os.remove(f)
        del self[experiment]
1211950
def persist(self, name, project=None, drop_model=False, **kwargs):
        
        return super(ODPSModelExpr, self).persist(name, project=project, drop_model=drop_model, **kwargs)
318412
def delete_project(self, project):
        
        pid = project.pid

        # project deleted

        ds_project = self.get_project(pid)
        if ds_project is not None:
            self._delete_project(pid)

        return
862129
def remove_hook(self, repo_id, name):
        """"""
        ghrepo = self.api.repository_with_id(repo_id)
        if ghrepo:
            hooks = (h for h in ghrepo.hooks()
                     if h.config.get('url', '') == self.webhook_url)
            hook = next(hooks, None)
            if not hook or hook.delete():
                Repository.disable(user_id=self.user_id,
                                   github_id=repo_id,
                                   name=name)
                return True
        return False
1258633
def delete_branch(cls, resource_id=None, db_session=None, *args, **kwargs):
        
        tablename = cls.model.__table__.name

        # lets lock rows to prevent bad tree states
        resource = ResourceService.lock_resource_for_update(
            resource_id=resource_id, db_session=db_session
        )
        parent_id = resource.parent_id
        ordering = resource.ordering
        raw_q = """
            WITH RECURSIVE subtree AS (
                    SELECT res.resource_id
                    FROM {tablename} AS res WHERE res.resource_id = :resource_id
                  UNION ALL
                    SELECT res_u.resource_id
                    FROM {tablename} res_u, subtree st
                    WHERE res_u.parent_id = st.resource_id
            )
            DELETE FROM resources where resource_id in (select * from subtree);
        """.format(
            tablename=tablename
        )  # noqa
        db_session = get_db_session(db_session)
        text_obj = sa.text(raw_q)
        db_session.execute(text_obj, params={"resource_id": resource_id})
        cls.shift_ordering_down(parent_id, ordering, db_session=db_session)
        return True
1045431
def strip_project_url(url):
    """"""
    m = re.match(r'(?:[^:]+://)?(.*)', url)
    if m:
        url = m.group(1)
    if url.endswith('.git'):
        url, _, _ = url.rpartition('.')
    if url.endswith('-distgit'):
        url, _, _ = url.rpartition('-')
    if url.startswith('openstack/'):
        # openstack is always special :-p
        _, _, url = url.partition('/')
    return url
816911
public void makeDisabled(boolean b) throws IOException {
        if (disabled == b) {
            return;
        }
        this.disabled = b;

        Collection<P> projects = getItems();

        // Manage the sub-projects
        if (b) {
            /*
             * Populate list only if it is empty.  Running this loop when the
             * parent (and therefore, all sub-projects) are already disabled will
             * add all branches.  Obviously not desirable.
             */
            if (disabledSubProjects.isEmpty()) {
                for (P project : projects) {
                    if (project.isDisabled()) {
                        disabledSubProjects.add(project.getName());
                    }
                }
            }

            // Always forcefully disable all sub-projects
            for (P project : projects) {
                project.disable();
            }
        } else {
            // Re-enable only the projects that weren't manually marked disabled
            for (P project : projects) {
                if (!disabledSubProjects.contains(project.getName())) {
                    project.enable();
                }
            }

            // Clear the list so it can be rebuilt when parent is disabled
            disabledSubProjects.clear();
        }

        save();
        ItemListener.fireOnUpdated(this);
    }
776798
public synchronized void removeRepositoryInfo(LogRepositoryManager manager) {
		RepositoryInfo curRI = repositoryInfo.remove(manager);
		if (curRI != null) {
			curRI.setRespositorySpaceNeeded(0);
		}
	}