~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Martin Pool
  • Date: 2005-08-18 04:25:42 UTC
  • Revision ID: mbp@sourcefrog.net-20050818042542-6af9da978f695195
- check for email address in BRANCH_ROOT/.bzr/email, so you can 
  easily use different per-project personas

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
 
 
119
118
        if rev_id is None:
120
 
            rev_id = _gen_revision_id(time.time())
 
119
            rev_id = _gen_revision_id(branch, time.time())
121
120
        inv_id = rev_id
122
121
 
123
122
        inv_tmp = tempfile.TemporaryFile()
137
136
            timestamp = time.time()
138
137
 
139
138
        if committer == None:
140
 
            committer = username()
 
139
            committer = username(branch)
141
140
 
142
141
        if timezone == None:
143
142
            timezone = local_time_offset()
186
185
 
187
186
 
188
187
 
189
 
def _gen_revision_id(when):
 
188
def _gen_revision_id(branch, when):
190
189
    """Return new revision-id."""
191
190
    from binascii import hexlify
192
 
    from osutils import rand_bytes, compact_date, user_email
 
191
    from bzrlib.osutils import rand_bytes, compact_date, user_email
193
192
 
194
 
    s = '%s-%s-' % (user_email(), compact_date(when))
 
193
    s = '%s-%s-' % (user_email(branch), compact_date(when))
195
194
    s += hexlify(rand_bytes(8))
196
195
    return s
197
196