~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: aaron.bentley at utoronto
  • Date: 2005-08-27 04:42:41 UTC
  • mfrom: (1092.1.43)
  • mto: (1185.3.4)
  • mto: This revision was merged to the branch mainline in revision 1178.
  • Revision ID: aaron.bentley@utoronto.ca-20050827044241-23d676133b9fc981
Merge of robertc@robertcollins.net-20050826013321-52eee1f1da679ee9

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