[Notes] [Git][BuildStream/buildstream][master] 2 commits: Replacing string 'bzr' with value from host tools



Title: GitLab

Phillip Smyth pushed to branch master at BuildStream / buildstream

Commits:

1 changed file:

Changes:

  • tests/testutils/repo/bzr.py
    ... ... @@ -2,6 +2,7 @@ import os
    2 2
     import subprocess
    
    3 3
     import pytest
    
    4 4
     
    
    5
    +from buildstream import utils
    
    5 6
     from .repo import Repo
    
    6 7
     from ..site import HAVE_BZR
    
    7 8
     
    
    ... ... @@ -16,15 +17,16 @@ class Bzr(Repo):
    16 17
             if not HAVE_BZR:
    
    17 18
                 pytest.skip("bzr is not available")
    
    18 19
             super(Bzr, self).__init__(directory, subdir)
    
    20
    +        self.bzr = utils.get_host_tool('bzr')
    
    19 21
     
    
    20 22
         def create(self, directory):
    
    21 23
             branch_dir = os.path.join(self.repo, 'trunk')
    
    22 24
     
    
    23
    -        subprocess.call(['bzr', 'init-repo', self.repo], env=BZR_ENV)
    
    24
    -        subprocess.call(['bzr', 'init', branch_dir], env=BZR_ENV)
    
    25
    +        subprocess.call([self.bzr, 'init-repo', self.repo], env=BZR_ENV)
    
    26
    +        subprocess.call([self.bzr, 'init', branch_dir], env=BZR_ENV)
    
    25 27
             self.copy_directory(directory, branch_dir)
    
    26
    -        subprocess.call(['bzr', 'add', '.'], env=BZR_ENV, cwd=branch_dir)
    
    27
    -        subprocess.call(['bzr', 'commit', '--message="Initial commit"'],
    
    28
    +        subprocess.call([self.bzr, 'add', '.'], env=BZR_ENV, cwd=branch_dir)
    
    29
    +        subprocess.call([self.bzr, 'commit', '--message="Initial commit"'],
    
    28 30
                             env=BZR_ENV, cwd=branch_dir)
    
    29 31
     
    
    30 32
             return self.latest_commit()
    
    ... ... @@ -42,7 +44,7 @@ class Bzr(Repo):
    42 44
     
    
    43 45
         def latest_commit(self):
    
    44 46
             output = subprocess.check_output([
    
    45
    -            'bzr', 'version-info',
    
    47
    +            self.bzr, 'version-info',
    
    46 48
                 '--custom', '--template={revno}',
    
    47 49
                 os.path.join(self.repo, 'trunk')
    
    48 50
             ], env=BZR_ENV)
    



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