Unstashes changes from current branch for branch sync.
        Requires prior code setting self.stash_index.
427944
def unstash_it(self, sync=False):
        
        if self.stash_index is not None:
            return self.git_exec(
                ['stash', 'pop', 'stash@{{{0}}}'.format(self.stash_index)])
864161
void discardUnusedTail()
    {
        // we guard this with the OpOrdering instead of synchronised due to potential dead-lock with CLSM.advanceAllocatingFrom()
        // this actually isn't strictly necessary, as currently all calls to discardUnusedTail occur within a block
        // already protected by this OpOrdering, but to prevent future potential mistakes, we duplicate the protection here
        // so that the contract between discardUnusedTail() and sync() is more explicit.
        try (OpOrder.Group group = appendOrder.start())
        {
            while (true)
            {
                int prev = allocatePosition.get();
                // we set allocatePosition past buffer.capacity() to make sure we always set discardedTailFrom
                int next = buffer.capacity() + 1;
                if (prev == next)
                    return;
                if (allocatePosition.compareAndSet(prev, next))
                {
                    discardedTailFrom = prev;
                    return;
                }
            }
        }
    }
546510
protected void cleanupAndDestroyAllFreeConnections() {
        // This method is called within a synchronize block
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(this, tc, "cleanupAndDestroyAllFreeConnections");
        }
        int mcWrapperListIndex = mcWrapperList.size() - 1;
        for (int i = mcWrapperListIndex; i >= 0; --i) {
            MCWrapper mcw = (MCWrapper) mcWrapperList.remove(i);
            mcw.setPoolState(0);
            pm.totalConnectionCount.decrementAndGet();
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(this, tc, "Calling cleanup and destroy on MCWrapper " + mcw);
            }
            cleanupAndDestroyMCWrapper(mcw);
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(this, tc, "cleanupAndDestroyAllFreeConnections");
        }
    }
630134
def clear(self):
        
        self.blockSignals(True)
        items = list(self.items())
        for item in items:
            item.close()
        self.blockSignals(False)

        self._currentIndex = -1
        self.currentIndexChanged.emit(self._currentIndex)
788683
public synchronized void removeMPReadTransactions() {
        TransactionTask  task = m_backlog.peekFirst();
        while (task != null && task.getTransactionState().isReadOnly()) {
            task.getTransactionState().setDone();
            flush(task.getTxnId());
            task = m_backlog.peekFirst();
        }
    }
759866
def clean_all
      (review_branches - protected_branches).each do |branch_name|
        # only clean up obsolete branches.
        delete_branch(branch_name) unless unmerged_commits?(branch_name, false)
      end
    end
437726
def pop_changeset(self, changeset_id: uuid.UUID) -> Dict[bytes, Union[bytes, DeletedEntry]]:
        
        if changeset_id not in self.journal_data:
            raise KeyError(changeset_id, "Unknown changeset in JournalDB")

        all_ids = tuple(self.journal_data.keys())
        changeset_idx = all_ids.index(changeset_id)
        changesets_to_pop = all_ids[changeset_idx:]
        popped_clears = tuple(idx for idx in changesets_to_pop if idx in self._clears_at)
        if popped_clears:
            last_clear_idx = changesets_to_pop.index(popped_clears[-1])
            changesets_to_drop = changesets_to_pop[:last_clear_idx]
            changesets_to_merge = changesets_to_pop[last_clear_idx:]
        else:
            changesets_to_drop = ()
            changesets_to_merge = changesets_to_pop

        # we pull all of the changesets *after* the changeset we are
        # reverting to and collapse them to a single set of keys (giving
        # precedence to later changesets)
        changeset_data = merge(*(
            self.journal_data.pop(c_id)
            for c_id
            in changesets_to_merge
        ))

        # drop the changes on the floor if they came before a clear that is being committed
        for changeset_id in changesets_to_drop:
            self.journal_data.pop(changeset_id)

        self._clears_at.difference_update(popped_clears)
        return changeset_data
620633
public void unpush()
    {
        //  First, move 'back' one position backwards.
        if (backPos > 0) {
            --backPos;
        }
        else {
            backPos = size - 1;
            backChunk = backChunk.prev;
        }

        //  Now, move 'end' position backwards. Note that obsolete end chunk
        //  is not used as a spare chunk. The analysis shows that doing so
        //  would require free and atomic operation per chunk deallocated
        //  instead of a simple free.
        if (endPos > 0) {
            --endPos;
        }
        else {
            endPos = size - 1;
            endChunk = endChunk.prev;
            endChunk.next = null;
        }
    }
