Changeset 1211 in tailor


Ignore:
Timestamp:
07/03/06 01:29:16 (7 years ago)
Author:
ydirson@…
Hash name:
20060702232916-130f5-728038e54e0a59bb3567d8aa170610c2eaf370ff
Message:

[git] split git.py into source+target modules

This allows to get more accurate coverage stats. Eg. my test tree now
exercises the git backend like:

Name Stmts Exec Cover


vcpx/repository/git/init 44 37 84%
vcpx/repository/git/source 95 0 0%
vcpx/repository/git/target 154 115 74%
vcpx/target 249 173 69%

Location:
vcpx/repository/git
Files:
3 added
1 moved

Legend:

Unmodified
Added
Removed
  • vcpx/repository/git/target.py

    r1210 r1211  
    99 
    1010""" 
    11 This module implements the backend for Git using git-core. 
     11This module implements the target backend for Git using git-core. 
    1212""" 
    1313 
     
    1717from vcpx.shwrap import ExternalCommand, PIPE 
    1818from vcpx.config import ConfigurationError 
    19 from vcpx.source import UpdatableSourceWorkingDir, GetUpstreamChangesetsFailure 
    20 from vcpx.source import ChangesetApplicationFailure 
    2119from vcpx.target import SynchronizableTargetWorkingDir, TargetInitializationFailure 
    2220 
    2321from vcpx import TailorException 
     22 
     23from vcpx.repository.git import GitExternalCommand 
    2424 
    2525class BranchpointFailure(TailorException): 
     
    8383        """Execute the command, with controlled environment.""" 
    8484 
    85         from os import environ 
    86  
    87         env = environ.copy() 
    88         env.update(self.repo.env) 
    89  
    90         if kwargs.has_key('env'): 
    91             env.update(kwargs['env']) 
    92  
    93         kwargs['env'] = env 
     85        if not kwargs.has_key('env'): 
     86            kwargs['env'] = {} 
     87 
     88        kwargs['env'].update(self.repo.env) 
    9489 
    9590        return ExternalCommand.execute(self, *args, **kwargs) 
     
    230225        return self.repository._tryCommand(['rev-parse', '--verify', revision], GetUpstreamChangesetsFailure)[0] 
    231226 
    232     ## SynchronizableTargetWorkingDir 
     227class GitTargetWorkingDir(SynchronizableTargetWorkingDir): 
    233228 
    234229    def _addPathnames(self, names): 
Note: See TracChangeset for help on using the changeset viewer.