Exemplo n.º 1
0
def get_submodules():
    ret, err = gitcmd(["submodule", "status"])
    if err is not None:
        return None
    subs = []
    for l in ret.split("\n"):
        if l != "":
            s = l.split()
            if len(s) > 1:
                module_name = s[1]
                if not modules.is_module_excluded(module_name):
                    subs.append(module_name)
            else:
                print "Failed to get submodules, offending line is %r" % l
                return None
    return subs
Exemplo n.º 2
0
def get_submodules():
    ret, err = gitcmd(['submodule', 'status'])
    if err is not None:
        return None
    subs = []
    for l in ret.split('\n'):
        if l != "":
            s = l.split()
            if len(s) > 1:
                module_name = s[1]
                if not modules.is_module_excluded(module_name):
                    subs.append(module_name)
            else:
                print "Failed to get submodules, offending line is %r" % l
                return None
    return subs
Exemplo n.º 3
0
    def __call__(self, cmd, post_traversal=False, concurrent=False):
        for submodule in self.all_submodules(root_first=not post_traversal):
            with cd(submodule):
                if modules.is_module_excluded(submodule):
                    continue

                pool = ThreadPool(processes=4) if concurrent else None
                if callable(cmd):
                    if concurrent:
                        o = pool.apply_async(cmd).get()
                    else:
                        o = cmd()
                else:
                    if concurrent:
                        o = pool.apply_async(gitcmd, (cmd, False)).get()
                    else:
                        o = gitcmd(cmd, git=False)
            yield submodule, o
Exemplo n.º 4
0
    def __call__(self, cmd, post_traversal=False, concurrent=False):
        for submodule in self.all_submodules(root_first=not post_traversal):
            with cd(submodule):
                if modules.is_module_excluded(submodule):
                    continue

                pool = ThreadPool(processes=4) if concurrent else None
                if callable(cmd):
                    if concurrent:
                        o = pool.apply_async(cmd).get()
                    else:
                        o = cmd()
                else:
                    if concurrent:
                        o = pool.apply_async(gitcmd, (cmd, False)).get()
                    else:
                        o = gitcmd(cmd, git=False)
            yield submodule, o