/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: 2016-02-16 00:26:53 UTC
  • Revision ID: tim@ed.am-20160216002653-oa8dgponknyislg3
added home directory change reporting to CopyOutWalker; added --quiet option to
update, resolve, revert and init commands; replace use of re.match with
re.search for clarity (and fixed related bug in FileMatcher); added BzrVcs.run
command output when verbose >= 2

Show diffs side-by-side

added added

removed removed

41
41
                print "hostname, it is internally expanded to scp://HOSTNAME/~/.stdhome/REPO)."
42
42
                print
43
43
                print "Options:"
 
44
                print "      --quiet      do not report changes to the home directory"
44
45
                print "  -r, --repo=REPO  select the repo to check-out or create (defaults to 'home')"
45
46
                print "  -v, --verbose    display information about what is being done"
46
47
                print "      --help       display help and exit"
50
51
        def parse_command_line( self ):
51
52
                opts, args = getopt.gnu_getopt(
52
53
                        sys.argv[ 1: ], "r:v",
53
 
                        [ "repo=", "verbose", "help" ] )
 
54
                        [ "quiet", "repo=", "verbose", "help" ] )
54
55
                for opt, optarg in opts:
55
 
                        if opt in [ '--repo', '-r' ]:
56
 
                                if not re.match( '^[-a-zA-z0-9.]+$', optarg ):
 
56
                        if opt == "--quiet":
 
57
                                self.quiet = True
 
58
                        elif opt in [ '--repo', '-r' ]:
 
59
                                if not re.search( '^[-a-zA-z0-9.]+$', optarg ):
57
60
                                        raise the.program.FatalError(
58
61
                                                'invalid repository name: ' + optarg )
59
62
                                the.repo = optarg
84
87
                if self.url:
85
88
 
86
89
                        # expand url if it's a simple hostname
87
 
                        if re.match( '^[0-9a-zA-z.]+$', self.url ):
 
90
                        if re.search( '^[0-9a-zA-z.]+$', self.url ):
88
91
                                self.url = 'bzr+ssh://%s/%s/%s' % \
89
92
                                                   ( self.url, the.dir, the.repo.name )
90
93
 
120
123
                                        'there were conflicts...\n' + message )
121
124
 
122
125
                        # perform deployment
123
 
                        deployment.copy_out()
 
126
                        deployment.copy_out( self.quiet )
124
127
 
125
128
                else:
126
129