Changeset 580 in tailor


Ignore:
Timestamp:
08/15/05 18:55:56 (8 years ago)
Author:
lele@…
Hash name:
20050815165556-97f81-f58d1ed20c8af9e4f1c96fe528e2ab803c4c7732
Message:

Drop --bootstrap and --update options
Now tailor decides which step looking at the state file: if it exists,
then obviously the bootstrap is already done, and performs an update.
Otherwise, it bootstrap the new project.

Location:
vcpx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • vcpx/tailor.py

    r558 r580  
    104104        Changeset.REFILL_MESSAGE = not pconfig('dont-refill-changelogs') 
    105105 
    106         if options.bootstrap: 
     106        if not self.project.exists(): 
    107107            self.bootstrap() 
    108108        else: 
     
    135135 
    136136UPDATE_OPTIONS = [ 
    137     make_option("--update", action="store_true", default=True, 
    138                 help="Update the given repositories, fetching upstream " 
    139                      "changesets, applying and re-registering each one. " 
    140                      "This is the default behaviour."), 
    141137    make_option("-F", "--patch-name-format", metavar="FORMAT", 
    142138                help="Specify the prototype that will be used " 
     
    162158 
    163159BOOTSTRAP_OPTIONS = [ 
    164     make_option("-b", "--bootstrap", action="store_true", default=False, 
    165                 help="Bootstrap mode, that is the initial copy of the " 
    166                      "upstream tree, given as an URI (see -R) and maybe " 
    167                      "a revision (-r).  This overrides --update."), 
    168160    make_option("-s", "--source-kind", dest="source_kind", metavar="VC-KIND", 
    169161                help="Select the backend for the upstream source " 
     
    267259        defaults = {} 
    268260        for k,v in options.__dict__.items(): 
    269             if k not in ['interactive', 'bootstrap', 'configfile', 'migrate']: 
     261            if k not in ['interactive', 'configfile', 'migrate']: 
    270262                defaults[k.replace('_', '-')] = str(v) 
    271263 
     
    308300 
    309301            config.add_section(source) 
    310             if options.bootstrap and not options.source_repository: 
    311                 raise InvocationError('Need a source repository to bootstrap') 
    312  
    313302            config.set(source, 'repository', options.source_repository) 
    314303            if options.source_module: 
  • vcpx/project.py

    r575 r580  
    169169        return klass(repname, kind, self, which) 
    170170 
     171    def exists(self): 
     172        """ 
     173        Return True if the project exists, False otherwise. 
     174 
     175        Check for the existence of the state file to decide. 
     176        """ 
     177 
     178        from os.path import exists 
     179 
     180        return exists(self.state_file.filename) 
     181 
    171182    def workingDir(self): 
    172183        """ 
Note: See TracChangeset for help on using the changeset viewer.