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

29
29
        """
30
30
 
31
31
        @staticmethod
32
 
        def expand_files( files ):
 
32
        def expand_files( files, recurse = True ):
33
33
                """Returns a unique, sorted list of relative files, calculated from the list
34
34
                provided, which is made up from individual files and directories
35
35
                relative to the CWD (and which must be contained within the home
36
36
                directory, although the files need not actually exist in the home
37
 
                directory).  All files must exist in the repository.  Any directories
38
 
                are recursed in to so that their content is also returned.
 
37
                directory).  All files must exist in the repository.  Directories are
 
38
                recursed in to as required.
 
39
 
39
40
                """
40
41
 
41
 
                ret = list()
 
42
                ret = set()
42
43
                home_dir_prefix = os.path.realpath( the.full_home_dir ) + os.sep
43
44
 
44
45
                # iterate through file list
62
63
                                        'not managed by stdhome: %s' % rel_file )
63
64
 
64
65
                        # append the file or directory tree
65
 
                        ret.extend( Walker.generate_walk_list( rel_file ) )
 
66
                        ret.update( Walker.generate_walk_list(
 
67
                                the.repo.full_dir, rel_file, recurse ) )
66
68
 
67
69
                return sorted( set ( ret ) )