<repo_name>aoles/bioc_git_transition<file_sep>/run_transition.py
#!/usr/bin/env python
"""Bioconductor run git transition code.

This module assembles the functions from `git_script.py` and
`svn_dump.py` so that the Bioconductor SVN --> Git transition
can be run in a sequential manner.

Author: <NAME>
Ideas taken from <NAME>'s code in Bioconductor/mirror

Usage:
    `python run_transition.py`
"""

from src.local_svn_dump import LocalSvnDump
from src.git_bioconductor_repository import GitBioconductorRepository
from src.lfs import Lfs
import os
import logging as log
import ConfigParser


def make_git_repo(svn_root, temp_git_repo, bare_git_repo, remote_url,
                  package_path, lfs_object=None):
    # Step 4: Add release branches to all   packages
    gitrepo = GitBioconductorRepository(svn_root, temp_git_repo,
                                        bare_git_repo, remote_url,
                                        package_path)
    log.info("Make git repo: Adding release branches")
    gitrepo.add_release_branches()
    # Step 5: Add commit history
    log.info("Make git repo: Adding commit history")
    gitrepo.add_commit_history()

    if lfs_object is not None:
        log.info("Running LFS transtion")
        lfs_object.run_lfs_transition(temp_git_repo)
    # Step 6: Make Git repo bare
    log.info("Make git repo: Creating bare repositories")
    gitrepo.create_bare_repos()
    log.info("Make git repo: Adding remotes to make git server available")
    gitrepo.add_remote()
    return


def run_transition(configfile, new_svn_dump=False):
    """Update SVN local dump and run gitify-bioconductor.

    Step 0: Create dump
    `svnadmin create bioconductor-svn-mirror`
    `svnrdump dump https://hedgehog.fhcrc.org/bioconductor |
                svnadmin load bioconductor-svn-mirror`
    """

    # Settings
    Config = ConfigParser.ConfigParser()
    Config.read(configfile)
    temp_git_repo = Config.get('Software', 'temp_git_repo')
    remote_url = Config.get('Software', 'remote_url')
    bare_git_repo = Config.get('Software', 'bare_git_repo')
    package_path = Config.get('Software', 'package_path')

    svn_root = Config.get('SVN', 'svn_root')
    remote_svn_server = Config.get('SVN', 'remote_svn_server')
    users_db = Config.get('SVN', 'users_db')
    svn_transition_log = Config.get('SVN', 'svn_transition_log')

    log.basicConfig(filename=svn_transition_log,
                    level=log.DEBUG,
                    format='%(asctime)s %(message)s')
    log.debug("Bioconductor Transition Log File: \n")

    # Print in the log file.
    for s in Config.sections():
        for k, v in Config.items(s):
            log.info("%s: %s" % (k, v))

    if not os.path.isdir(temp_git_repo):
        os.mkdir(temp_git_repo)

    # Step 1: Initial set up, get list of packs from trunk
    dump = LocalSvnDump(svn_root, temp_git_repo, users_db,
                        remote_svn_server, package_path)
    packs = dump.get_pack_list(branch="trunk")
    ###################################################
    # Create a local dump of SVN packages in a location
    if new_svn_dump:
        log.info("Create a local SVN dump")
        dump.svn_dump(packs)
    ###################################################

    # Make bare repo, if it does not exist
    if not os.path.isdir(bare_git_repo):
        os.mkdir(bare_git_repo)

    # Make temp git repo, with all commit history
    log.info("Make git repo")
    make_git_repo(svn_root, temp_git_repo, bare_git_repo, remote_url,
                  package_path)

    # EOF message
    log.info("Finished setting up bare git repo")
    return


