summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChandan Singh <csingh43@bloomberg.net>2018-12-20 17:45:29 +0000
committerbst-marge-bot <marge-bot@buildstream.build>2019-03-07 15:02:58 +0000
commitdd36cfb798166da050f52aa563ea726241b8a299 (patch)
treea02709857a88c3d13c51ea51a3c05ed35b497a83
parent5370740fc1eef6daf144831b148f13f883ebcd42 (diff)
downloadbuildstream-dd36cfb798166da050f52aa563ea726241b8a299.tar.gz
Expose _GitMirror as part of plugin author facing API
In !1019, we opened up the `_GitSourceBase()` class but forgot to expose the `GitMirror()` class that does most of the heavy lifting around handling the Git repository. So, add it to `__init__.py` as well, but not as a public API.
-rw-r--r--buildstream/__init__.py2
-rw-r--r--buildstream/_gitsourcebase.py10
2 files changed, 6 insertions, 6 deletions
diff --git a/buildstream/__init__.py b/buildstream/__init__.py
index f9a662df1..62890a62f 100644
--- a/buildstream/__init__.py
+++ b/buildstream/__init__.py
@@ -38,4 +38,4 @@ if "_BST_COMPLETION" not in os.environ:
# XXX We are exposing a private member here as we expect it to move to a
# separate package soon. See the following discussion for more details:
# https://gitlab.com/BuildStream/buildstream/issues/739#note_124819869
- from ._gitsourcebase import _GitSourceBase
+ from ._gitsourcebase import _GitSourceBase, _GitMirror
diff --git a/buildstream/_gitsourcebase.py b/buildstream/_gitsourcebase.py
index c0913409c..ade5f3c0a 100644
--- a/buildstream/_gitsourcebase.py
+++ b/buildstream/_gitsourcebase.py
@@ -42,11 +42,11 @@ WARN_UNLISTED_SUBMODULE = "unlisted-submodule"
WARN_INVALID_SUBMODULE = "invalid-submodule"
-# Because of handling of submodules, we maintain a GitMirror
+# Because of handling of submodules, we maintain a _GitMirror
# for the primary git source and also for each submodule it
# might have at a given time
#
-class GitMirror(SourceFetcher):
+class _GitMirror(SourceFetcher):
def __init__(self, source, path, url, ref, *, primary=False, tags=[]):
@@ -386,7 +386,7 @@ class _GitSourceBase(Source):
self.track_tags = self.node_get_member(node, bool, 'track-tags', False)
self.original_url = self.node_get_member(node, str, 'url')
- self.mirror = GitMirror(self, '', self.original_url, ref, tags=tags, primary=True)
+ self.mirror = _GitMirror(self, '', self.original_url, ref, tags=tags, primary=True)
self.tracking = self.node_get_member(node, str, 'track', None)
self.ref_format = self.node_get_member(node, str, 'ref-format', 'sha1')
@@ -629,7 +629,7 @@ class _GitSourceBase(Source):
return True
- # Refreshes the GitMirror objects for submodules
+ # Refreshes the _GitMirror objects for submodules
#
# Assumes that we have our mirror and we have the ref which we point to
#
@@ -651,7 +651,7 @@ class _GitSourceBase(Source):
ref = self.mirror.submodule_ref(path)
if ref is not None:
- mirror = GitMirror(self, path, url, ref)
+ mirror = _GitMirror(self, path, url, ref)
submodules.append(mirror)
self.submodules = submodules