~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/status.py

  • Committer: Martin Pool
  • Date: 2005-05-16 01:54:16 UTC
  • Revision ID: mbp@sourcefrog.net-20050516015416-fd816a5e09c0698b
- commit takes an optional caller-specified revision id

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
 
19
19
def show_status(branch, show_unchanged=False,
20
 
                file_list=None,
 
20
                specific_files=None,
21
21
                show_ids=False):
22
22
    """Display single-line status for non-ignored working files.
23
23
 
24
24
    show_all
25
25
        If true, show unmodified files too.
26
26
 
27
 
    file_list
 
27
    specific_files
28
28
        If set, only show the status of files in this list.
29
29
    """
30
30
    import sys
35
35
    old = branch.basis_tree()
36
36
    new = branch.working_tree()
37
37
 
38
 
    if file_list:
39
 
        raise NotImplementedError("sorry, status on selected files is not implemented "
40
 
                                  "at the moment")
41
 
 
42
 
    delta = diff.compare_trees(old, new, want_unchanged=show_unchanged)
 
38
    delta = diff.compare_trees(old, new, want_unchanged=show_unchanged,
 
39
                               specific_files=specific_files)
43
40
 
44
41
    delta.show(sys.stdout, show_ids=show_ids,
45
42
               show_unchanged=show_unchanged)
47
44
    unknowns = new.unknowns()
48
45
    done_header = False
49
46
    for path in unknowns:
 
47
        # FIXME: Should also match if the unknown file is within a
 
48
        # specified directory.
 
49
        if specific_files:
 
50
            if path not in specific_files:
 
51
                continue
50
52
        if not done_header:
51
 
            print 'unknown files:'
 
53
            print 'unknown:'
52
54
            done_header = True
53
55
        print ' ', path