/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-03-09 01:57:23 UTC
  • Revision ID: tim@ed.am-20140309015723-kwd7kklc76jq0idr
reduced set of available commands to those implemented

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
 
31
35
        def print_help( self ):
32
 
                print "Usage: " + the.program.name + " stage-revert [--repo=REPO]"
 
36
                print "Usage: " + the.program.name + " update [--repo=REPO]"
33
37
                print
34
38
                #      01234567890123456789012345678901234567890123456789012345678901234567890123456789
35
39
                print "Revert any modifications made to a local repository, losing those changes."
60
64
                                if not re.match( '^[-a-zA-z0-9.]+$', optarg ):
61
65
                                        raise the.program.FatalError(
62
66
                                                'invalid repository name: ' + optarg )
63
 
                                the.repo = optarg
 
67
                                self.repo = optarg
64
68
                        elif opt in [ '--verbose', '-v' ]:
65
69
                                the.verbose += 1
66
70
                        elif opt == "--help":
77
81
        def run( self ):
78
82
 
79
83
                # set up repo and check it exists
 
84
                the.set_repo( self.repo )
80
85
                the.repo.check_dir_exists()
81
86
 
82
87
                # initialise deployment
86
91
                                "can't revert ongoing deployment: initial revno is missing!" )
87
92
 
88
93
                # check for local changes
89
 
                if the.verbose >= 1: print "reverting %s" % the.repo.dir
 
94
                if the.verbose: print "reverting %s" % the.repo.dir
90
95
                the.repo.vcs.revert( deployment.get_initial_revno() )
91
96
 
92
97
                # remove deployment state