Changeset 605 in tailor for vcpx/tailor.py


Ignore:
Timestamp:
08/17/05 01:03:55 (8 years ago)
Author:
lele@…
Hash name:
20050816230355-97f81-1865f5c897840bbe65feccaef7743165c42aa285
Message:

Inlined simple proxy methods

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vcpx/tailor.py

    r604 r605  
    3131    """ 
    3232 
    33     def prepareWorkingDirectory(self): 
    34         """ 
    35         Prepare the working directory before the bootstrap. 
    36         """ 
    37  
    38         dwd = self.workingDir() 
    39         dwd.prepareWorkingDirectory(self.source) 
    40  
    41     def checkoutUpstreamRevision(self): 
    42         """ 
    43         Checkout a working copy from the upstream repository and import 
    44         it in the target system. 
    45         """ 
    46  
    47         dwd = self.workingDir() 
    48         revision = self.config.get(self.name, 'start-revision', 'INITIAL') 
    49         actual = dwd.checkoutUpstreamRevision(revision) 
    50         dwd.initializeNewWorkingDir(self.source, actual, revision=='INITIAL') 
    51  
    5233    def _applyable(self, changeset): 
    5334        """ 
     
    6647    def _applied(self, changeset): 
    6748        """ 
    68         Save current status. 
     49        Separate changesets with an empty line. 
    6950        """ 
    7051 
     
    7253            print 
    7354 
    74     def applyPendingChangesets(self): 
    75         """ 
    76         Apply pending changesets, eventually fetching latest from upstream. 
    77         """ 
     55    def bootstrap(self): 
     56        """ 
     57        Bootstrap a new tailorized module. 
     58 
     59        First of all prepare the target system working directory such 
     60        that it can host the upstream source tree. This is backend 
     61        specific. 
     62 
     63        Then extract a copy of the upstream repository and import its 
     64        content into the target repository. 
     65        """ 
     66 
     67        self.log_info("Bootstrapping '%s'" % self.rootdir) 
     68 
     69        dwd = self.workingDir() 
     70        try: 
     71            dwd.prepareWorkingDirectory(self.source) 
     72        except: 
     73            self.log_error('Cannot prepare working directory!', True) 
     74            raise 
     75 
     76        revision = self.config.get(self.name, 'start-revision', 'INITIAL') 
     77        try: 
     78            actual = dwd.checkoutUpstreamRevision(revision) 
     79        except: 
     80            self.log_error("Checkout of '%s' failed!" % self.name, True) 
     81            raise 
     82 
     83        try: 
     84            dwd.initializeNewWorkingDir(self.source, actual, 
     85                                        revision=='INITIAL') 
     86        except: 
     87            self.log_error('Could not import checked out tree!', True) 
     88            raise 
     89 
     90        self.log_info("Bootstrap completed") 
     91 
     92    def update(self): 
     93        """ 
     94        Update an existing tailorized project. 
     95        """ 
     96 
     97        self.log_info("Updating '%s'" % self.name) 
    7898 
    7999        dwd = self.workingDir() 
     
    109129            self.log_info("Update completed with no upstream changes") 
    110130 
    111     def bootstrap(self): 
    112         """ 
    113         Bootstrap a new tailorized module. 
    114  
    115         First of all prepare the target system working directory such 
    116         that it can host the upstream source tree. This is backend 
    117         specific. 
    118  
    119         Then extract a copy of the upstream repository and import its 
    120         content into the target repository. 
    121         """ 
    122  
    123         self.log_info("Bootstrapping '%s'" % self.rootdir) 
    124  
    125         try: 
    126             self.prepareWorkingDirectory() 
    127         except: 
    128             self.log_error('Cannot prepare working directory!', True) 
    129             raise 
    130  
    131         try: 
    132             self.checkoutUpstreamRevision() 
    133         except: 
    134             self.log_error("Checkout of '%s' failed!" % 
    135                                    self.name, True) 
    136             raise 
    137  
    138         self.log_info("Bootstrap completed") 
    139  
    140     def update(self): 
    141         """ 
    142         Update an existing tailorized project. 
    143         """ 
    144  
    145         self.log_info("Updating '%s'" % self.name) 
    146  
    147         try: 
    148             self.applyPendingChangesets() 
    149         except: 
    150             self.log_error("Cannot update '%s'!" % self.name, 
    151                                    True) 
    152             raise 
    153  
    154         self.log_info("Update completed") 
    155  
    156131    def __call__(self): 
    157132        from shwrap import ExternalCommand 
     
    185160        else: 
    186161            self.update() 
     162 
    187163 
    188164GENERAL_OPTIONS = [ 
Note: See TracChangeset for help on using the changeset viewer.