/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/stage_revert.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

28
28
class StageRevertCommand( Command ):
29
29
 
30
30
 
31
 
        def __init__( self ):
32
 
                self.repo = None
33
 
 
34
 
 
35
31
        def print_help( self ):
36
 
                print "Usage: " + the.program.name + " update [--repo=REPO]"
 
32
                print "Usage: " + the.program.name + " stage-revert [--repo=REPO]"
37
33
                print
38
34
                #      01234567890123456789012345678901234567890123456789012345678901234567890123456789
39
35
                print "Revert any modifications made to a local repository, losing those changes."
64
60
                                if not re.match( '^[-a-zA-z0-9.]+$', optarg ):
65
61
                                        raise the.program.FatalError(
66
62
                                                'invalid repository name: ' + optarg )
67
 
                                self.repo = optarg
 
63
                                the.repo = optarg
68
64
                        elif opt in [ '--verbose', '-v' ]:
69
65
                                the.verbose += 1
70
66
                        elif opt == "--help":
81
77
        def run( self ):
82
78
 
83
79
                # set up repo and check it exists
84
 
                the.set_repo( self.repo )
85
80
                the.repo.check_dir_exists()
86
81
 
87
82
                # initialise deployment