Changeset 432 in tailor


Ignore:
Timestamp:
07/26/05 02:38:42 (8 years ago)
Author:
lele@…
Hash name:
20050726003842-97f81-c9f855d2bc58a0b814c3c8c35e3d18191e556636
Message:

Handle --revision=INITIAL also for Subversion

Location:
vcpx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • vcpx/svn.py

    r429 r432  
    239239         
    240240        from os.path import join, exists 
    241          
     241 
     242        if revision == 'INITIAL': 
     243            initial = True 
     244            cmd = [SVN_CMD, "log", "--verbose", "--xml", "--limit", "1", 
     245                   "--revision", "1:HEAD"] 
     246            svnlog = ExternalCommand(cwd=wdir, command=cmd) 
     247            output = svnlog.execute("%s%s" % (repository, module), stdout=PIPE) 
     248 
     249            if svnlog.exit_status: 
     250                raise ChangesetApplicationFailure( 
     251                    "%s returned status %d saying \"%s\"" % 
     252                    (str(changes), changes.exit_status, output.read())) 
     253 
     254            csets = changesets_from_svnlog(output, info['URL'], repository, 
     255                                           module) 
     256            revision = escape(csets[0].revision) 
     257        else: 
     258            initial = False 
     259 
    242260        wdir = join(basedir, subdir) 
    243  
    244261        if not exists(join(wdir, '.svn')): 
    245262            if logger: logger.info("checking out a working copy") 
     
    253270            if logger: logger.info("%s already exists, assuming it's a svn working dir" % wdir) 
    254271 
    255         info = self.__getSvnInfo(wdir) 
    256          
    257         cmd = [SVN_CMD, "log", "--verbose", "--xml", "--revision", revision] 
    258         svnlog = ExternalCommand(cwd=wdir, command=cmd) 
    259         output = svnlog.execute(stdout=PIPE) 
    260          
    261         if svnlog.exit_status: 
    262             raise ChangesetApplicationFailure( 
    263                 "%s returned status %d saying \"%s\"" % 
    264                 (str(changes), changes.exit_status, output.read())) 
    265          
    266         csets = changesets_from_svnlog(output, info['URL'], repository, module) 
    267          
     272        if not initial: 
     273            info = self.__getSvnInfo(wdir) 
     274 
     275            cmd = [SVN_CMD, "log", "--verbose", "--xml", "--revision", revision] 
     276            svnlog = ExternalCommand(cwd=wdir, command=cmd) 
     277            output = svnlog.execute(stdout=PIPE) 
     278 
     279            if svnlog.exit_status: 
     280                raise ChangesetApplicationFailure( 
     281                    "%s returned status %d saying \"%s\"" % 
     282                    (str(changes), changes.exit_status, output.read())) 
     283 
     284            csets = changesets_from_svnlog(output, info['URL'], repository, 
     285                                           module) 
     286 
    268287        last = csets[0] 
    269288         
  • vcpx/tailor.py

    r431 r432  
    529529                     "shortcut for the name of the first patch in the upstream " 
    530530                     "repository, otherwise it is interpreted as the name of " 
    531                      "a tag. " 
     531                     "a tag. Under Subversion, 'INITIAL' is the first patch " 
     532                     "that touches given repos/module, otherwise it must be " 
     533                     "an integer revision number. " 
    532534                     "'HEAD', the default, means the latest version in all " 
    533535                     "backends.", 
Note: See TracChangeset for help on using the changeset viewer.