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

31
31
 
32
32
        def __init__( self ):
33
33
                self.all = False
 
34
                self.quiet = False
34
35
 
35
36
 
36
37
        def print_help( self ):
50
51
                print
51
52
                print "Options:"
52
53
                print "      --all        confirm that you want to revert all files"
 
54
                print "      --quiet      do not report changes to the home directory"
53
55
                print "  -r, --repo=REPO  select the repo to check-out or create (defaults to 'home')"
54
56
                print "  -v, --verbose    display information about what is being done"
55
57
                print "      --help       display help and exit"
59
61
        def parse_command_line( self ):
60
62
                opts, args = getopt.gnu_getopt(
61
63
                        sys.argv[ 1: ], "r:v",
62
 
                        [ "all", "repo=", "verbose", "help" ] )
 
64
                        [ "all", "quiet", "repo=", "verbose", "help" ] )
63
65
                for opt, optarg in opts:
64
66
                        if opt == "--all":
65
67
                                self.all = True
 
68
                        elif opt == "--quiet":
 
69
                                self.quiet = True
66
70
                        elif opt in [ '--repo', '-r' ]:
67
 
                                if not re.match( '^[-a-zA-z0-9.]+$', optarg ):
 
71
                                if not re.search( '^[-a-zA-z0-9.]+$', optarg ):
68
72
                                        raise the.program.FatalError(
69
73
                                                'invalid repository name: ' + optarg )
70
74
                                the.repo = optarg
106
110
                                ( the.repo.name, the.program.name ) )
107
111
 
108
112
                # check status
109
 
                walker = CopyOutWalker( files if files else None )
 
113
                walker = CopyOutWalker( files if files else None, self.quiet )
110
114
                walker.walk()