Locks the specified version.
355723
def lock_version(self, service_id, version_number):
		""""""
		content = self._fetch("/service/%s/version/%d/lock" % (service_id, version_number))
		return self._status(content)
1219474
def lock(self):  # type: () -> Installer
        
        self.update()
        self.execute_operations(False)
        self._lock = True

        return self
305031
public static void setVersion(JsonNode node, Long version) {
		obj(node).put(ID_VERSION, version);
	}
888005
public <E> E updateWithOptimisticLock(E entity) {
    PropertyMetadata versionMetadata = EntityIntrospector.getVersionMetadata(entity);
    if (versionMetadata == null) {
      return update(entity);
    } else {
      return updateWithOptimisticLockingInternal(entity, versionMetadata);
    }

  }
763803
public void enableLocking() {
		if (validState) {
			throw new InvalidStateException();
		}
		if (Boolean.getBoolean(Constants.PROP_IO_LOCKING)) {
			useLock = false;
			log.info("Disabled Locking in System Property (" + Constants.PROP_IO_LOCKING + ")");
		} else {
			useLock = true;
			log.info("Enabled Locking");
		}
	}
251623
public void setLocked(boolean locked) {
		if (ap == null) {
			return;
		}
		ap.setLocked(locked);
		btnPin.setVisible(! locked);
		if (!ap.isPinned()) {
			// Wont be visible if its pinned
			btnClose.setVisible(! locked);
		}
	}
849190
public function setVersion(string $version)
    {
        if (Validation::isValidVersionRegex($version)) {
            $this->version = $version;
        } else {
            throw new CustomException('Malformed version');
        }
    }
1094484
private void enforceVersionRequired()
    {
        if ( _versionRequired != null )
        {
            if ( !isExtension() )
            {
                _ap.printError( _intfDecl, "versionrequired.illegal.usage" );
                return;
            }

            int majorRequired = _versionRequired.major();
            int minorRequired = _versionRequired.minor();

            if ( majorRequired < 0 )    // no real version requirement
                return;

            AptControlInterface ci = getMostDerivedInterface();
            if ( ci == null )
                return;

            int majorPresent = -1;
            int minorPresent = -1;
            Version ciVersion = ci._version;
            if ( ciVersion != null )
            {
                majorPresent = ciVersion.major();
                minorPresent = ciVersion.minor();

                if ( majorRequired <= majorPresent &&
                     (minorRequired < 0 || minorRequired <= minorPresent) )
                {
                    // Version requirement is satisfied
                    return;
                }
            }

            //
            // Version requirement failed
            //
            _ap.printError( _intfDecl, "versionrequired.failed", _intfDecl.getSimpleName(),
                    majorRequired, minorRequired, majorPresent, minorPresent );
        }
    }
899996
public static void ignoreUpdate(Version ver) {
        FOKLogger.info(UpdateChecker.class.getName(), "User ignores all updates up to (and including) version " + ver.toString());
        updatePrefs.setPreference(latestSeenVersionPrefKey, ver.toString());
    }
1001857
private void lockSourceAndCopy(File sourceFile, File copyFile) {
    sourceFile.opened();
    ReadWriteLock sourceLock = sourceFile.contentLock();
    if (sourceLock != null) {
      sourceLock.readLock().lock();
    }
    ReadWriteLock copyLock = copyFile.contentLock();
    if (copyLock != null) {
      copyLock.writeLock().lock();
    }
  }
1331127
private void enforceVersionSupported()
    {
        if ( _versionSupported != null )
        {
            int majorSupported = _versionSupported.major();
            int minorSupported = _versionSupported.minor();

            if ( majorSupported < 0 )    // no real version support requirement
                return;

            AptControlInterface ci = getControlInterface();
            if ( ci == null )
                return;

            int majorPresent = -1;
            int minorPresent = -1;
            Version ciVersion = ci.getVersion();
            if ( ciVersion != null )
            {
                majorPresent = ciVersion.major();
                minorPresent = ciVersion.minor();

                if ( majorSupported >= majorPresent &&
                     (minorSupported < 0 || minorSupported >= minorPresent) )
                {
                    // Version requirement is satisfied
                    return;
                }
            }

            //
            // Version requirement failed
            //

            _ap.printError( _implDecl, "versionsupported.failed", _implDecl.getSimpleName(), majorSupported, minorSupported,
                            majorPresent, minorPresent );
        }
    }
842866
public void locked (@Nonnull final Runnable aRunnable)
  {
    ValueEnforcer.notNull (aRunnable, "Runnable");

    lock ();
    try
    {
      aRunnable.run ();
    }
    finally
    {
      unlock ();
    }
  }
220150
private void setVersion(Object val) throws CertificateException {
        if (!(val instanceof CertificateVersion)) {
            throw new CertificateException("Version class type invalid.");
        }
        version = (CertificateVersion)val;
    }
446945
def setVersion(self, version):
        
        try:
            sha = self.versions(version).commit.sha
            self.git.reset("--hard", sha)
        except Exception, e:
            raise RepoError(e)
1133778
@Override
    public void lock(final Object maintainer) throws CouldNotPerformException {
        synchronized (maintainerLock) {
            if (this.maintainer != null) {
                throw new CouldNotPerformException("Could not lock remote because it is already locked by another instance!");
            }
            this.maintainer = maintainer;
        }
    }
385979
public void setVersions(java.util.Collection<String> versions) {
        if (versions == null) {
            this.versions = null;
            return;
        }

        this.versions = new java.util.ArrayList<String>(versions);
    }
1070842
def set_version(self, version='0.0.0', save=True):
        """"""
        self.set(self.DEFAULT_SECTION_NAME, 'version', version, save=save)