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)
373
376
# Setup the bound branch variables as needed.
374
377
self._check_bound_branch(operation, possible_master_transports)
379
if self.config_stack is None:
380
self.config_stack = self.work_tree.get_config_stack()
376
382
# Check that the working tree is up to date
377
383
old_revno, old_revid, new_revno = self._check_out_of_date_tree()
381
387
self.reporter = reporter
382
388
elif self.reporter is None:
383
389
self.reporter = self._select_reporter()
384
if self.config_stack is None:
385
self.config_stack = self.work_tree.get_config_stack()
387
391
# Setup the progress bar. As the number of files that need to be
388
392
# committed in unknown, progress is reported as stages.
494
498
self.branch.fetch(self.master_branch, self.rev_id)
496
500
# and now do the commit locally.
501
if new_revno is None:
502
# Keep existing behaviour around ghosts
497
504
self.branch.set_last_revision_info(new_revno, self.rev_id)
587
594
# - in a checkout scenario the tree may have no
588
595
# parents but the branch may do.
589
596
first_tree_parent = breezy.revision.NULL_REVISION
591
old_revno, master_last = self.master_branch.last_revision_info()
592
except errors.UnsupportedOperation:
597
if (self.master_branch._format.stores_revno() or
598
self.config_stack.get('calculate_revnos')):
600
old_revno, master_last = self.master_branch.last_revision_info()
601
except errors.UnsupportedOperation:
602
master_last = self.master_branch.last_revision()
603
old_revno = self.branch.revision_id_to_revno(master_last)
593
605
master_last = self.master_branch.last_revision()
594
old_revno = self.branch.revision_id_to_revno(master_last)
595
607
if master_last != first_tree_parent:
596
608
if master_last != breezy.revision.NULL_REVISION:
597
609
raise errors.OutOfDateTree(self.work_tree)
598
if self.branch.repository.has_revision(first_tree_parent):
610
if (old_revno is not None and
611
self.branch.repository.has_revision(first_tree_parent)):
599
612
new_revno = old_revno + 1
601
614
# ghost parents never appear in revision history.
603
616
return old_revno, master_last, new_revno
605
618
def _process_pre_hooks(self, old_revno, new_revno):