Is a predecessor of the merge version
497417
protected boolean isPredecessor(NodeData mergeVersion, NodeData corrVersion) throws RepositoryException
   {
      SessionDataManager mergeDataManager = mergeSession.getTransientNodesManager();

      PropertyData predecessorsProperty =
         (PropertyData)mergeDataManager.getItemData(mergeVersion, new QPathEntry(Constants.JCR_PREDECESSORS, 0),
            ItemType.PROPERTY);

      if (predecessorsProperty != null)
      {
         for (ValueData pv : predecessorsProperty.getValues())
         {
            String pidentifier = ValueDataUtil.getString(pv);

            if (pidentifier.equals(corrVersion.getIdentifier()))
            {
               return true; // got it
            }

            // search in predecessors of the predecessor
            NodeData predecessor = (NodeData)mergeDataManager.getItemData(pidentifier);
            if (predecessor != null)
            {
               if (isPredecessor(predecessor, corrVersion))
               {
                  return true;
               }
            }
            else
            {
               throw new RepositoryException("Merge. Predecessor is not found by uuid " + pidentifier + ". Version "
                  + mergeSession.getLocationFactory().createJCRPath(mergeVersion.getQPath()).getAsString(false));
            }
         }
         // else it's a root version
      }

      return false;
   }
895607
def bump_version(ctx, new_version, version_part=None, dry_run=False):
    """"""
    version_part = version_part or "minor"
    if dry_run:
        ctx = DryRunContext(ctx)
    ctx.run("bumpversion --new-version={} {}".format(new_version,
                                                      version_part))
122665
def deep_merge(h)
      self.merge(h) do |key, v1, v2|
        if v1.is_a?(::Hash) && v2.is_a?(Sycl::Hash)
          self[key].deep_merge(v2)
        elsif v1.is_a?(::Hash) && v2.is_a?(::Hash)
          self[key].deep_merge(Sycl::Hash.from_hash(v2))
        else
          self[key] = Sycl::from_object(v2)
        end
      end
    end
206096
public static boolean greaterOrEqualsVersion(String versionA, String versionB) {
        String largerVersion = extractLargerVersion(versionA, versionB);
        return largerVersion != null && largerVersion.equals(versionA);
    }
240311
private void merge(Versioning versioning, ArtifactRepository from, List<VersionInfo> found) {
        if ( StringUtils.isNotEmpty( versioning.getRelease() ) )
            found.add(new VersionInfo(versioning.getRelease(),from));

        if ( StringUtils.isNotEmpty( versioning.getLatest() ) )
            found.add(new VersionInfo(versioning.getLatest(),from));

        for ( String v : versioning.getVersions() )
            found.add(new VersionInfo(v,from));
    }

    VersionInfo findLatest(List<VersionInfo> infos) {
        Collections.sort(infos);
        if (infos.isEmpty())    return null;
        return infos.get(infos.size()-1);
    }

    private static class VersionInfo implements Comparable<VersionInfo> {
        final VersionNumber version;
        final ArtifactRepository repository;

        public VersionInfo(String version, ArtifactRepository repository) {
            this.version = new VersionNumber(version);
            this.repository = repository;
        }

        public int compareTo(VersionInfo that) {
            return this.version.compareTo(that.version);
        }
    }
    
    private Versioning readVersions( RepositorySystemSession session, RequestTrace trace, Metadata metadata,
                                     ArtifactRepository repository, VersionResult result )
    {
        Versioning versioning = null;

        FileInputStream fis = null;
        try
        {
            if ( metadata != null )
            {
                SyncContext syncContext = syncContextFactory.newInstance( session, true );

                try
                {
                    syncContext.acquire( null, Collections.singleton( metadata ) );

                    if ( metadata.getFile() != null && metadata.getFile().exists() )
                    {
                        fis = new FileInputStream( metadata.getFile() );
                        org.apache.maven.artifact.repository.metadata.Metadata m =
                            new MetadataXpp3Reader().read( fis, false );
                        versioning = m.getVersioning();

                        /*
                         * NOTE: Users occasionally misuse the id "local" for remote repos which screws up the metadata
                         * of the local repository. This is especially troublesome during snapshot resolution so we try
                         * to handle that gracefully.
                         */
                        if ( versioning != null && repository instanceof LocalRepository)
                        {
                            if ( versioning.getSnapshot() != null && versioning.getSnapshot().getBuildNumber() > 0 )
                            {
                                Versioning repaired = new Versioning();
                                repaired.setLastUpdated( versioning.getLastUpdated() );
                                Snapshot snapshot = new Snapshot();
                                snapshot.setLocalCopy( true );
                                repaired.setSnapshot( snapshot );
                                versioning = repaired;

                                throw new IOException( "Snapshot information corrupted with remote repository data"
                                    + ", please verify that no remote repository uses the id '" + repository.getId()
                                    + "'" );
                            }
                        }
                    }
                }
                finally
                {
                    syncContext.release();
                }
            }
        }
        catch ( Exception e )
        {
            invalidMetadata( session, trace, metadata, repository, e );
            result.addException( e );
        }
        finally
        {
            IOUtil.close(fis);
        }

        return ( versioning != null ) ? versioning : new Versioning();
    }

    private void invalidMetadata( RepositorySystemSession session, RequestTrace trace, Metadata metadata,
                                  ArtifactRepository repository, Exception exception )
    {
        RepositoryListener listener = session.getRepositoryListener();
        if ( listener != null )
        {
            DefaultRepositoryEvent event = new DefaultRepositoryEvent( EventType.METADATA_INVALID, session, trace );
            event.setMetadata( metadata );
            event.setException( exception );
            event.setRepository( repository );
            listener.metadataInvalid( event );
        }
    }

    private static final String MAVEN_METADATA_XML = "maven-metadata.xml";

    private static final String LATEST = "LATEST";

    private static final String SNAPSHOT = "SNAPSHOT";
}
602162
def is_merge_origin(self):
        """"""
        if self.gridSpan > 1 and not self.vMerge:
            return True
        if self.rowSpan > 1 and not self.hMerge:
            return True
        return False