def run_experiment_data_transition(configfile, new_svn_dump=False):
    """Run experiment data transtion.
    """
    # Settings
    Config = ConfigParser.ConfigParser()
    Config.read(configfile)
    temp_git_repo = Config.get('ExperimentData', 'temp_git_repo')
    remote_url = Config.get('Software', 'remote_url')
    bare_git_repo = Config.get('ExperimentData', 'bare_git_repo')
    svn_root = Config.get('ExperimentData', 'svn_root')
    remote_svn_server = Config.get('ExperimentData',
                                   'remote_svn_server')
    package_path = Config.get('ExperimentData', 'package_path')
    users_db = Config.get('SVN', 'users_db')

    trunk = Config.get('SVN', 'trunk')
    data_store_path = Config.get('ExperimentData', 'data_store_path')
    ref_file = Config.get('ExperimentData', 'ref_file')

    data_log = Config.get("ExperimentData", "data_log")
    log.basicConfig(filename=data_log,
                    level=log.DEBUG,
                    format='%(asctime)s %(message)s')
    log.debug("Bioconductor Experiment data transition log File: \n")

    # Create temp_git_repo directory
    if not os.path.isdir(temp_git_repo):
        os.mkdir(temp_git_repo)

    # Step 1: Initial set up, get list of packs from trunk
    dump = LocalSvnDump(svn_root, temp_git_repo, users_db,
                        remote_svn_server, package_path)
    packs = dump.get_pack_list(branch="trunk")

    ###################################################
    # Create a local dump of SVN packages in a location
    if new_svn_dump:
        log.info("Create a local SVN dump of experiment data")
        dump.svn_dump(packs)
    ###################################################
    # Make bare repo, if it does not exist
    if not os.path.isdir(bare_git_repo):
        os.mkdir(bare_git_repo)

    # Make temp git repo, with all commit history
    log.info("Make git repo for experiment data packages")
    # Create a new git LFS object
    lfs = Lfs(svn_root, trunk, data_store_path, ref_file, temp_git_repo)
    # Run make_git_repo, with new LFS object
    make_git_repo(svn_root, temp_git_repo, bare_git_repo,
                  remote_url, package_path, lfs_object=lfs)
    # EOF message
    log.info("Finished setting up bare git repo for experiment data packages")
    return


if __name__ == '__main__':
    run_transition("./settings.ini", new_svn_dump=True)
    run_experiment_data_transition("./settings.ini", new_svn_dump=False)
<file_sep>/src/helper/helper.py
import subprocess

def is_github_repo(url):
    """Check if it is a valid github repo.

    Returns True, or False.
    """
    cmd = ['git', 'ls-remote', url]
    proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
                            stderr=subprocess.PIPE)
    out, err = proc.communicate()

    if err:
        print("This is not a valid github URL: \n %s" % err)
        return False
    print("Out: %s" % out)
    return True
<file_sep>/doc/workflows/maintainer-workflow.md
# Developer -- Add Bioconductor package to git.bioconductor.org

Bioconductor expects its developers to use a git-based version control system. This will allow the developers to easily interact with Bioconductor's private git server.

Bioconductor git server is available at:

1. `SSH` read/write access to developers: `<EMAIL>`

1. `HTTPS` read only access to the world: `https://git.bioconductor.org`


This document will explain a developers workflow using GitHub.

## Developer has a public GitHub repository

The developers will have a public GitHub repository where they can interact with their package community, accept pull requests, issues, and other GitHub collaboration features. As the developer actively develops they will have the repository cloned on their local machine. The GitHub repository is where the developer should be maintaining his code.

Eg:

```
git clone <EMAIL>:developer/<ExamplePackage>.git
```

The remotes on the package will be that of GitHub's, because it is the remote server being used by the developer. The developer can check if the remote is configured properly using,

```
git remote -v
```

This should show,

```
origin  <EMAIL>:developer/example_package.git (fetch)
origin  git@github.com:developer/example_package.git (push)
```

the remote shows that you can `fetch` and `push` to those remote locations, this remote location is called `origin`.

## Add remotes

Our goal is to add another remote location to the local repository, the Bioconductor private server.

```
git remote add upstream <EMAIL>:packages/example_package.git
```

To check if the remote has been added properly, we can check it using:

```
git remote -v
```

which should show,

```
origin  <EMAIL>:developer/example_package.git (fetch)
origin  <EMAIL>:developer/example_package.git (push)
upstream    <EMAIL>:packages/example_package.git (fetch)
upstream    <EMAIL>:packages/example_package.git (push)
```

