Removes the last commit from history.
196725
def undo(scm, verbose, fake, hard):
    """"""
    scm.fake = fake
    scm.verbose = fake or verbose

    scm.repo_check()

    status_log(scm.undo, 'Last commit removed from history.', hard)
949564
private void cleanup() {
		CacheEntry oldest = null;
		_count = 0;

		// Cleanup obsolete entries and find the oldest
		for (Map.Entry<String, CacheEntry> e : _cache.entrySet()) {
			String key = e.getKey();
			CacheEntry entry = e.getValue();
			// Remove obsolete entry
			if (entry.isExpired()) {
				_cache.remove(key);
			}
			// Count the remaining entry
			else {
				_count++;
				if (oldest == null || oldest.getExpiration() > entry.getExpiration())
					oldest = entry;
			}
		}

		// Remove the oldest if cache size exceeded maximum
		if (_count > _maxSize && oldest != null) {
			_cache.remove(oldest.getKey());
			_count--;
		}
	}
244524
public function getLastMoveIndex()
    {
        $move_history = $this->getMoveHistory();

        // get last value
        $last_move = end($move_history);

        // reset pointer
        reset($this->moves);

        return $last_move;
    }
469127
def last_commit():
    """"""
    try:
        root = subprocess.check_output(
            ['hg', 'parent', '--template={node}'],
            stderr=subprocess.STDOUT).strip()
        # Convert to unicode first
        return root.decode('utf-8')
    except subprocess.CalledProcessError:
        return None
109753
public void clearHistory()
	{
		int channels = inArray.length;
		for (int c=0; c<channels; c++)
		{
			for (int i=0; i<HISTORYSIZE; i++)
			{
				inArray[c][i] = outArray[c][i] = 0f;
			}
		}
	}
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
6434
def commit(self):
        
        remove_items = []
        commit_items = []
        
        # remove all the items
        commit_state = XOrbRecordItem.State.Modified | XOrbRecordItem.State.New
        remove_state = XOrbRecordItem.State.Removed
        for i in range(self.topLevelItemCount()):
            item = self.topLevelItem(i)
            
            if isinstance(item, XOrbRecordItem) or\
                isinstance(item, XOrbGroupItem):
                remove_items += item.findItemsByState(remove_state)
                commit_items += item.findItemsByState(commit_state)
        
        # make sure we can remove the records
        for item in remove_items:
            record = item.record()
            try:
                record.remove(dryRun = True, throw=True)
            except orb.errors.CannotRemoveError, err:
                QMessageBox.information(self,
                                        'Cannot Remove',
                                        nativestring(err))
                return False
        
        # remove the records
        remove_set = RecordSet([item.record() for item in remove_items])
        remove_set.remove()
        
        for item in remove_items:
            item.record().remove()
            parent = item.parent()
            if parent:
                index = parent.indexOfChild(item)
                parent.takeChild(index)
            else:
                index = self.indexOfTopLevelItem(item)
                self.takeTopLevelItem(index)
        
        # commit the new records
        for item in commit_items:
            self.aboutToSaveRecord.emit(item.record())
            item.record().commit()
            item.setRecordState(XOrbRecordItem.State.Normal)
        
        self.recordsCommitted.emit()
        
        return True
475961
public void removeLast() {
		if (this.numTypes>0) {
			switch(this.types[this.numTypes-1]) {
			case CLOSE:
				// no coord to remove
				break;
			case MOVE_TO:
			case LINE_TO:
				this.numCoords -= 3;
				break;
			case CURVE_TO:
				this.numCoords -= 9;
				this.isPolyline = null;
				break;
			case QUAD_TO:
				this.numCoords -= 6;
				this.isPolyline = null;
				break;
			default:
				throw new IllegalStateException();
			}
			--this.numTypes;
			this.isEmpty = null;
			this.graphicalBounds = null;
			this.logicalBounds = null;
		}
	}
131381
def clean_single(number, force = false)
      request = server.pull_request(source_repo, number)
      if request && request.state == 'closed'
        # ensure there are no unmerged commits or '--force' flag has been set
        branch_name = request.head.ref
        if unmerged_commits?(branch_name) && !force
          puts "Won't delete branches that contain unmerged commits."
          puts "Use '--force' to override."
        else
          delete_branch(branch_name)
        end
      end
    rescue Octokit::NotFound
      false
    end
781957
def end_of_history(event):
    
    event.current_buffer.history_forward(count=10**100)
    buff = event.current_buffer
    buff.go_to_history(len(buff._working_lines) - 1)
156484
def MultiClearPathHistory(self, path_infos):
    """"""
    for client_id, client_path_infos in iteritems(path_infos):
      self.ClearPathHistory(client_id, client_path_infos)
113545
def clear_timeline(self):
        
        self._timeline.delete(tk.ALL)
        self._canvas_ticks.delete(tk.ALL)
356879
def remove(self, index):
        """"""
        assert index < self.count
        last_index = self.count - 1
        data = self.get(index)

        if index == last_index:
            # easy case - nothing to do except zero last chunk
            last_data = data
            moved = None
        else:
            last_data = self.get(last_index)
            # copy the last chunk's data over the data to be deleted
            data[0:self.chunk_size] = last_data
            moved = last_index

        # zero last chunk's data
        last_data[0:self.chunk_size] = [0] * self.chunk_size
        self.count -= 1

        # provide which index has now moved
        return moved
583549
def cleanup(self):
        
        if self._movie is not None:
            self._movie.frameChanged.disconnect(self._updateFrame)
            self._movie = None
21553
public static function cleanupRemovedItems()
    {
        $db = eZDB::instance();
        // Find items that have been moved to trash or deleted
        $itemArray = array();
        $offset = 0;
        $limit = 50;
        do
        {
            $items = $db->arrayQuery( 'SELECT node_id FROM ezm_pool', array( 'offset' => $offset, 'limit' => $limit ) );
            if ( empty( $items ) )
                break;

            foreach( $items as $item )
            {
                $rows = $db->arrayQuery( 'SELECT node_id FROM ezcontentobject_tree WHERE node_id = ' . $item['node_id'] );
                if ( empty( $rows ) )
                    $itemArray[] = $item['node_id'];
            }

            $offset += $limit;
        } while ( true );

        // Remove them all from the flow
        $itemArrayCount = count( $itemArray );
        if ( $itemArrayCount > 0 )
        {
            $db->begin();
            $db->query( 'DELETE FROM ezm_pool WHERE ' . $db->generateSQLINStatement( $itemArray, 'node_id' ) );
            $db->commit();
        }

        return $itemArrayCount;
    }
1168753
def clean(self):
        
        self._table.clear()
        for item in self._usage_recency:
            self._usage_recency.remove(item)
734668
function removeHistory()
    {
        $db = eZDB::instance();
        $orderID = (int)$this->OrderNr;
        $db->query( "DELETE FROM ezorder_status_history WHERE order_id=$orderID" );
    }