/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: 2009-08-25 22:28:19 UTC
  • mto: This revision was merged to the branch mainline in revision 4651.
  • Revision ID: robertc@robertcollins.net-20090825222819-j2goi0fgiuu894xu
Fix a couple of small bugs in the patch - use specific files with record_iter_changs, and the CLI shouldn't generate a filter of [] for commit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
209
209
        :param timestamp: if not None, seconds-since-epoch for a
210
210
            postdated/predated commit.
211
211
 
212
 
        :param specific_files: If true, commit only those files.
 
212
        :param specific_files: If not None, commit only those files. An empty
 
213
            list means 'commit no files'.
213
214
 
214
215
        :param rev_id: If set, use this as the new revision id.
215
216
            Useful for test or import commands that need to tightly
264
265
        self.master_locked = False
265
266
        self.recursive = recursive
266
267
        self.rev_id = None
 
268
        # self.specific_files is None to indicate no filter, or any iterable to
 
269
        # indicate a filter - [] means no files at all, as per iter_changes.
267
270
        if specific_files is not None:
268
271
            self.specific_files = sorted(
269
272
                minimum_path_selection(specific_files))
332
335
            self._gather_parents()
333
336
            # After a merge, a selected file commit is not supported.
334
337
            # See 'bzr help merge' for an explanation as to why.
335
 
            if len(self.parents) > 1 and self.specific_files:
 
338
            if len(self.parents) > 1 and self.specific_files is not None:
336
339
                raise errors.CannotCommitSelectedFileMerge(self.specific_files)
337
340
            # Excludes are a form of selected file commit.
338
341
            if len(self.parents) > 1 and self.exclude:
618
621
        """Update the commit builder with the data about what has changed.
619
622
        """
620
623
        exclude = self.exclude
621
 
        specific_files = self.specific_files or []
 
624
        specific_files = self.specific_files
622
625
        mutter("Selecting files for commit with filter %s", specific_files)
623
626
 
624
627
        self._check_strict()
625
628
        if self.use_record_iter_changes:
626
 
            iter_changes = self.work_tree.iter_changes(self.basis_tree)
 
629
            iter_changes = self.work_tree.iter_changes(self.basis_tree,
 
630
                specific_files=specific_files)
627
631
            iter_changes = self._filter_iter_changes(iter_changes)
628
632
            for file_id, path, fs_hash in self.builder.record_iter_changes(
629
633
                self.work_tree, self.basis_revid, iter_changes):