~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/status.py

  • Committer: Martin Pool
  • Date: 2005-06-15 04:14:26 UTC
  • Revision ID: mbp@sourcefrog.net-20050615041426-6a94f75bc556be2f
- glob expand add arguments on win32
  patch from Roncaglia Julien

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,
23
 
                show_pending=True):
24
 
    """Display status for non-ignored working files.
 
21
                show_ids=False):
 
22
    """Display single-line status for non-ignored working files.
25
23
 
26
 
    show_unchanged
27
 
        If set, includes unchanged files.
 
24
    show_all
 
25
        If true, show unmodified files too.
28
26
 
29
27
    specific_files
30
28
        If set, only show the status of files in this list.
31
 
 
32
 
    show_ids
33
 
        If set, includes each file's id.
34
 
 
35
 
    to_file
36
 
        If set, write to this file (default stdout.)
37
 
 
38
 
    show_pending
39
 
        If set, write pending merges.
40
29
    """
41
30
    import sys
42
 
    from bzrlib.delta import compare_trees
43
 
 
44
 
    if to_file == None:
45
 
        to_file = sys.stdout
 
31
    from bzrlib.diff import compare_trees
46
32
    
47
33
    branch.lock_read()
48
34
    try:
53
39
        delta = compare_trees(old, new, want_unchanged=show_unchanged,
54
40
                              specific_files=specific_files)
55
41
 
56
 
        delta.show(to_file,
57
 
                   show_ids=show_ids,
 
42
        delta.show(sys.stdout, show_ids=show_ids,
58
43
                   show_unchanged=show_unchanged)
59
44
 
60
45
        unknowns = new.unknowns()
66
51
                if path not in specific_files:
67
52
                    continue
68
53
            if not done_header:
69
 
                print >>to_file, 'unknown:'
 
54
                print 'unknown:'
70
55
                done_header = True
71
 
            print >>to_file, ' ', path
72
 
        if show_pending and len(branch.pending_merges()) > 0:
73
 
            print >>to_file, 'pending merges:'
74
 
            for merge in branch.pending_merges():
75
 
                print >> to_file, ' ', merge
 
56
            print ' ', path
76
57
    finally:
77
58
        branch.unlock()
78
59