~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Aaron Bentley
  • Date: 2005-08-25 13:10:25 UTC
  • mfrom: (974.1.38)
  • mto: (1092.1.42) (1185.3.4)
  • mto: This revision was merged to the branch mainline in revision 1178.
  • Revision ID: abentley@panoramicfeedback.com-20050825131025-2aa94bcbbd646a00
Fixed return value when not an ImmutableStore

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
        basis_inv = basis.inventory
86
86
 
87
87
        if verbose:
88
 
            # note('looking for changes...')
89
 
            # print 'looking for changes...'
90
 
            # disabled; should be done at a higher level
91
 
            pass
 
88
            note('looking for changes...')
92
89
 
93
90
        pending_merges = branch.pending_merges()
94
91
 
118
115
            if work_inv.has_id(file_id):
119
116
                del work_inv[file_id]
120
117
 
 
118
 
121
119
        if rev_id is None:
122
 
            rev_id = _gen_revision_id(branch, time.time())
 
120
            rev_id = _gen_revision_id(time.time())
123
121
        inv_id = rev_id
124
122
 
125
123
        inv_tmp = tempfile.TemporaryFile()
139
137
            timestamp = time.time()
140
138
 
141
139
        if committer == None:
142
 
            committer = username(branch)
 
140
            committer = username()
143
141
 
144
142
        if timezone == None:
145
143
            timezone = local_time_offset()
182
180
        branch.set_pending_merges([])
183
181
 
184
182
        if verbose:
185
 
            # disabled; should go through logging
186
 
            # note("commited r%d" % branch.revno())
187
 
            # print ("commited r%d" % branch.revno())
188
 
            pass
 
183
            note("commited r%d" % branch.revno())
189
184
    finally:
190
185
        branch.unlock()
191
186
 
192
187
 
193
188
 
194
 
def _gen_revision_id(branch, when):
 
189
def _gen_revision_id(when):
195
190
    """Return new revision-id."""
196
191
    from binascii import hexlify
197
 
    from bzrlib.osutils import rand_bytes, compact_date, user_email
 
192
    from osutils import rand_bytes, compact_date, user_email
198
193
 
199
 
    s = '%s-%s-' % (user_email(branch), compact_date(when))
 
194
    s = '%s-%s-' % (user_email(), compact_date(when))
200
195
    s += hexlify(rand_bytes(8))
201
196
    return s
202
197