~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/log.py

  • Committer: Martin Pool
  • Date: 2005-05-26 02:13:57 UTC
  • Revision ID: mbp@sourcefrog.net-20050526021357-9a56decdca0c174f
- All top-level classes inherit from object
  (Python new-style classes)

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
             verbose=False,
90
90
             show_ids=False,
91
91
             to_file=None,
92
 
             direction='reverse',
93
 
             start_revision=None,
94
 
             end_revision=None):
 
92
             direction='reverse'):
95
93
    """Write out human-readable log of commits to this branch.
96
94
 
97
95
    specific_fileid
115
113
    direction
116
114
        'reverse' (default) is latest to earliest;
117
115
        'forward' is earliest to latest.
118
 
 
119
 
    start_revision
120
 
        If not None, only show revisions >= start_revision
121
 
 
122
 
    end_revision
123
 
        If not None, only show revisions <= end_revision
124
116
    """
125
117
    from osutils import format_date
126
118
    from errors import BzrCheckError
148
140
        if specific_fileid:
149
141
            if not delta.touches_file_id(specific_fileid):
150
142
                continue
151
 
 
152
 
        if start_revision is not None and revno < start_revision:
153
 
            continue
154
 
 
155
 
        if end_revision is not None and revno > end_revision:
156
 
            continue
157
143
        
158
144
        if not verbose:
159
145
            # although we calculated it, throw it away without display
199
185
 
200
186
 
201
187
 
 
188
def junk():
 
189
    precursor = None
 
190
    if verbose:
 
191
        from tree import EmptyTree
 
192
        prev_tree = EmptyTree()
 
193
    for revno, revision_id in which_revs:
 
194
        precursor = revision_id
 
195
 
 
196
    if revision_id != rev.revision_id:
 
197
        raise BzrCheckError("retrieved wrong revision: %r"
 
198
                            % (revision_id, rev.revision_id))
 
199
 
 
200
    if verbose:
 
201
        this_tree = branch.revision_tree(revision_id)
 
202
        delta = compare_trees(prev_tree, this_tree, want_unchanged=False)
 
203
        prev_tree = this_tree
 
204
    else:
 
205
        delta = None    
 
206
 
 
207
 
202
208
 
203
209
def show_one_log(revno, rev, delta, show_ids, to_file, show_timezone):
204
210
    from osutils import format_date