def _get_branches_tags(self, new):
        try:
            from pychron.github import get_branches, get_tags

            bs = get_branches(new)

            remotes = [
                bi for bi in bs
                if bi.startswith('release') or bi in ('develop', 'master')
            ]

            localbranches = []
            if os.path.isdir(os.path.join(paths.build_repo, '.git')):
                repo = Repo(paths.build_repo)
                localbranches = [
                    b.name for b in repo.branches if b.name not in remotes
                ]

            if localbranches:
                remotes.append(LINE_STR)
                remotes.extend(localbranches)

            tags = [t for t in get_tags(new) if t.startswith('rc')]
            return remotes, tags

        except BaseException, e:
            import traceback
            traceback.print_exc()
            return [], []
Exemple #2
0
    def _get_branches(self, new):
        try:
            # cmd = 'https://api.github.com/repos/{}/branches'.format(new)
            # doc = urllib2.urlopen(cmd)
            # bs = [branch['name'] for branch in json.load(doc)]
            from pychron.github import get_branches

            bs = get_branches(new)
            from git import Repo
            from pychron.paths import paths

            remotes = [
                bi for bi in bs
                if bi.startswith('release') or bi in ('develop', 'master')
            ]

            localbranches = []
            if os.path.isdir(os.path.join(paths.build_repo, '.git')):
                repo = Repo(paths.build_repo)
                localbranches = [
                    b.name for b in repo.branches if b.name not in remotes
                ]

            remotes.extend(localbranches)
            return remotes

        except BaseException:
            return []
    def _get_branches(self, new):
        try:
            # cmd = 'https://api.github.com/repos/{}/branches'.format(new)
            # doc = urllib2.urlopen(cmd)
            # bs = [branch['name'] for branch in json.load(doc)]
            from pychron.github import get_branches

            bs = get_branches(new)
            from git import Repo
            from pychron.paths import paths

            remotes = [bi for bi in bs if bi.startswith('release') or bi in ('develop', 'master')]

            localbranches = []
            if os.path.isdir(os.path.join(paths.build_repo, '.git')):
                repo = Repo(paths.build_repo)
                localbranches = [b.name for b in repo.branches if b.name not in remotes]

            remotes.extend(localbranches)
            return remotes

        except BaseException:
            return []
Exemple #4
0
    def _get_branches_tags(self, new):
        try:
            from pychron.github import get_branches, get_tags

            bs = get_branches(new)

            remotes = [bi for bi in bs if bi.startswith('release') or bi in ('develop', 'master')]

            localbranches = []
            if os.path.isdir(os.path.join(paths.build_repo, '.git')):
                repo = Repo(paths.build_repo)
                localbranches = [b.name for b in repo.branches if b.name not in remotes]

            if localbranches:
                remotes.append(LINE_STR)
                remotes.extend(localbranches)

            tags = [t for t in get_tags(new) if t.startswith('rc')]
            return remotes, tags

        except BaseException, e:
            import traceback
            traceback.print_exc()
            return [], []