/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-05-22 16:45:54 UTC
  • Revision ID: tim@ed.am-20160522164554-n5qhuibvnv0z4tk1
added general reporting to CopyBase and configured it via copy-in and copy-out
walkers (it is required in copy in, during add command); added -R (recursive)
flass to add command; allow vcs backends to augment statically ignored files
list; added detection of out of date working copy to bzr backend;
generate_walk_list() now takes a mandatory directory as the first argument;
don't copy entire subtree during copy of missing directory (as this makes
assumptions about what's in the walk-list)

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, quiet = False ):
 
41
        def __init__( self, walk_files = None, report = True ):
42
42
                CopyBaseWalker.__init__( self )
43
43
                self.src_dir = the.repo.full_dir
44
44
                self.dst_dir = the.full_home_dir
45
45
                self.walk_list = walk_files if walk_files is not None else \
46
 
                                                 self.generate_walk_list()
 
46
                                                 self.generate_walk_list( the.repo.full_dir )
47
47
                self.check_dst_symlinks = True
48
48
                self.check_dst_ignores = True
49
 
                self.quiet = quiet
 
49
                self.report = report
50
50
 
51
51
 
52
52
        def print_op( self, rel_file, src, op, dst ):
53
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 )
 
54
                CopyBaseWalker.print_op( self, rel_file, src, op, dst )
64
55
 
65
56
                # verbose reporting
66
57
                if the.verbose >= 2: