~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Aaron Bentley
  • Date: 2007-02-14 21:57:40 UTC
  • mfrom: (2286 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2288.
  • Revision ID: abentley@panoramicfeedback.com-20070214215740-qehopznuc8to99oy
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
    inventory,
62
62
    tree,
63
63
    )
 
64
from bzrlib.branch import Branch
64
65
import bzrlib.config
65
66
from bzrlib.errors import (BzrError, PointlessCommit,
66
67
                           ConflictsInTree,
332
333
            # now the work tree is up to date with the branch
333
334
            
334
335
            self.reporter.completed(self.branch.revno(), self.rev_id)
 
336
            # old style commit hooks - should be deprecated ? (obsoleted in
 
337
            # 0.15)
335
338
            if self.config.post_commit() is not None:
336
339
                hooks = self.config.post_commit().split(' ')
337
340
                # this would be nicer with twisted.python.reflect.namedAny
340
343
                                  {'branch':self.branch,
341
344
                                   'bzrlib':bzrlib,
342
345
                                   'rev_id':self.rev_id})
 
346
            # new style commit hooks:
 
347
            if not self.bound_branch:
 
348
                hook_master = self.branch
 
349
                hook_local = None
 
350
            else:
 
351
                hook_master = self.master_branch
 
352
                hook_local = self.branch
 
353
            new_revno = self.branch.revno()
 
354
            # With bound branches, when the master is behind the local branch,
 
355
            # the 'old_revno' and old_revid values here are incorrect.
 
356
            # XXX: FIXME ^. RBC 20060206
 
357
            old_revno = new_revno - 1
 
358
            if self.parents:
 
359
                old_revid = self.parents[0]
 
360
            else:
 
361
                old_revid = bzrlib.revision.NULL_REVISION
 
362
            for hook in Branch.hooks['post_commit']:
 
363
                hook(hook_local, hook_master, old_revno, old_revid, new_revno,
 
364
                    self.rev_id)
343
365
            self._emit_progress_update()
344
366
        finally:
345
367
            self._cleanup()