~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Martin Pool
  • Date: 2005-07-16 00:07:40 UTC
  • mfrom: (909.1.5)
  • Revision ID: mbp@sourcefrog.net-20050716000740-f2dcb8894a23fd2d
- merge aaron's bugfix branch
  up to abentley@panoramicfeedback.com-20050715134354-78f2bca607acb415

Show diffs side-by-side

added added

removed removed

Lines of Context:
115
115
            if work_inv.has_id(file_id):
116
116
                del work_inv[file_id]
117
117
 
 
118
 
118
119
        if rev_id is None:
119
 
            rev_id = _gen_revision_id(branch, time.time())
 
120
            rev_id = _gen_revision_id(time.time())
120
121
        inv_id = rev_id
121
122
 
122
123
        inv_tmp = tempfile.TemporaryFile()
136
137
            timestamp = time.time()
137
138
 
138
139
        if committer == None:
139
 
            committer = username(branch)
 
140
            committer = username()
140
141
 
141
142
        if timezone == None:
142
143
            timezone = local_time_offset()
185
186
 
186
187
 
187
188
 
188
 
def _gen_revision_id(branch, when):
 
189
def _gen_revision_id(when):
189
190
    """Return new revision-id."""
190
191
    from binascii import hexlify
191
 
    from bzrlib.osutils import rand_bytes, compact_date, user_email
 
192
    from osutils import rand_bytes, compact_date, user_email
192
193
 
193
 
    s = '%s-%s-' % (user_email(branch), compact_date(when))
 
194
    s = '%s-%s-' % (user_email(), compact_date(when))
194
195
    s += hexlify(rand_bytes(8))
195
196
    return s
196
197
 
210
211
        working inventory.
211
212
    """
212
213
    from bzrlib.inventory import Inventory
213
 
    from bzrlib.osutils import isdir, isfile, sha_string, quotefn, \
 
214
    from osutils import isdir, isfile, sha_string, quotefn, \
214
215
         local_time_offset, username, kind_marker, is_inside_any
215
216
    
216
 
    from bzrlib.branch import gen_file_id
217
 
    from bzrlib.errors import BzrError
218
 
    from bzrlib.revision import Revision
 
217
    from branch import gen_file_id
 
218
    from errors import BzrError
 
219
    from revision import Revision
219
220
    from bzrlib.trace import mutter, note
220
221
 
221
222
    any_changes = False