NOTE: To be able to `fetch` and `push` to <EMAIL>, the developer should have ssh access. More about how to get ssh access on the [Contributions.md](https://github.com/Bioconductor/BiocContributions).


## Push to remote master and remote upstream

If a developer makes a change to his package, it is important that he push to BOTH his GitHub, and Bioconductor's git server. This is important if the developer wants the Bioconductor remote to be in sync.

First, push to the remote `origin` in the branch `master`:

```
git push origin master
```

Second, push to the remote `upstream` in the branch `master`:

```
git push upstream master
```

This will sync BOTH the developers GitHub repository and the Bioconductor servers repository.

## Pull from remote upstream and keep things in sync

One thing a developer has to do is get updates from any changes or commits made to the Bioconductor repository,

To get updates from the Bioconductor repository (i.e changes made by the core team)

```
git fetch --all
git merge upstream/master
```

To get updates from the GitHub repository (i.e changes made by your collaborators)

```
git merge origin/master
```
<file_sep>/doc/workflows/new-package-workflow.md
# New package workflow

**Goal**: You are a developer who wants to contribute a new package to Bioconductor. You have been developing on GitHub (or another git based platform). How do you contribute your package to Bioconductor?

## Steps:

We use the package "BiocGenerics" as an example.

1. We assume that you have already finished developing you package according to the Bioconductor [Package Guidelines][].

1. If you do not have your package on GitHub, we highly recommend using it. You will be able to leverage features such as Pull requests, issue tracking, and many more social coding ideas which will make your Bioconductor package community happier. To use GitHub, please [Create a new GitHub account][].

1. The next step is to [Create a new GitHub repository][] with your package name.

1.  On your **local machine** initiate "git" in your package repository

    ```
    cd BiocGenerics
    git init
    ```

1. Once you have initialized the git repository on your local machine, add all the contents you need for the Bioconductor package,

    ```
    git add DESCRIPTION NAMESPACE NEWS R/* inst/* man/* tests/* vignettes/*
    ```

    You can also just do `git add *` if you wish to add everything in the package.

1. Commit all your new additions to your local git repository,

    ```
    git commit -m "New bioconductor package named BiocGenerics"
    ```

1.  Add a remote to your local git repository,

    `git remote add origin <EMAIL>:developer/BiocGenerics.git`

2.  To check that remotes are set up properly, run the command inside your local machine's clone.

    `git remote -v`

    which should produce the result

    ```
    origin  <EMAIL>:developer/BiocGenerics.git (fetch)
    origin  <EMAIL>:developer/BiocGenerics.git (push)
    ```

1. Push the new content to your GitHub repository, so it's visible to the world

    `git push -u origin master`

    **NOTE: Check your GitHub account, and make sure you are able to view all your files.**

1. Your next step is to notify the Bioconductor team, about the package you developed to contribute to Bioconductor. You can do this be adding an issue to the [Contributions Issues][] page. Please follow that [README.md][] file on the Contributions page for additional information.

1. After adding your package to the [Contributions Issues][] page, a member from the Bioconductor core team will be assigned to your package for review. Provided the review process goes as planned and your package is accepted, it will be added to the Bioconductor git server by the core team.

1. Once your package has been accepted to Bioconductor, you should be able to see it on the [Bioconductor git server][] which is available at:

    **ssh read/write access to developers:** `<EMAIL>`

    **https read only access to the world:** `https://git.bioconductor.org`

1. For developers/maintainers, you are required to send your ssh public key to `<EMAIL>` and you will be added to the server, and given access to your package.

1. The bioconductor core team will make changes on your package for bugs or bumping a version number for a new release. So it becomes essential that you add the Bioconductor repository as another remote to your machine's local git repository. You need to add a remote, using:

    `git remote add upstream <EMAIL>:packages/BiocGenerics.git`

1.  Fetch content from remote upstream,

    `git fetch upstream`

    **NOTE:** This step will fail if you don't have access as a developer to the Bioconductor repository.

1.  Merge upstream with origin's `master` branch,

    `git merge upstream/master`

1. Push changes to your GitHub (`origin`) repository's branch `master`,

    `git push origin`

1.  Developers/Maintainers make changes to the current release branch. You will need to add a branch to GitHub, to be able to push these changes.

    ```
    # Fetch all updates
    git fetch upstream

    # Checkout new branch RELEASE_3_5, from upstream/RELEASE_3_5
    git checkout -b RELEASE_3_5 upstream/RELEASE_3_5

    # Push updates to remote origin's new branch RELEASE_3_5
    git push -u origin RELEASE_3_5
    ```

1. Check your GitHub repository to confirm that the `master` (and optionally `RELEASE_3_5`) branches are present.


[README.md]: https://github.com/Bioconductor/Contributions

[Contributions Issues]: https://github.com/Bioconductor/Contributions/issues

[Package Guidelines]: https://www.bioconductor.org/developers/package-guidelines/

[Create a new GitHub account]: https://help.github.com/articles/signing-up-for-a-new-github-account/

[Create a new GitHub repository]: https://help.github.com/articles/create-a-repo/
[Bioconductor git server]: https://git.bioconductor.org
<file_sep>/src/lfs.py
"""Module to create LFS based experiment data packages.

Add data content to data package.

In this svn repository, the data subdir of a package is
stored separately in svn.  add_data.py can be used to add
the data subdir to a given package.

The appropriate data dir will be added to the specified package.
"""

import os
import subprocess
from git_api.git_api import git_lfs_track
from git_api.git_api import git_add
from git_api.git_api import git_commit
import logging as log
from local_svn_dump import Singleton


class Lfs:
    """Create git LFS based experiment data packages."""
    __metaclass__ = Singleton

    def __init__(self, svn_root, trunk, data_store_path, ref_file,
                 temp_git_repo):
        """Initialize LFS class."""
        self.svn_root = svn_root
        self.trunk = trunk
        self.data_store_path = data_store_path
        self.ref_file = ref_file
        self.temp_git_repo = temp_git_repo
        return

    def parse_external_refs(self, package):
        """Parse external refs file, and return a list of data references."""
        path = package + "/" + self.ref_file
        with open(path, 'r') as f:
            refs = list(line for line in (l.strip() for l in f) if line)
        return refs

    def list_files(self, path):
        """List files in a path."""
        ans = [os.path.join(root, f)
               for root, subdir, files in os.walk(path)
               for f in files]
        return [item[len(path)+1:] for item in ans]

    def add_data(self, package):
        """Add data from SVN data source to each package."""
        package_dir = os.path.join(self.temp_git_repo, package)
        before_files = self.list_files(package_dir)
        try:
            # Get references from external_data_source.txt
            refs = self.parse_external_refs(package_dir)
        except IOError, err:
            log.error("Error: No data : missing file %s, in package %s "
                      % (err.filename, package))
            return
        for ref in refs:
            # TODO: PATH ISSUE here.
            src = "/".join([self.svn_root, self.trunk,
                            self.data_store_path, package, ref])
            dest = "/".join([package_dir, ref])
            try:
                cmd = ['svn', 'export', '--username', 'readonly', '--password',
                       'readonly', '--non-interactive', src, dest]
                print "CMD to add data: ", cmd
                subprocess.check_call(cmd)
            except Exception as e:
                log.error("Error adding ref: %s, package: %s" % (ref, package))
                log.error(e)
        after_files = self.list_files(package_dir)
        # Add list of files newly added to object.
        self.lfs_files = list(set(after_files) - set(before_files))
        return

    def add_data_as_lfs(self, package):
        """Add data as git LFS."""
        package_dir = os.path.join(self.temp_git_repo, package)
        try:
            for item in self.lfs_files:
                # Add files
                git_add(item, cwd=package_dir)
                # Track all files using lfs
                git_lfs_track(item, cwd=package_dir)
            git_add(".gitattributes", cwd=package_dir)
            for item in self.lfs_files:
                git_add(item, cwd=package_dir)
        except Exception as e:
            log.error("Error in add data as LFS, package %s" % package)
            log.error(e)
        return

    def commit_data_to_lfs(self, package):
        """Commit data as LFS to server."""
        try:
            package_dir = os.path.join(self.temp_git_repo, package)
            git_commit(cwd=package_dir)
        except Exception as e:
            log.error("Error commit data to LFS in package %s" % package)
            log.error(e)
        return

    def run_lfs_transition(self, temp_git_repo):
        """Run LFS transition on all package."""
        for package in os.listdir(os.path.abspath(temp_git_repo)):
            try:
                if "bioc-data-experiment" not in package:
                    log.info("LFS: Add data to package %s" % package)
                    self.add_data(package)
                    log.info("LFS: Add data as LFS to package %s" % package)
                    self.add_data_as_lfs(package)
                    log.info("LFS: Commit data as LFS to package %s" % package)
                    self.commit_data_to_lfs(package)
            except Exception as e:
                log.error("LFS: Error in package %s: " % package)
                log.error(e)
                pass
        return
<file_sep>/svn_dump_update.py
"""Bioconductor update SVN dump code.

Author: <NAME>

Usage:
    `python svn_dump_update.py`
"""

from src.local_svn_dump import LocalSvnDump
import logging as log
import ConfigParser
log.basicConfig(filename='svn_dump_update.log',
                format='%(asctime)s %(message)s',
                level=log.DEBUG)
log.debug("Bioconductor SVN Dump Log File: \n")


def svn_root_update(configfile):
    """Dump update needs to be run as git."""
    Config = ConfigParser.ConfigParser()
    Config.read(configfile)

    temp_git_repo = Config.get('Software', 'temp_git_repo')
    svn_root = Config.get('SVN', 'svn_root')
    remote_svn_server = Config.get('SVN', 'remote_svn_server')
    users_db = Config.get('SVN', 'users_db')
    update_file = Config.get('SVN', 'update_file')
    package_path = Config.get('Software', 'package_path')

    for s in Config.sections():
        for k, v in Config.items(s):
            log.info("%s: %s" % (k, v))

    dump = LocalSvnDump(svn_root, temp_git_repo, users_db, remote_svn_server, package_path)
    dump.svn_get_revision()
    dump.svn_dump_update(update_file)
    dump.update_local_svn_dump(update_file)
    return


def svn_experiment_root_update(configfile):
    """Dump update needs to be run as git."""
    Config = ConfigParser.ConfigParser()
    Config.read(configfile)

    temp_git_repo = Config.get('ExperimentData', 'temp_git_repo')
    svn_root = Config.get('ExperimentData', 'svn_root')
    remote_svn_server = Config.get('ExperimentData', 'remote_svn_server')
    users_db = Config.get('SVN', 'users_db')
    update_file = Config.get('ExperimentData', 'update_file')
    package_path = Config.get('ExperimentData', 'package_path')

    for s in Config.sections():
        for k, v in Config.items(s):
            log.info("%s: %s" % (k, v))

    dump = LocalSvnDump(svn_root, temp_git_repo, users_db, remote_svn_server, package_path)
    dump.svn_get_revision()
    dump.svn_dump_update(update_file)
    dump.update_local_svn_dump(update_file)
    return

if __name__ == '__main__':
    svn_root_update("./settings.ini")
    svn_experiment_root_update("./settings.ini")
<file_sep>/src/git_edit_repository.py
#!/usr/bin/env python

"""Bioconductor Git repo user interaction script docstrings.

This module provides functions for working with the Bioconductor
`git` repository. This module gives the bioconductor core team,
to interact with the GIT server, and work with package authors.

Author: <NAME>

# TODO: This needs to be edited to fit new constraints.
"""
import os
import subprocess
from src.git_api.git_api import git_clone
from src.git_api.git_api import git_remote_add
from src.git_api.git_api import git_checkout
from local_svn_dump import Singleton
import logging as log


class GitEditRepository(object):
    """Git Edit repository."""
    __metaclass__ = Singleton

    def __init__(self, edit_repo, ssh_server):
        """Initialize Git edit repo."""
        self.edit_repo = edit_repo
        self.ssh_server = ssh_server
        return

    # TODO: deprecate
    def extract_development_url(self, package):
        """Extract `DevelopmentURL` from DESCRIPTION file."""
        description = os.path.join(package, 'DESCRIPTION')
        with open(description, 'r') as f:
            doc = f.read()
        doc_list = doc.split("\n")
        for i in xrange(len(doc_list)):
            if doc_list[i].startswith("DevelopmentURL:"):
                url = doc_list[i]
        url = url.replace("DevelopmentURL:", "")
        url = url.strip()
        return url

    # TODO: deprecate
    def set_edit_repo(self, package):
        """
        Clone a package from bioc_git_repo to make changes.

        Use this function to set up a clone of an existing bioconductor-git
        package, to make changes and push back to the git-server.
        """
        log.info("Set up a clone of package: %s, "
                 "to push changes to bare_git_repo" % package)
        repository = self.ssh_server + "/" + package
        git_clone(repository, self.edit_repo, bare=False)
        development_url = self.extract_development_url(os.path.join(self.edit_repo, package))
        git_remote_add('upstream', development_url,
                       cwd=os.path.join(self.edit_repo, package))
        return

    # TODO: deprecate
    def clone_all_edit_repo(self):
        """Clone all packages in git server.

        This clone of the entire git server is located on a seperate instance,
        where contents of the pacakges may be edited. After the modifications
        in the `edit_repo`, the contents can be pushed to the `bioc_git_repo`.
        """
        # TODO: get list of package from servers
        # get list of packages from manifest file.
        for package in os.listdir(self.bare_git_repo):
            self.set_edit_repo(package)
        return

    # TODO: deprecate
    def daily_fetch_branch(self, package, branch):
        """Daily fetch from github repo.

        ## git checkout branch-1
        ## git pull upstream branch-1:branch-1
        ## git push origin branch-1
        """
        path = os.path.join(self.edit_repo, package)
        git_checkout(branch, cwd=path, new=False)
        # Git pull into a branch of the edit_repp
        cmd = ['git', 'pull', '-Xtheirs', '--no-edit', 'upstream',
               branch + ":" + branch]
        p = subprocess.Popen(cmd, cwd=path, stdout=subprocess.PIPE,
                             stderr=subprocess.PIPE)
        out, err = p.communicate()
        if ("CONFLICT" in out):
            log.error("Merge conflict in the package: %s" % package)
            log.error(out)
        else:  # Git push
            cmd = ['git', 'push', 'origin', branch]
            subprocess.check_call(cmd, cwd=path)
        return

    # TODO: deprecate
    def daily_fetch(self, branch):
        """Daily fetch of every package in the edit_repo.

        Daily fetch  needs to be run by the build system on
        the branch being updated e.g `master` or `RELEASE_3_4`
        """
        for package in os.listdir(self.edit_repo):
            self.daily_fetch_branch(package, branch)
        return

    def version_bump(self, package, release=False):
        """Bump package version.

        release=False, assumes that version bump is not for a new
                       release branch.
        """
        description_file = os.path.join(self.edit_repo, package, 'DESCRIPTION')
        with open(description_file, 'r') as f:
            doc = f.read()
        doc_list = doc.split("\n")
        for i in xrange(len(doc_list)):
            if doc_list[i].startswith("Version:"):
                version = doc_list[i]
                index = i
        x, y, z = version.split("Version: ")[1].split(".")
        if release:
            # Special case
            if int(y) == 99:
                x = int(x) + 1
                y = 0
            else:
                y = int(y) + 1
            z = 0
        else:
            z = int(z) + 1
        version = str(x) + "." + str(y) + "." + str(z)
        doc_list[index] = "Version: " + version
        with open(description_file, "w") as f:
            f.write("\n".join(doc_list))
        log.info("Package: %s updated version to: %s" % (package, version))
        return

    # TODO: REMOVE commit_message and use the one in git_api
    def commit_message(self, msg, package):
        """Add a commit message to package during, bioc release."""
        cmd = ['git', 'commit', '-m', msg]
        subprocess.check_call(cmd, cwd=package)
        return

    def release_branch(self, package, new_release):
        """Create new release branch, make git call."""
        package_dir = os.path.join(self.edit_repo, package)
        # checkout master
        git_checkout(branch="master", cwd=package_dir, new=False)
        # on master, version bump, release = False
        self.version_bump(package, release=False)
        self.commit_message("bump x.y.z versions to even 'y' "
                            "prior to creation of " + new_release, package_dir)

        # IN THE BRANCH, version bump release=True
        git_checkout(branch=new_release, cwd=package_dir, new=True)
        self.version_bump(package, release=True)
        # commit messsage in branch
        self.commit_message(msg="Creating branch for BioC " + new_release,
                            package=package_dir)
        # checkout master
        git_checkout(branch="master", cwd=package_dir, new=False)
        # version bump release=True
        self.version_bump(package, release=True)
        # Commit message
        self.commit_message("bump x.y.z versions to odd 'y' "
                            "after creation of " + new_release, package_dir)
        log.info("New branch created for package %s" % package)
        return

    def create_new_release_branch(self, new_release):
        """Create a new RELEASE from master.

        This function is used to create a new release version,
        from the 'master' branch going forward.
        Usage: create_new_release_branch('RELEASE_3_7', '/packages/')
        """
        for package in os.listdir(os.path.abspath(self.edit_repo)):
            # Create a new release branch
            self.release_branch(new_release, package)
            # TODO: Push new release branch
            cmd = ['git', 'push', '-u', 'origin', new_release]
            subprocess.check_call(cmd, cwd=os.path.join(self.edit_repo, package))
        return
