/stdhome

To get this branch, use:
bzr branch http://bzr.ed.am/stdhome

« back to all changes in this revision

Viewing changes to lib/stdhome/command/init.py

  • Committer: Tim Marston
  • Date: 2014-04-04 22:33:09 UTC
  • Revision ID: tim@ed.am-20140404223309-macifjzkiryg982n
read ~/.stdhomerc; commands set repo before run(); program performs late
initialisation of some variables; updated help

Show diffs side-by-side

added added

removed removed

23
23
from command import Command
24
24
import stdhome.the as the
25
25
from stdhome.deployment import Deployment
 
26
from stdhome.subprocess import Popen
26
27
 
27
28
 
28
29
class InitCommand( Command ):
68
69
                # URL argument
69
70
                self.url = args[ 0 ].strip() if len( args ) else None
70
71
 
71
 
                # check remaining arguments
 
72
                # remaining arguments
72
73
                if len( args ) > 1:
73
74
                        raise the.program.UsageError( 'too many arguments' )
74
75
 
87
88
 
88
89
                        # expand url if it's a simple hostname
89
90
                        if re.match( '^[0-9a-zA-z.]+$', self.url ):
90
 
                                self.url = 'bzr+ssh://%s/%s/%s' % \
 
91
                                self.url = 'sftp://%s/%s/%s' % \
91
92
                                                   ( self.url, the.dir, the.repo.name )
92
93
 
93
94
                        # initialise deployment (with an empty repo)
95
96
                        deployment.copy_in()
96
97
 
97
98
                        # perform bzr checkout
98
 
                        if the.verbose >= 1: print "checking out %s" % the.repo.dir
 
99
                        if the.verbose: print "checking out %s" % the.repo.dir
99
100
                        try:
100
101
                                the.repo.vcs.checkout( self.url )
101
102
                        except Exception as e:
117
118
                else:
118
119
 
119
120
                        # perform bzr init
120
 
                        if the.verbose >= 1: print 'initialising %s' % the.repo.dir
 
121
                        if the.verbose: print 'initialising %s' % the.repo.dir
121
122
                        try:
122
123
                                the.repo.vcs.init()
123
124
                        except Exception as e: