Changeset 203 in tailor


Ignore:
Timestamp:
12/31/04 20:59:33 (8 years ago)
Author:
lele@…
Hash name:
20041231195933-97f81-2823ff9e18168999427fa6801227df4cfd0d1f47
Message:

Use darcs init+pull instead of get
Instead of a "darcs get" create a new repo with "darcs initialize" then
pull the patches from the master repository. This is a workaround to
"darcs get" not being able to extract the repository in the current (".")
directory.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vcpx/darcs.py

    r201 r203  
    201201 
    202202        from os.path import join, exists 
     203        from os import mkdir 
    203204         
    204205        wdir = join(basedir, subdir) 
    205206        if not exists(join(wdir, '_darcs')): 
    206             dget = SystemCommand(working_dir=basedir, 
    207                                  command="darcs get --partial --verbose" 
    208                                          " %(tag)s '%(repository)s' %(subdir)s" 
     207            if not exists(wdir): 
     208                mkdir(wdir) 
     209 
     210            c = SystemCommand(working_dir=wdir, command="darcs initialize") 
     211            c(output=True) 
     212 
     213            if c.exit_status: 
     214                raise TargetInitializationFailure( 
     215                    "'darcs initialize' returned status %s" % c.exit_status) 
     216             
     217            dpull = SystemCommand(working_dir=wdir, 
     218                                 command="darcs pull --all --verbose" 
     219                                         " %(tag)s '%(repository)s'" 
    209220                                         " 2>&1") 
    210221             
    211             output = dget(output=True, repository=repository, 
    212                           tag=revision<>'HEAD' and '--tag=%s'%repr(revision) or '', 
    213                           subdir=subdir) 
    214             if dget.exit_status: 
     222            output = dpull(output=True, repository=repository, 
     223                           tag=(revision<>'HEAD' and '--tag=%s'%repr(revision) 
     224                                or '')) 
     225            if dpull.exit_status: 
    215226                raise TargetInitializationFailure( 
    216                     "'darcs get' returned status %d saying \"%s\"" % 
    217                     (dget.exit_status, output.getvalue().strip())) 
     227                    "'darcs pull' returned status %d saying \"%s\"" % 
     228                    (dpull.exit_status, output.getvalue().strip())) 
    218229 
    219230        c = SystemCommand(working_dir=wdir, 
Note: See TracChangeset for help on using the changeset viewer.