/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: 2018-04-02 00:52:27 UTC
  • mfrom: (6939 work)
  • mto: This revision was merged to the branch mainline in revision 7274.
  • Revision ID: jelmer@jelmer.uk-20180402005227-pecflp1mvdjrjqd6
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
                      splitpath,
71
71
                      )
72
72
from .trace import mutter, note, is_quiet
73
 
from .bzr.inventory import Inventory, InventoryEntry, make_entry
74
73
from .urlutils import unescape_for_display
75
74
from .i18n import gettext
76
75
 
90
89
        BzrError.__init__(self, files=files, files_str=files_str)
91
90
 
92
91
 
93
 
class ExcludesUnsupported(BzrError):
94
 
 
95
 
    _fmt = ('Excluding paths during commit is not supported by '
96
 
            'repository at %(repository)r.')
97
 
 
98
 
    def __init__(self, repository):
99
 
        BzrError.__init__(self, repository=repository)
100
 
 
101
 
 
102
92
def filter_excluded(iter_changes, exclude):
103
93
    """Filter exclude filenames.
104
94
 
221
211
            revprops = {}
222
212
        if possible_master_transports is None:
223
213
            possible_master_transports = []
224
 
        if not 'branch-nick' in revprops:
 
214
        if (not 'branch-nick' in revprops and
 
215
                branch.repository._format.supports_storing_branch_nick):
225
216
            revprops['branch-nick'] = branch._get_nick(
226
217
                local,
227
218
                possible_master_transports)
468
459
        # Make the working tree be up to date with the branch. This
469
460
        # includes automatic changes scheduled to be made to the tree, such
470
461
        # as updating its basis and unversioning paths that were missing.
471
 
        self.work_tree.unversion(self.deleted_ids)
 
462
        self.work_tree.unversion(self.deleted_paths)
472
463
        self._set_progress_stage("Updating the working tree")
473
464
        self.work_tree.update_basis_by_delta(self.rev_id,
474
465
             self.builder.get_basis_delta())
700
691
        """
701
692
        reporter = self.reporter
702
693
        report_changes = reporter.is_verbose()
703
 
        deleted_ids = []
 
694
        deleted_paths = []
704
695
        for change in iter_changes:
705
696
            if report_changes:
706
697
                old_path = change[1][0]
712
703
                # 'missing' path
713
704
                if report_changes:
714
705
                    reporter.missing(new_path)
715
 
                deleted_ids.append(change[0])
 
706
                deleted_paths.append(change[1][1])
716
707
                # Reset the new path (None) and new versioned flag (False)
717
708
                change = (change[0], (change[1][0], None), change[2],
718
709
                    (change[3][0], False)) + change[4:]
737
728
                            # repositories.
738
729
                            reporter.snapshot_change(gettext('modified'), new_path)
739
730
            self._next_progress_entry()
740
 
        # Unversion IDs that were found to be deleted
741
 
        self.deleted_ids = deleted_ids
 
731
        # Unversion files that were found to be deleted
 
732
        self.deleted_paths = deleted_paths
742
733
 
743
734
    def _check_strict(self):
744
735
        # XXX: when we use iter_changes this would likely be faster if
751
742
 
752
743
    def _commit_nested_tree(self, file_id, path):
753
744
        "Commit a nested tree."
754
 
        sub_tree = self.work_tree.get_nested_tree(file_id, path)
 
745
        sub_tree = self.work_tree.get_nested_tree(path, file_id)
755
746
        # FIXME: be more comprehensive here:
756
747
        # this works when both trees are in --trees repository,
757
748
        # but when both are bound to a different repository,
772
763
                strict=self.strict, verbose=self.verbose,
773
764
                local=self.local, reporter=self.reporter)
774
765
        except PointlessCommit:
775
 
            return self.work_tree.get_reference_revision(file_id)
 
766
            return self.work_tree.get_reference_revision(path, file_id)
776
767
 
777
768
    def _set_progress_stage(self, name, counter=False):
778
769
        """Set the progress stage and emit an update to the progress bar."""