~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Martin Pool
  • Date: 2005-08-22 16:31:16 UTC
  • Revision ID: mbp@sourcefrog.net-20050822163116-935a433f338e7d5b
- new shell-complete command to help zsh completion

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
 
19
21
def commit(branch, message,
20
22
           timestamp=None,
21
23
           timezone=None,
64
66
    from bzrlib.errors import BzrError, PointlessCommit
65
67
    from bzrlib.revision import Revision, RevisionReference
66
68
    from bzrlib.trace import mutter, note
67
 
    from bzrlib.xml import serializer_v4
 
69
    from bzrlib.xml import pack_xml
68
70
 
69
71
    branch.lock_write()
70
72
 
83
85
        basis_inv = basis.inventory
84
86
 
85
87
        if verbose:
86
 
            # note('looking for changes...')
87
 
            # print 'looking for changes...'
88
 
            # disabled; should be done at a higher level
89
 
            pass
 
88
            note('looking for changes...')
90
89
 
91
90
        pending_merges = branch.pending_merges()
92
91
 
121
120
        inv_id = rev_id
122
121
 
123
122
        inv_tmp = tempfile.TemporaryFile()
124
 
        
125
 
        serializer_v4.write_inventory(new_inv, inv_tmp)
 
123
        pack_xml(new_inv, inv_tmp)
126
124
        inv_tmp.seek(0)
127
125
        branch.inventory_store.add(inv_tmp, inv_id)
128
126
        mutter('new inventory_id is {%s}' % inv_id)
161
159
            rev.parents.append(RevisionReference(merge_rev))            
162
160
 
163
161
        rev_tmp = tempfile.TemporaryFile()
164
 
        serializer_v4.write_revision(rev, rev_tmp)
 
162
        pack_xml(rev, rev_tmp)
165
163
        rev_tmp.seek(0)
166
164
        branch.revision_store.add(rev_tmp, rev_id)
167
165
        mutter("new revision_id is {%s}" % rev_id)
181
179
        branch.set_pending_merges([])
182
180
 
183
181
        if verbose:
184
 
            # disabled; should go through logging
185
 
            # note("commited r%d" % branch.revno())
186
 
            # print ("commited r%d" % branch.revno())
187
 
            pass
 
182
            note("commited r%d" % branch.revno())
188
183
    finally:
189
184
        branch.unlock()
190
185