1219780
public static boolean isMergeFolders() {
        Configuration config = ConfigUtils.getCurrentConfig();
        if (config != null) {
            return config.getBoolean(MERGE_FOLDERS_CONFIG_KEY, false);
        } else {
            return false;
        }
    }
1034638
function _sdk_version_update( $sdk_prev_version, $sdk_version ) {
            /**
             * @since 1.1.7.3 Fixed unwanted connectivity test cleanup.
             */
            if ( empty( $sdk_prev_version ) ) {
                return;
            }

            if ( version_compare( $sdk_prev_version, '2.1.0', '<' ) &&
                 version_compare( $sdk_version, '2.1.0', '>=' )
            ) {
                $this->_storage->handle_gdpr_admin_notice = true;
            }

            if ( version_compare( $sdk_prev_version, '2.0.0', '<' ) &&
                 version_compare( $sdk_version, '2.0.0', '>=' )
            ) {
                $this->migrate_to_subscriptions_collection();

                $this->consolidate_licenses();

                // Clear trial_plan since it's now loaded from the plans collection when needed.
                $this->_storage->remove( 'trial_plan', true, false );
            }

            if ( version_compare( $sdk_prev_version, '1.2.3', '<' ) &&
                 version_compare( $sdk_version, '1.2.3', '>=' )
            ) {
                /**
                 * Starting from version 1.2.3, paths are stored as relative instead of absolute and some of them can be
                 * invalid.
                 *
                 * @author Leo Fajardo (@leorw)
                 */
                $this->remove_invalid_paths();
            }

            if ( version_compare( $sdk_prev_version, '1.1.5', '<' ) &&
                 version_compare( $sdk_version, '1.1.5', '>=' )
            ) {
                // On version 1.1.5 merged connectivity and is_on data.
                if ( isset( $this->_storage->connectivity_test ) ) {
                    if ( ! isset( $this->_storage->is_on ) ) {
                        unset( $this->_storage->connectivity_test );
                    } else {
                        $connectivity_data              = $this->_storage->connectivity_test;
                        $connectivity_data['is_active'] = $this->_storage->is_on['is_active'];
                        $connectivity_data['timestamp'] = $this->_storage->is_on['timestamp'];

                        // Override.
                        $this->_storage->connectivity_test = $connectivity_data;

                        // Remove previous structure.
                        unset( $this->_storage->is_on );
                    }

                }
            }

            if (
                version_compare( $sdk_prev_version, '2.2.1', '<' ) &&
                version_compare( $sdk_version, '2.2.1', '>=' )
            ) {
                /**
                 * Clear the file cache without storing the previous path since it could be a wrong path. For example,
                 * in the versions of the SDK lower than 2.2.1, it's possible for the path of an add-on to be the same
                 * as the parent plugin's when the add-on was auto-installed since the relevant method names were not
                 * skipped in the logic that determines the right path in the `get_caller_main_file_and_type` method
                 * (e.g. `try_activate_plugin`). Since it was an auto-installation, the caller was the parent plugin
                 * and so its path was used. In case the stored path is wrong, clearing the cache will resolve issues
                 * related to data mix-up between plugins (e.g. titles and versions of an add-on and its parent plugin).
                 *
                 * @author Leo Fajardo (@leorw)
                 * @since 2.2.1
                 */
                $this->clear_module_main_file_cache( false );
            }
        }
