Revision ID : `int`
359176
def initialize(self, id, timestamp=None, user=None, page=None, minor=None,
                   comment=None, text=None, bytes=None, sha1=None,
                   parent_id=None, model=None, format=None, deleted=None):

        self.id = none_or(id, int)
        

        self.timestamp = none_or(timestamp, Timestamp)
        """
        Revision timestamp : :class:`mwtypes.Timestamp`
        """

        self.user = none_or(user, User)
        """
        Contributing user metadata : :class:`~mwtypes.User`
        """

        self.page = none_or(page, Page)
        """
        Page metadata : :class:`~mwtypes.Page`
        """

        self.minor = none_or(minor, bool)
        """
        Is revision a minor change? : `bool`
        """

        self.comment = none_or(comment, str)
        """
        Comment left with revision : `str`
        """

        self.text = none_or(text, str)
        """
        Content of text : `str`
        """

        self.bytes = none_or(bytes, int)
        """
        Number of bytes of content : `int`
        """

        self.sha1 = none_or(sha1, str)
        """
        sha1 hash of the content : `str`
        """

        self.parent_id = none_or(parent_id, int)
        """
        Revision ID of preceding revision : `int` | `None`
        """

        self.model = none_or(model, str)
        """
        TODO: ??? : `str`
        """

        self.format = none_or(format, str)
        """
        TODO: ??? : `str`
        """

        self.deleted = none_or(deleted, self.Deleted)
        """
        The deleted/suppressed status of the revision.
        """
771024
public int getNumberOfRevisions(final int articleID)
        throws WikiApiException
    {

        try {
            if (articleID < 1) {
                throw new IllegalArgumentException();
            }

            PreparedStatement statement = null;
            ResultSet result = null;
            String revCounters;

            try {
                // Retrieve the fullRevisionPK and calculate the limit
                statement = this.connection.prepareStatement("SELECT RevisionCounter "
                        + "FROM index_articleID_rc_ts " + "WHERE ArticleID=? LIMIT 1");
                statement.setInt(1, articleID);
                result = statement.executeQuery();

                if (result.next()) {

                    revCounters = result.getString(1);

                }
                else {
                    throw new WikiPageNotFoundException("The article with the ID " + articleID
                            + " was not found.");
                }
            }
            finally {
                if (statement != null) {
                    statement.close();
                }
                if (result != null) {
                    result.close();
                }
            }

            int index = revCounters.lastIndexOf(' ');
            if (index == -1) {
                throw new WikiApiException("Article data is inconsistent");
            }

            return Integer.parseInt(revCounters.substring(index + 1, revCounters.length()));

        }
        catch (WikiApiException e) {
            throw e;
        }
        catch (Exception e) {
            throw new WikiApiException(e);
        }
    }
1043611
def ID(self, ID):
        
        ret = libxml2mod.xmlGetID(self._o, ID)
        if ret is None:raise treeError('xmlGetID() failed')
        __tmp = xmlAttr(_obj=ret)
        return __tmp
1248490
public function getUserId($revision = null)
	{
		// Without revision, use current info
		if (!isset($revision)) {
			return (int)$this->info['userid'];
		}

		// Obtain the properties of the revision
		if (($info = $this->getRevision($revision)) === null) {
			return -1;
		}

		return (int)$info['userid'];
	}
1293476
def restore_last_revision!(id)
      record = restore_last_revision(id)
      if record
        record.store_revision do
          save_restorable_associations(record, revisionable_associations)
        end
      end
      return record
    end
789287
def get_revision():
    
    proc = Process("git log", ["git", "log", "-1"])

    try:
        while True:
            line = proc.stdout.pop().strip().decode('utf8')
            if not line:
                continue
            if line.startswith("commit "):
                return line[7:]
    finally:
        with suppress_exception:
            proc.join()
1315270
public static function tid(): int
    {
        if (!ServerUtil::coroutineIsEnabled()) {
            return -1;
        }

        $id = SwCoroutine::getuid();

        return self::$idMap[$id] ?? $id;
    }
646807
public static RevisionInternal revisionObject(
            Document doc,
            String docID,
            String revID,
            boolean withBody) {

        boolean deleted = doc.selectedRevDeleted();
        if (revID == null)
            revID = doc.getSelectedRevID();
        RevisionInternal rev = new RevisionInternal(docID, revID, deleted);
        rev.setSequence(doc.getSelectedSequence());
        if (withBody) {
            Status status = loadBodyOfRevisionObject(rev, doc);
            if (status.isError() && status.getCode() != Status.GONE)
                return null;
        }
        return rev;
    }
