/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/walker/copy_out.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

38
38
                                                        that no longer exists in the repo
39
39
        """
40
40
 
41
 
        def __init__( self, walk_files = None ):
 
41
        def __init__( self, walk_files = None, quiet = False ):
42
42
                CopyBaseWalker.__init__( self )
43
43
                self.src_dir = the.repo.full_dir
44
44
                self.dst_dir = the.full_home_dir
46
46
                                                 self.generate_walk_list()
47
47
                self.check_dst_symlinks = True
48
48
                self.check_dst_ignores = True
49
 
 
50
 
 
51
 
        def print_op( self, rel_file, operation ):
52
 
                operation = re.sub( r'(.)(.)(.)', r'\3\2\1', operation )
53
 
                operation = re.sub( r'\>', r'<', operation )
54
 
                print "  %s %s" % ( operation, rel_file )
 
49
                self.quiet = quiet
 
50
 
 
51
 
 
52
        def print_op( self, rel_file, src, op, dst ):
 
53
 
 
54
                # report changes
 
55
                if not self.quiet and the.verbose < 2 and op == '*':
 
56
                        if dst == '_':
 
57
                                print " N  %s" % ( rel_file )
 
58
                        elif src == '_':
 
59
                                print " D  %s" % ( rel_file )
 
60
                        elif src == dst:
 
61
                                print " M  %s" % ( rel_file )
 
62
                        else:
 
63
                                print " K  %s" % ( rel_file )
 
64
 
 
65
                # verbose reporting
 
66
                if the.verbose >= 2:
 
67
                        if op == '*': op = '<'
 
68
                        print "  %s%s%s %s" % ( src, op, dst, rel_file )