Merges a list of releases into a versionedRelease.
965234
def merge_versioned(releases, schema=None, merge_rules=None):
    
    if not merge_rules:
        merge_rules = get_merge_rules(schema)

    merged = OrderedDict()
    for release in sorted(releases, key=lambda release: release['date']):
        release = release.copy()

        # Don't version the OCID.
        ocid = release.pop('ocid')
        merged[('ocid',)] = ocid

        releaseID = release['id']
        date = release['date']
        # Prior to OCDS 1.1.4, `tag` didn't set "omitWhenMerged": true.
        tag = release.pop('tag', None)

        flat = flatten(release, merge_rules)
        processed = process_flattened(flat)

        for key, value in processed.items():
            # If value is unchanged, don't add to history.
            if key in merged and value == merged[key][-1]['value']:
                continue

            if key not in merged:
                merged[key] = []

            merged[key].append(OrderedDict([
                ('releaseID', releaseID),
                ('releaseDate', date),
                ('releaseTag', tag),
                ('value', value),
            ]))

    return unflatten(merged, merge_rules)
102633
def get_released_versions(component):
    

    releases = get_tags()
    releases = sorted([(x[0], [int(y) for y in x[1].split('.')]) for x in releases], key=lambda x: x[1])[::-1]

    return [(x[0], ".".join(map(str, x[1]))) for x in releases if x[0] == component]
720238
def filter(self, info, releases):
        

        # Make a copy of releases keys
        # as we may delete packages during iteration
        removed = 0
        versions = list(releases.keys())
        for version in versions:
            new_files = []
            for file_desc in releases[version]:
                if self._check_match(file_desc):
                    removed += 1
                else:
                    new_files.append(file_desc)
            if len(new_files) == 0:
                del releases[version]
            else:
                releases[version] = new_files
        logger.debug(f"{self.name}: filenames removed: {removed}")
671792
def merge_dupes(self):
        """"""
        for dupe in self.dupe_of:
            if dupe in self.catalog.entries:
                if self.catalog.entries[dupe]._stub:
                    # merge = False to avoid infinite recursion
                    self.catalog.load_entry_from_name(
                        dupe, delete=True, merge=False)
                self.catalog.copy_entry_to_entry(self.catalog.entries[dupe],
                                                 self)
                del self.catalog.entries[dupe]
        self.dupe_of = []
93901
def _merge_results(self, results):
        """"""
        self.results['tests'] += results['tests']

        for key, value in results['summary'].items():
            self.results['summary'][key] += value
1299318
def do_releases(self, subcmd, opts, component):
        

        releases = get_released_versions(component)
        for x in releases:
            print("{} - {}".format(*x))
974968
def merged():
    # type: () -> None
    
    develop = conf.get('git.devel_branch', 'develop')
    master = conf.get('git.master_branch', 'master')
    branch = git.current_branch(refresh=True)

    common.assert_branch_type('hotfix')

    # Pull master with the merged hotfix
    common.git_checkout(master)
    common.git_pull(master)

    # Merge to develop
    common.git_checkout(develop)
    common.git_pull(develop)
    common.git_merge(develop, branch.name)

    # Cleanup
    common.git_branch_delete(branch.name)
    common.git_prune()

    common.git_checkout(master)
754921
def merge(revision, branch_label, message, list_revisions=''):
    
    alembic_command.merge(
        config=get_config(),
        revisions=list_revisions,
        message=message,
        branch_label=branch_label,
        rev_id=revision
    )
694662
def sorted_releases(self):
        
        releases = [(parse_version(release.version), release)
                    for release in self.releases]
        releases.sort(reverse=True)
        return [release[1] for release in releases]
1061917
def listReleaseVersions(self, release_version="", dataset='', logical_file_name=''):
        
        if dataset and ('%' in dataset or '*' in dataset):
            dbsExceptionHandler('dbsException-invalid-input',
                " DBSReleaseVersion/listReleaseVersions. No wildcards are" +
                " allowed in dataset.\n.")

        if logical_file_name and ('%' in logical_file_name or '*' in logical_file_name):
            dbsExceptionHandler('dbsException-invalid-input',
                " DBSReleaseVersion/listReleaseVersions. No wildcards are" +
                " allowed in logical_file_name.\n.")

        conn = self.dbi.connection()
        try:
            plist = self.releaseVersion.execute(conn, release_version.upper(), dataset, logical_file_name)
            result = [{}]
            if plist:
                t = []
                for i in plist:
                    for k, v in i.iteritems():
                        t.append(v)
                result[0]['release_version'] = t
            return result
        finally:
            if conn:
                conn.close()
