~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Robert Collins
  • Date: 2005-10-14 01:59:24 UTC
  • mfrom: (1442.1.6)
  • Revision ID: robertc@lifelesslap.robertcollins.net-20051014015924-3149bd0ff5e56a90
merge current config support - classes split out

Show diffs side-by-side

added added

removed removed

Lines of Context:
190
190
        else:
191
191
            self.timestamp = long(timestamp)
192
192
            
 
193
        config = bzrlib.config.BranchConfig(self.branch)
193
194
        if rev_id is None:
194
 
            self.rev_id = _gen_revision_id(self.branch, self.timestamp)
 
195
            self.rev_id = _gen_revision_id(config, self.timestamp)
195
196
        else:
196
197
            self.rev_id = rev_id
197
198
 
198
199
        if committer is None:
199
 
            self.committer = bzrlib.config.username(self.branch)
 
200
            self.committer = config.username()
200
201
        else:
201
202
            assert isinstance(committer, basestring), type(committer)
202
203
            self.committer = committer
414
415
            if file_id not in self.new_inv:
415
416
                self.reporter.deleted(self.basis_inv.id2path(file_id))
416
417
 
417
 
def _gen_revision_id(branch, when):
 
418
def _gen_revision_id(config, when):
418
419
    """Return new revision-id."""
419
 
    s = '%s-%s-' % (bzrlib.config.user_email(branch), compact_date(when))
 
420
    s = '%s-%s-' % (config.user_email(), compact_date(when))
420
421
    s += hexlify(rand_bytes(8))
421
422
    return s