diff --git a/bugwarrior/README.rst b/bugwarrior/README.rst index 062ea0f1f..e684c1673 100644 --- a/bugwarrior/README.rst +++ b/bugwarrior/README.rst @@ -96,6 +96,10 @@ Create a ``~/.bugwarriorrc`` file with the following contents. # two because they're spammy or something. exclude_repos = project_bar,project_baz + # Working with a large number of projects, instead of excluding most of them I + # can also simply include just a limited set. + include_repos = project_foo,project_foz + # Note that login and username can be different. I can login as me, but # scrape issues from an organization's repos. login = ralphbean diff --git a/bugwarrior/services/github.py b/bugwarrior/services/github.py index ca557ca12..a08d01515 100644 --- a/bugwarrior/services/github.py +++ b/bugwarrior/services/github.py @@ -22,6 +22,7 @@ def __init__(self, *args, **kw): self.auth = (login, password) self.exclude_repos = [] + self.include_repos = [] if self.config.has_option(self.target, 'exclude_repos'): self.exclude_repos = [ @@ -30,6 +31,13 @@ def __init__(self, *args, **kw): .strip().split(',') ] + if self.config.has_option(self.target, 'include_repos'): + self.include_repos = [ + item.strip() for item in + self.config.get(self.target, 'include_repos') + .strip().split(',') + ] + def _issues(self, tag): """ Grab all the issues """ return [ @@ -70,6 +78,12 @@ def filter_repos(self, repo): if repo['name'] in self.exclude_repos: return False + if self.include_repos: + if repo['name'] in self.include_repos: + return True + else: + return False + return True def issues(self):