616629
def _get_major_minor_revision(self, version_string):
        """"""
        version = version_string.split(' ')[0].split('.')
        v_major = int(version[0])
        v_minor = int(re.match('\d+', version[1]).group())
        if len(version) >= 3:
            v_revision = int(re.match('\d+', version[2]).group())
        else:
            v_revision = 0
        return v_major, v_minor, v_revision
1082946
def _get_tags_by_num(self):
		
		by_revision = operator.attrgetter('revision')
		tags = sorted(self.get_tags(), key=by_revision)
		revision_tags = itertools.groupby(tags, key=by_revision)

		def get_id(rev):
			return rev.split(':', 1)[0]
		return dict(
			(get_id(rev), [tr.tag for tr in tr_list])
			for rev, tr_list in revision_tags
		)
292004
def is_commit_id_equal(self, dest, name):
        
        if not name:
            # Then avoid an unnecessary subprocess call.
            return False

        return self.get_revision(dest) == name
902839
private Revision init()
		throws WikiApiException
	{

		try {
			currentArticleID = resultArticles.getInt(1);
			String fullRevisionPKs = resultArticles.getString(2);
			String revisionCounters = resultArticles.getString(3);

			int index = revisionCounters.lastIndexOf(' ');
			if (index == -1) {
				throw new RuntimeException("Invalid revisioncounter content");
			}

			this.maxRevision = Integer.parseInt(revisionCounters.substring(
					index + 1, revisionCounters.length()));

			Statement statement = null;
			ResultSet result = null;

			try {
				statement = this.connection.createStatement();
				result = statement.executeQuery("SELECT Mapping "
						+ "FROM index_chronological " + "WHERE ArticleID="
						+ currentArticleID + " LIMIT 1");

				if (result.next()) {

					this.modus = ITERATE_WITH_MAPPING;

					this.chronoIterator = new ChronoIterator(config,
							connection, result.getString(1), fullRevisionPKs,
							revisionCounters);

					if (this.chronoIterator.hasNext()) {
						return this.chronoIterator.next();
					}
					else {
						throw new RuntimeException("cIt Revision query failed");
					}

					/*
					 * this.revisionIndex = 1;
					 *
					 * revisionEncoder = new RevisionApi(config, connection);
					 * return revisionEncoder.getRevision(currentArticleID,
					 * revisionIndex);
					 */

				}
				else {

					this.modus = ITERATE_WITHOUT_MAPPING;

					index = fullRevisionPKs.indexOf(' ');
					if (index == -1) {
						index = fullRevisionPKs.length();
					}

					int currentPK = Integer.parseInt(fullRevisionPKs.substring(
							0, index));

					// TODO CHECK! -2 instead of -1 gets rid of the extra
					//				resivsion from the next article
					this.revisionIterator = new RevisionIterator(config,
							currentPK, currentPK + maxRevision - 2,
							connection);

					if (revisionIterator.hasNext()) {
						return revisionIterator.next();
					}
					else {
						throw new RuntimeException("Revision query failed");
					}
				}
			}
			finally {

				if (statement != null) {
					statement.close();
				}
				if (result != null) {
					result.close();
				}

			}

		}
		catch (WikiApiException e) {
			throw e;
		}
		catch (Exception e) {
			throw new WikiApiException(e);
		}
	}
135658
public static long getRevisionNumber(ModuleIdentifier revisionId) {
        int revision;
        try {
            revision = Integer.parseInt(revisionId.getSlot());
        } catch (NumberFormatException nf) {
            revision = -1;
        }
        return revision;
    }
448454
def __update_action(self, revision):
        

        patch = revision.get("patch")
        if patch.get("_id"):
            del patch["_id"]

        update_response = yield self.collection.patch(revision.get("master_id"), self.__make_storeable_patch_patchable(patch))

        if update_response.get("n") == 0:
            raise RevisionNotFoundException()
604052
def _pi_rev_code(self):
        """"""
        # 2708 is Pi 1
        # 2709 is Pi 2
        # 2835 is Pi 3 (or greater) on 4.9.x kernel
        # Anything else is not a Pi.
        if self.detector.chip.id != ap_chip.BCM2XXX:
            # Something else, not a Pi.
            return None
        return self.detector.get_cpuinfo_field('Revision')
446489
def version_to_int(value):
    
    # remove '-SNAPSHOT'
    value = value.replace('-SNAPSHOT', '')
    # remove '-RCx'
    if '-RC' in value:
        value = value.split('-RC', 1)[0]
    try:
        return int(value.split('.')[1])
    except (ValueError, IndexError):
        return
734608
def ver(self, revision):
        """"""

        c = self.clone()

        c.version = self._parse_version(self.version)

        return c