~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Martin Pool
  • Date: 2005-06-29 04:11:40 UTC
  • Revision ID: mbp@sourcefrog.net-20050629041140-6b17e65a23ffdf47
Merge John's log patch:

implements bzr log --forward --verbose
optimizes so that only logs to be printed are read (rather than reading
all and filtering out unwanted).

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
 
18
18
 
19
 
# FIXME: "bzr commit doc/format" commits doc/format.txt!
20
 
 
21
19
def commit(branch, message,
22
20
           timestamp=None,
23
21
           timezone=None,
83
81
        if verbose:
84
82
            note('looking for changes...')
85
83
 
86
 
        pending_merges = branch.pending_merges()
87
 
 
88
84
        missing_ids, new_inv = _gather_commit(branch,
89
85
                                              work_tree,
90
86
                                              work_inv,
143
139
                       inventory_sha1=inv_sha1,
144
140
                       revision_id=rev_id)
145
141
 
146
 
        rev.parents = []
147
142
        precursor_id = branch.last_patch()
148
143
        if precursor_id:
149
144
            precursor_sha1 = branch.get_revision_sha1(precursor_id)
150
 
            rev.parents.append(RevisionReference(precursor_id, precursor_sha1))
151
 
        for merge_rev in pending_merges:
152
 
            rev.parents.append(RevisionReference(merge_rev))            
 
145
            rev.parents = [RevisionReference(precursor_id, precursor_sha1)]
153
146
 
154
147
        rev_tmp = tempfile.TemporaryFile()
155
148
        pack_xml(rev, rev_tmp)
169
162
 
170
163
        branch.append_revision(rev_id)
171
164
 
172
 
        branch.set_pending_merges([])
173
 
 
174
165
        if verbose:
175
166
            note("commited r%d" % branch.revno())
176
167
    finally: