~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

[merge] robert's integration branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
206
206
        self.allow_pointless = allow_pointless
207
207
        self.revprops = revprops
208
208
 
209
 
        if strict and branch.unknowns():
210
 
            raise StrictCommitFailed()
 
209
        if strict:
 
210
            # raise an exception as soon as we find a single unknown.
 
211
            for unknown in branch.unknowns():
 
212
                raise StrictCommitFailed()
211
213
 
212
214
        if timestamp is None:
213
215
            self.timestamp = time.time()
264
266
 
265
267
            self._record_inventory()
266
268
            self._make_revision()
 
269
            self.branch.append_revision(self.rev_id)
 
270
            self.work_tree.set_pending_merges([])
267
271
            self.reporter.completed(self.branch.revno()+1, self.rev_id)
268
 
            self.branch.append_revision(self.rev_id)
269
 
            self.branch.set_pending_merges([])
 
272
            if self.config.post_commit() is not None:
 
273
                hooks = self.config.post_commit().split(' ')
 
274
                # this would be nicer with twisted.python.reflect.namedAny
 
275
                for hook in hooks:
 
276
                    result = eval(hook + '(branch, rev_id)',
 
277
                                  {'branch':self.branch,
 
278
                                   'bzrlib':bzrlib,
 
279
                                   'rev_id':self.rev_id})
270
280
        finally:
271
281
            self.branch.unlock()
272
282
 
300
310
 
301
311
    def _gather_parents(self):
302
312
        """Record the parents of a merge for merge detection."""
303
 
        pending_merges = self.branch.pending_merges()
 
313
        pending_merges = self.work_tree.pending_merges()
304
314
        self.parents = []
305
315
        self.parent_invs = []
306
316
        self.present_parents = []
366
376
            deleted_ids.sort(reverse=True)
367
377
            for path, file_id in deleted_ids:
368
378
                del self.work_inv[file_id]
369
 
            self.branch._write_inventory(self.work_inv)
 
379
            self.work_tree._write_inventory(self.work_inv)
370
380
 
371
381
    def _store_snapshot(self):
372
382
        """Pass over inventory and record a snapshot.