[Notes] [Git][BuildStream/buildstream][chandan/base-git-mirror] Expose _GitMirror as part of plugin author facing API



Title: GitLab

Chandan Singh pushed to branch chandan/base-git-mirror at BuildStream / buildstream

Commits:

2 changed files:

Changes:

  • buildstream/__init__.py
    ... ... @@ -38,4 +38,4 @@ if "_BST_COMPLETION" not in os.environ:
    38 38
         # XXX We are exposing a private member here as we expect it to move to a
    
    39 39
         # separate package soon. See the following discussion for more details:
    
    40 40
         # https://gitlab.com/BuildStream/buildstream/issues/739#note_124819869
    
    41
    -    from ._gitsourcebase import _GitSourceBase
    41
    +    from ._gitsourcebase import _GitSourceBase, _GitMirror

  • buildstream/_gitsourcebase.py
    ... ... @@ -42,11 +42,11 @@ WARN_UNLISTED_SUBMODULE = "unlisted-submodule"
    42 42
     WARN_INVALID_SUBMODULE = "invalid-submodule"
    
    43 43
     
    
    44 44
     
    
    45
    -# Because of handling of submodules, we maintain a GitMirror
    
    45
    +# Because of handling of submodules, we maintain a _GitMirror
    
    46 46
     # for the primary git source and also for each submodule it
    
    47 47
     # might have at a given time
    
    48 48
     #
    
    49
    -class GitMirror(SourceFetcher):
    
    49
    +class _GitMirror(SourceFetcher):
    
    50 50
     
    
    51 51
         def __init__(self, source, path, url, ref, *, primary=False, tags=[]):
    
    52 52
     
    
    ... ... @@ -379,7 +379,7 @@ class _GitSourceBase(Source):
    379 379
             self.track_tags = self.node_get_member(node, bool, 'track-tags', False)
    
    380 380
     
    
    381 381
             self.original_url = self.node_get_member(node, str, 'url')
    
    382
    -        self.mirror = GitMirror(self, '', self.original_url, ref, tags=tags, primary=True)
    
    382
    +        self.mirror = _GitMirror(self, '', self.original_url, ref, tags=tags, primary=True)
    
    383 383
             self.tracking = self.node_get_member(node, str, 'track', None)
    
    384 384
     
    
    385 385
             self.ref_format = self.node_get_member(node, str, 'ref-format', 'sha1')
    
    ... ... @@ -622,7 +622,7 @@ class _GitSourceBase(Source):
    622 622
     
    
    623 623
             return True
    
    624 624
     
    
    625
    -    # Refreshes the GitMirror objects for submodules
    
    625
    +    # Refreshes the _GitMirror objects for submodules
    
    626 626
         #
    
    627 627
         # Assumes that we have our mirror and we have the ref which we point to
    
    628 628
         #
    
    ... ... @@ -644,7 +644,7 @@ class _GitSourceBase(Source):
    644 644
     
    
    645 645
                 ref = self.mirror.submodule_ref(path)
    
    646 646
                 if ref is not None:
    
    647
    -                mirror = GitMirror(self, path, url, ref)
    
    647
    +                mirror = _GitMirror(self, path, url, ref)
    
    648 648
                     submodules.append(mirror)
    
    649 649
     
    
    650 650
             self.submodules = submodules
    



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]