1351700
def release_branches(self):
        """"""
        self.ensure_release_scheme('branches')
        return dict((r.revision.branch, r) for r in self.releases.values())
901150
def version_variants(version):
    """"""

    result = [version]

    # Add trailing ".0" as needed to ensure that we have at least
    # major.minor.patch
    parts = version.split(".")
    while len(parts) < 3:
        parts.append("0")
        result.append(".".join(parts))

    return result
1093815
def perform_release(context):
    """"""
    try:
        run_tests()

        if not context.skip_changelog:
            generate_changelog(context)

        increment_version(context)

        build_distributions(context)

        install_package(context)

        upload_package(context)

        install_from_pypi(context)

        publish(context)
    except Exception:
        log.exception('Error releasing')
670165
def merge(self, resolvable, packages, parent=None):
    """"""
    self.__tuples.append(_ResolvedPackages(resolvable, OrderedSet(packages),
                                           parent, resolvable.is_constraint))
    self._check()
1337447
def release(version):
    
    if version == ".":
        # harvest version number from dirname of repo
        # I remind you, we're in the Misc subdir right now
        version = os.path.basename(root)

    existing_filenames = glob_blurbs(version)
    if existing_filenames:
        error("Sorry, can't handle appending 'next' files to an existing version (yet).")

    output = f("Misc/NEWS.d/{version}.rst")
    filenames = glob_blurbs("next")
    blurbs = Blurbs()
    date = current_date()

    if not filenames:
        print(f("No blurbs found.  Setting {version} as having no changes."))
        body = f("There were no new changes in version {version}.\n")
        metadata = {"no changes": "True", "bpo": "0", "section": "Library", "date": date, "nonce": nonceify(body)}
        blurbs.append((metadata, body))
    else:
        no_changes = None
        count = len(filenames)
        print(f('Merging {count} blurbs to "{output}".'))

        for filename in filenames:
            if not filename.endswith(".rst"):
                continue
            blurbs.load_next(filename)

        metadata = blurbs[0][0]

    metadata['release date'] = date
    print("Saving.")

    blurbs.save(output)
    git_add_files.append(output)
    flush_git_add_files()

    how_many = len(filenames)
    print(f("Removing {how_many} 'next' files from git."))
    git_rm_files.extend(filenames)
    flush_git_rm_files()

    # sanity check: ensuring that saving/reloading the merged blurb file works.
    blurbs2 = Blurbs()
    blurbs2.load(output)
    assert blurbs2 == blurbs, f("Reloading {output} isn't reproducible?!")

    print()
    print("Ready for commit.")
1304795
def release(major=False, minor=False, patch=True, pypi_index=None):
    """"""
    relver = next_release(major, minor, patch)
    start_rel_branch(relver)
    prepare_release(relver)
    finish_rel_branch(relver)
    publish(pypi_index)
1264829
def add_release_to_changelog(version):
    """"""
    temp_file = changelog_file().parent / ("~" + changelog_file().name)
    now = datetime.today()
    release_added = False
    with open(str(temp_file), 'w') as g:
        with open(str(changelog_file()), 'r') as f:
            for line in f:
                list_match = list_match_re.match(line)
                if list_match and not release_added:
                    release_line = "{}{} :release:`{} <{}-{:02}-{:02}>`".format(
                                        list_match.group("leading"),
                                        list_match.group("mark"),
                                        version, now.year, now.month, now.day)
                    print(release_line, file=g)
                    release_added = True
                print(line, file=g, end="")
            if not release_added:
                release_line = "{}{} :release:`{} <{}-{:02}-{:02}>`".format(
                                " ", "-", version, now.year, now.month, now.day)
                print(release_line, file=g)
        print('', file=g)  # add a blank line at the end of the file
    shutil.copyfile(str(temp_file), str(changelog_file()))
    os.remove(str(temp_file))