/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 bzrlib/commit.py

  • Committer: Robert Collins
  • Date: 2008-02-13 03:30:01 UTC
  • mfrom: (3221 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3224.
  • Revision ID: robertc@robertcollins.net-20080213033001-rw70ul0zb02ph856
Merge to fix conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
from bzrlib.osutils import (kind_marker, isdir,isfile, is_inside_any,
72
72
                            is_inside_or_parent_of_any,
73
73
                            minimum_path_selection,
74
 
                            quotefn, sha_file, split_lines)
 
74
                            quotefn, sha_file, split_lines,
 
75
                            splitpath,
 
76
                            )
75
77
from bzrlib.testament import Testament
76
78
from bzrlib.trace import mutter, note, warning, is_quiet
77
79
from bzrlib.xml5 import serializer_v5
89
91
    """I report on progress of a commit."""
90
92
 
91
93
    def started(self, revno, revid, location=None):
 
94
        if location is None:
 
95
            symbol_versioning.warn("As of bzr 1.0 you must pass a location "
 
96
                                   "to started.", DeprecationWarning,
 
97
                                   stacklevel=2)
92
98
        pass
93
99
 
94
100
    def snapshot_change(self, change, path):
131
137
 
132
138
    def started(self, revno, rev_id, location=None):
133
139
        if location is not None:
134
 
            location = ' to "' + unescape_for_display(location, 'utf-8') + '"'
 
140
            location = ' to: ' + unescape_for_display(location, 'utf-8')
135
141
        else:
 
142
            # When started was added, location was only made optional by
 
143
            # accident.  Matt Nordhoff 20071129
 
144
            symbol_versioning.warn("As of bzr 1.0 you must pass a location "
 
145
                                   "to started.", DeprecationWarning,
 
146
                                   stacklevel=2)
136
147
            location = ''
137
 
        self._note('Committing revision %d%s.', revno, location)
 
148
        self._note('Committing%s', location)
138
149
 
139
150
    def completed(self, revno, rev_id):
140
151
        self._note('Committed revision %d.', revno)
370
381
            # Upload revision data to the master.
371
382
            # this will propagate merged revisions too if needed.
372
383
            if self.bound_branch:
373
 
                self._set_progress_stage("Uploading data to master branch")
374
 
                self.master_branch.repository.fetch(self.branch.repository,
375
 
                                                    revision_id=self.rev_id)
 
384
                if not self.master_branch.repository.has_same_location(
 
385
                        self.branch.repository):
 
386
                    self._set_progress_stage("Uploading data to master branch")
 
387
                    self.master_branch.repository.fetch(self.branch.repository,
 
388
                        revision_id=self.rev_id)
376
389
                # now the master has the revision data
377
390
                # 'commit' to the master first so a timeout here causes the
378
391
                # local branch to be out of date
694
707
               
695
708
        report_changes = self.reporter.is_verbose()
696
709
        deleted_ids = []
697
 
        deleted_paths = set()
 
710
        # A tree of paths that have been deleted. E.g. if foo/bar has been
 
711
        # deleted, then we have {'foo':{'bar':{}}}
 
712
        deleted_paths = {}
698
713
        # XXX: Note that entries may have the wrong kind because the entry does
699
714
        # not reflect the status on disk.
700
715
        work_inv = self.work_tree.inventory
708
723
            if kind == 'directory':
709
724
                self._next_progress_entry()
710
725
            # Skip files that have been deleted from the working tree.
711
 
            # The deleted files/directories are also recorded so they
712
 
            # can be explicitly unversioned later. Note that when a
713
 
            # filter of specific files is given, we must only skip/record
714
 
            # deleted files matching that filter.
715
 
            if is_inside_any(deleted_paths, path):
716
 
                continue
 
726
            # The deleted path ids are also recorded so they can be explicitly
 
727
            # unversioned later.
 
728
            if deleted_paths:
 
729
                path_segments = splitpath(path)
 
730
                deleted_dict = deleted_paths
 
731
                for segment in path_segments:
 
732
                    deleted_dict = deleted_dict.get(segment, None)
 
733
                    if not deleted_dict:
 
734
                        # We either took a path not present in the dict
 
735
                        # (deleted_dict was None), or we've reached an empty
 
736
                        # child dir in the dict, so are now a sub-path.
 
737
                        break
 
738
                else:
 
739
                    deleted_dict = None
 
740
                if deleted_dict is not None:
 
741
                    # the path has a deleted parent, do not add it.
 
742
                    continue
717
743
            content_summary = self.work_tree.path_content_summary(path)
 
744
            # Note that when a filter of specific files is given, we must only
 
745
            # skip/record deleted files matching that filter.
718
746
            if not specific_files or is_inside_any(specific_files, path):
719
747
                if content_summary[0] == 'missing':
720
 
                    deleted_paths.add(path)
 
748
                    if not deleted_paths:
 
749
                        # path won't have been split yet.
 
750
                        path_segments = splitpath(path)
 
751
                    deleted_dict = deleted_paths
 
752
                    for segment in path_segments:
 
753
                        deleted_dict = deleted_dict.setdefault(segment, {})
721
754
                    self.reporter.missing(path)
722
755
                    deleted_ids.append(file_id)
723
756
                    continue