1054239
def clear(self):
        
        self._xroot = ElementTree.Element('settings')
        self._xroot.set('version', '1.0')
        self._xstack = [self._xroot]
774957
def remove(self, index):
        ''''''
        newtree = LookupTree()
        newtree.root = _remove_down(self.root, index, 0)
        return newtree
360275
def delete_branch(self, resource_id=None, db_session=None, *args, **kwargs):
        
        return self.service.delete_branch(
            resource_id=resource_id, db_session=db_session, *args, **kwargs
        )
1013932
def unstash(self):
        
        if not self.stashed:
            LOGGER.error('no stash')
        else:
            LOGGER.info('popping stash')
            self.repo.git.stash('pop')
            self.stashed = False
643335
def cleanup(config, searchstring, force=False):
    """"""
    repo = config.repo

    branches_ = list(find(repo, searchstring))
    if not branches_:
        error_out("No branches found")
    elif len(branches_) > 1:
        error_out(
            "More than one branch found.{}".format(
                "\n\t".join([""] + [x.name for x in branches_])
            )
        )

    assert len(branches_) == 1
    branch_name = branches_[0].name
    active_branch = repo.active_branch
    if branch_name == active_branch.name:
        error_out("Can't clean up the current active branch.")
    # branch_name = active_branch.name
    upstream_remote = None
    fork_remote = None
    state = read(config.configfile)
    origin_name = state.get("ORIGIN_NAME", "origin")
    for remote in repo.remotes:
        if remote.name == origin_name:
            # remote.pull()
            upstream_remote = remote
            break
    if not upstream_remote:
        error_out("No remote called {!r} found".format(origin_name))

    # Check out master
    repo.heads.master.checkout()
    upstream_remote.pull(repo.heads.master)

    # Is this one of the merged branches?!
    # XXX I don't know how to do this "nativly" with GitPython.
    merged_branches = [
        x.strip()
        for x in repo.git.branch("--merged").splitlines()
        if x.strip() and not x.strip().startswith("*")
    ]
    was_merged = branch_name in merged_branches
    certain = was_merged or force
    if not certain:
        # Need to ask the user.
        # XXX This is where we could get smart and compare this branch
        # with the master.
        certain = (
            input("Are you certain {} is actually merged? [Y/n] ".format(branch_name))
            .lower()
            .strip()
            != "n"
        )
    if not certain:
        return 1

    if was_merged:
        repo.git.branch("-d", branch_name)
    else:
        repo.git.branch("-D", branch_name)

    fork_remote = None
    state = read(config.configfile)
    for remote in repo.remotes:
        if remote.name == state.get("FORK_NAME"):
            fork_remote = remote
            break
    if fork_remote:
        fork_remote.push(":" + branch_name)
        info_out("Remote branch on fork deleted too.")
1030650
def remove_item(self, item):
        
        self.unindex_item(item)
        self.items.pop(item.uuid, None)
260681
def clear(self):
        
        logger.info("Resetting indexes")
        state = self.app_state

        for _name, idx in state.indexes.items():
            writer = AsyncWriter(idx)
            writer.commit(merge=True, optimize=True, mergetype=CLEAR)

        state.indexes.clear()
        state.indexed_classes.clear()
        state.indexed_fqcn.clear()
        self.clear_update_queue()

        if self.running:
            self.stop()
595509
def move_local_changes(original_branch, feature_name)
      feature_branch = create_feature_name(feature_name)
      # By checking out the feature branch, the commits on the original branch
      # are copied over. That way we only need to remove pending (local) commits
      # from the original branch.
      git_call "checkout -b #{feature_branch}"
      if local.source_branch == feature_branch
        # Save any uncommitted changes, to be able to reapply them later.
        save_uncommitted_changes = local.uncommitted_changes?
        git_call('stash') if save_uncommitted_changes
        # Go back to original branch and get rid of pending (local) commits.
        git_call("checkout #{original_branch}")
        remote = local.remote_for_branch(original_branch)
        remote += '/' if remote
        git_call("reset --hard #{remote}#{original_branch}")
        git_call("checkout #{feature_branch}")
        git_call('stash pop') if save_uncommitted_changes
        feature_branch
      end
    end
560862
private void clearLock() {
      Object previousValue = noCacheStoreCache.remove(keyOfLock);
      if (previousValue!=null && trace) {
         log.tracef("Lock removed for index: %s", indexName);
      }
   }