~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/status.py

  • Committer: Martin Pool
  • Date: 2005-06-28 05:33:40 UTC
  • Revision ID: mbp@sourcefrog.net-20050628053340-ea73b03fbcde9c46
- Remove XMLMixin class in favour of simple pack_xml, unpack_xml functions
  called as needed.  

- Avoid importing xml and ElementTree library unless needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
def show_status(branch, show_unchanged=False,
20
20
                specific_files=None,
21
 
                show_ids=False,
22
 
                to_file=None):
 
21
                show_ids=False):
23
22
    """Display single-line status for non-ignored working files.
24
23
 
25
24
    show_all
27
26
 
28
27
    specific_files
29
28
        If set, only show the status of files in this list.
30
 
 
31
 
    to_file
32
 
        If set, write to this file (default stdout.)
33
29
    """
34
30
    import sys
35
31
    from bzrlib.diff import compare_trees
36
 
 
37
 
    if to_file == None:
38
 
        to_file = sys.stdout
39
32
    
40
33
    branch.lock_read()
41
34
    try:
46
39
        delta = compare_trees(old, new, want_unchanged=show_unchanged,
47
40
                              specific_files=specific_files)
48
41
 
49
 
        delta.show(to_file,
50
 
                   show_ids=show_ids,
 
42
        delta.show(sys.stdout, show_ids=show_ids,
51
43
                   show_unchanged=show_unchanged)
52
44
 
53
45
        unknowns = new.unknowns()
59
51
                if path not in specific_files:
60
52
                    continue
61
53
            if not done_header:
62
 
                print >>to_file, 'unknown:'
 
54
                print 'unknown:'
63
55
                done_header = True
64
 
            print >>to_file, ' ', path
 
56
            print ' ', path
65
57
    finally:
66
58
        branch.unlock()
67
59