/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/add.py

  • Committer: Tim Marston
  • Date: 2014-07-30 19:08:15 UTC
  • Revision ID: tim@ed.am-20140730190815-f3fs5cgtwb88jbvb
added checks to not die when information is missing in deployment

Show diffs side-by-side

added added

removed removed

53
53
                        [ "repo=", "verbose", "help" ] )
54
54
                for opt, optarg in opts:
55
55
                        if opt in [ '--repo', '-r' ]:
56
 
                                if not re.search( '^[-a-zA-z0-9.]+$', optarg ):
 
56
                                if not re.match( '^[-a-zA-z0-9.]+$', optarg ):
57
57
                                        raise the.program.FatalError(
58
58
                                                'invalid repository name: ' + optarg )
59
59
                                the.repo = optarg
 
60
                        elif opt in [ '--verbose', '-v' ]:
 
61
                                the.verbose += 1
60
62
                        elif opt == "--help":
61
63
                                self.print_help()
62
 
 
 
64
                
63
65
                # discard first argument (the command)
64
66
                args.pop( 0 )
65
67
 
87
89
                if the.repo.vcs.has_changes():
88
90
                        raise the.program.FatalError(
89
91
                                'repo has local changes: %s\n'
90
 
                                'Hint: see "%s stage-revert --help"' %
 
92
                                'Hint: see "%s stage-revert --help"' % 
91
93
                                ( the.repo.name, the.program.name ) )
92
94
 
93
95
                # check status