331995
public static boolean isNewer(HasMetadata newer, HasMetadata older) {
        long n1 = parseResourceVersion(newer);
        long n2 = parseResourceVersion(older);
        return n1 >= n2;
    }
989733
def is_merged(self):
        
        url = self._build_url('merge', base_url=self._api)
        return self._boolean(self._get(url), 204, 404)
491092
def semver_newer(v1, v2):
    
    v1_parts = v1.split('.')
    v2_parts = v2.split('.')
    if len(v1_parts) < 3 or len(v2_parts) < 3:
        # one isn't a semantic version
        return False

    v1_major, v1_minor, v1_patch = get_version_parts(v1_parts, int)
    v2_major, v2_minor, v2_patch = get_version_parts(v2_parts, int)

    if v1_major > v2_major:
        return False

    if v1_major == v2_major and v1_minor >= v2_minor:
        return False

    return True
953097
function getFirstVersionOfDeletion(filePath) {
    const deletionCommit = getCommitDeletingFile(filePath),
        tags = execSilent(`git tag --contains ${deletionCommit}`);

    return splitCommandResultToLines(tags)
        .map(version => semver.valid(version.trim()))
        .filter(version => version)
        .sort(semver.compare)[0];
}
1036228
def _merge_before_set(self, key, existing, value, is_secret):
        """"""

        def _log_before_merging(_value):
            self.logger.debug(
                "Merging existing %s: %s with new: %s", key, existing, _value
            )

        def _log_after_merge(_value):
            self.logger.debug("%s merged to %s", key, _value)

        global_merge = getattr(self, "MERGE_ENABLED_FOR_DYNACONF", False)

        if isinstance(value, dict):
            local_merge = value.pop(
                "dynaconf_merge", value.pop("dynaconf_merge_unique", None)
            )
            if global_merge or local_merge:
                safe_value = {k: "***" for k in value} if is_secret else value
                _log_before_merging(safe_value)
                object_merge(existing, value)
                safe_value = (
                    {
                        k: ("***" if k in safe_value else v)
                        for k, v in value.items()
                    }
                    if is_secret
                    else value
                )
                _log_after_merge(safe_value)

        if isinstance(value, (list, tuple)):
            local_merge = (
                "dynaconf_merge" in value or "dynaconf_merge_unique" in value
            )
            if global_merge or local_merge:
                value = list(value)
                unique = False

                if local_merge:
                    try:
                        value.remove("dynaconf_merge")
                    except ValueError:  # EAFP
                        value.remove("dynaconf_merge_unique")
                        unique = True

                original = set(value)
                _log_before_merging(
                    ["***" for item in value] if is_secret else value
                )
                object_merge(existing, value, unique=unique)
                safe_value = (
                    ["***" if item in original else item for item in value]
                    if is_secret
                    else value
                )
                _log_after_merge(safe_value)

        return value
275232
def merge_with_id(path, new_path, id)
      Dir.chdir(@directory) do
        run("git show #{id}:#{path} > #{path}.old_version")

        conflict_count = 0
        begin
          run("git merge-file #{path} #{path}.old_version #{new_path} \
                -L \"newly generated\" \
                -L \"previously generated\" \
                -L \"user edited\"")
        rescue ExecutionFailed => e
          if e.status > 0
            conflict_count = e.status
          else
            raise e
          end
        end
        File.delete("#{path}.old_version")
        conflict_count
      end
    end
1083402
function checkIfVersionUpdated() {

        var latestBuildNumber = updateJsonHandler.get("latestBuildNumber"),
            currentBuildNumber = Number(/-([0-9]+)/.exec(brackets.metadata.version)[1]);

        return latestBuildNumber === currentBuildNumber;
    }
149182
function merge(prev, current, next) {
  return prev
    .concat()
    .reverse()
    .concat([current], next)
}
108320
async function commitVersionBump (version) {
  const gitDir = path.resolve(__dirname, '..')
  const gitArgs = ['commit', '-a', '-m', `Bump v${version}`, '-n']
  await GitProcess.exec(gitArgs, gitDir)
}