50
50
# TODO: Change the parameter 'rev_id' to 'revision_id' to be consistent with
51
51
# the rest of the code; add a deprecation of the old name.
60
from brzlib.branch import Branch
61
from brzlib.cleanup import OperationWithCleanups
63
from brzlib.errors import (BzrError, PointlessCommit,
60
from breezy.branch import Branch
61
from breezy.cleanup import OperationWithCleanups
63
from breezy.errors import (BzrError, PointlessCommit,
67
from brzlib.osutils import (get_user_encoding,
67
from breezy.osutils import (get_user_encoding,
69
69
minimum_path_selection,
72
from brzlib.trace import mutter, note, is_quiet
73
from brzlib.inventory import Inventory, InventoryEntry, make_entry
74
from brzlib import symbol_versioning
75
from brzlib.urlutils import unescape_for_display
76
from brzlib.i18n import gettext
72
from breezy.trace import mutter, note, is_quiet
73
from breezy.inventory import Inventory, InventoryEntry, make_entry
74
from breezy import symbol_versioning
75
from breezy.urlutils import unescape_for_display
76
from breezy.i18n import gettext
78
78
class NullCommitReporter(object):
79
79
"""I report on progress of a commit."""
583
583
# this is so that we still consider the master branch
584
584
# - in a checkout scenario the tree may have no
585
585
# parents but the branch may do.
586
first_tree_parent = brzlib.revision.NULL_REVISION
586
first_tree_parent = breezy.revision.NULL_REVISION
587
587
old_revno, master_last = self.master_branch.last_revision_info()
588
588
if master_last != first_tree_parent:
589
if master_last != brzlib.revision.NULL_REVISION:
589
if master_last != breezy.revision.NULL_REVISION:
590
590
raise errors.OutOfDateTree(self.work_tree)
591
591
if self.branch.repository.has_revision(first_tree_parent):
592
592
new_revno = old_revno + 1
613
613
for hook in hooks:
614
614
result = eval(hook + '(branch, rev_id)',
615
615
{'branch':self.branch,
617
617
'rev_id':self.rev_id})
618
618
# process new style post commit hooks
619
619
self._process_hooks("post_commit", old_revno, new_revno)
636
636
old_revid = self.parents[0]
638
old_revid = brzlib.revision.NULL_REVISION
638
old_revid = breezy.revision.NULL_REVISION
640
640
if hook_name == "pre_commit":
641
641
future_tree = self.builder.revision_tree()