/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/commit.py

  • Committer: Jelmer Vernooij
  • Date: 2019-07-07 17:22:07 UTC
  • mfrom: (7363 work)
  • mto: This revision was merged to the branch mainline in revision 7378.
  • Revision ID: jelmer@jelmer.uk-20190707172207-nnugeuwvxsxo62wa
merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
158
158
            unescape_for_display(location, 'utf-8'))
159
159
 
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)
 
169
        else:
 
170
            self._note(gettext('Committed revid %s.'), rev_id)
168
171
 
169
172
    def deleted(self, path):
170
173
        self._note(gettext('deleted %s'), path)
347
350
 
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()
350
355
 
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()
361
364
 
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)
470
473
 
471
474
            # and now do the commit locally.
 
475
            if new_revno is None:
 
476
                # Keep existing behaviour around ghosts
 
477
                new_revno = 1
472
478
            self.branch.set_last_revision_info(new_revno, self.rev_id)
473
479
        else:
474
480
            try:
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
564
 
        try:
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')):
 
572
            try:
 
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)
 
577
        else:
567
578
            master_last = self.master_branch.last_revision()
568
 
            old_revno = self.branch.revision_id_to_revno(master_last)
 
579
            old_revno = None
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
574
586
        else:
575
587
            # ghost parents never appear in revision history.
576
 
            new_revno = 1
 
588
            new_revno = None
577
589
        return old_revno, master_last, new_revno
578
590
 
579
591
    def _process_pre_hooks(self, old_revno, new_revno):