158
158
unescape_for_display(location, 'utf-8'))
160
160
def completed(self, revno, rev_id):
161
self._note(gettext('Committed revision %d.'), revno)
162
# self._note goes to the console too; so while we want to log the
163
# rev_id, we can't trivially only log it. (See bug 526425). Long
164
# term we should rearrange the reporting structure, but for now
165
# we just mutter seperately. We mutter the revid and revno together
166
# so that concurrent bzr invocations won't lead to confusion.
167
mutter('Committed revid %s as revno %d.', rev_id, revno)
161
if revno is not None:
162
self._note(gettext('Committed revision %d.'), revno)
163
# self._note goes to the console too; so while we want to log the
164
# rev_id, we can't trivially only log it. (See bug 526425). Long
165
# term we should rearrange the reporting structure, but for now
166
# we just mutter seperately. We mutter the revid and revno together
167
# so that concurrent bzr invocations won't lead to confusion.
168
mutter('Committed revid %s as revno %d.', rev_id, revno)
170
self._note(gettext('Committed revid %s.'), rev_id)
169
172
def deleted(self, path):
170
173
self._note(gettext('deleted %s'), path)
348
351
# Setup the bound branch variables as needed.
349
352
self._check_bound_branch(stack, possible_master_transports)
353
if self.config_stack is None:
354
self.config_stack = self.work_tree.get_config_stack()
351
356
# Check that the working tree is up to date
352
357
old_revno, old_revid, new_revno = self._check_out_of_date_tree()
356
361
self.reporter = reporter
357
362
elif self.reporter is None:
358
363
self.reporter = self._select_reporter()
359
if self.config_stack is None:
360
self.config_stack = self.work_tree.get_config_stack()
362
365
# Setup the progress bar. As the number of files that need to be
363
366
# committed in unknown, progress is reported as stages.
469
472
self.branch.fetch(self.master_branch, self.rev_id)
471
474
# and now do the commit locally.
475
if new_revno is None:
476
# Keep existing behaviour around ghosts
472
478
self.branch.set_last_revision_info(new_revno, self.rev_id)
561
567
# - in a checkout scenario the tree may have no
562
568
# parents but the branch may do.
563
569
first_tree_parent = breezy.revision.NULL_REVISION
565
old_revno, master_last = self.master_branch.last_revision_info()
566
except errors.UnsupportedOperation:
570
if (self.master_branch._format.stores_revno() or
571
self.config_stack.get('calculate_revnos')):
573
old_revno, master_last = self.master_branch.last_revision_info()
574
except errors.UnsupportedOperation:
575
master_last = self.master_branch.last_revision()
576
old_revno = self.branch.revision_id_to_revno(master_last)
567
578
master_last = self.master_branch.last_revision()
568
old_revno = self.branch.revision_id_to_revno(master_last)
569
580
if master_last != first_tree_parent:
570
581
if master_last != breezy.revision.NULL_REVISION:
571
582
raise errors.OutOfDateTree(self.work_tree)
572
if self.branch.repository.has_revision(first_tree_parent):
583
if (old_revno is not None and
584
self.branch.repository.has_revision(first_tree_parent)):
573
585
new_revno = old_revno + 1
575
587
# ghost parents never appear in revision history.
577
589
return old_revno, master_last, new_revno
579
591
def _process_pre_hooks(self, old_revno, new_revno):