~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: John Arbash Meinel
  • Date: 2009-07-29 21:35:05 UTC
  • mfrom: (4576 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4577.
  • Revision ID: john@arbash-meinel.com-20090729213505-tkqsvy1zfpocu75w
Merge bzr.dev 4576 in prep for NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
    def deleted(self, path):
109
109
        pass
110
110
 
111
 
    def escaped(self, escape_count, message):
112
 
        pass
113
 
 
114
111
    def missing(self, path):
115
112
        pass
116
113
 
153
150
    def deleted(self, path):
154
151
        self._note('deleted %s', path)
155
152
 
156
 
    def escaped(self, escape_count, message):
157
 
        self._note("replaced %d control characters in message", escape_count)
158
 
 
159
153
    def missing(self, path):
160
154
        self._note('missing %s', path)
161
155
 
210
204
        """Commit working copy as a new revision.
211
205
 
212
206
        :param message: the commit message (it or message_callback is required)
 
207
        :param message_callback: A callback: message = message_callback(cmt_obj)
213
208
 
214
209
        :param timestamp: if not None, seconds-since-epoch for a
215
210
            postdated/predated commit.
373
368
                # Prompt the user for a commit message if none provided
374
369
                message = message_callback(self)
375
370
                self.message = message
376
 
                self._escape_commit_message()
377
371
 
378
372
                # Add revision data to the local branch
379
373
                self.rev_id = self.builder.commit(self.message)
399
393
            # and now do the commit locally.
400
394
            self.branch.set_last_revision_info(new_revno, self.rev_id)
401
395
 
402
 
            # Make the working tree up to date with the branch
 
396
            # Make the working tree be up to date with the branch. This
 
397
            # includes automatic changes scheduled to be made to the tree, such
 
398
            # as updating its basis and unversioning paths that were missing.
 
399
            self.work_tree.unversion(self.deleted_ids)
403
400
            self._set_progress_stage("Updating the working tree")
404
401
            self.work_tree.update_basis_by_delta(self.rev_id,
405
402
                 self.builder.get_basis_delta())
602
599
        if self.master_locked:
603
600
            self.master_branch.unlock()
604
601
 
605
 
    def _escape_commit_message(self):
606
 
        """Replace xml-incompatible control characters."""
607
 
        # FIXME: RBC 20060419 this should be done by the revision
608
 
        # serialiser not by commit. Then we can also add an unescaper
609
 
        # in the deserializer and start roundtripping revision messages
610
 
        # precisely. See repository_implementations/test_repository.py
611
 
        self.message, escape_count = xml_serializer.escape_invalid_chars(
612
 
            self.message)
613
 
        if escape_count:
614
 
            self.reporter.escaped(escape_count, self.message)
615
 
 
616
602
    def _gather_parents(self):
617
603
        """Record the parents of a merge for merge detection."""
618
604
        # TODO: Make sure that this list doesn't contain duplicate
697
683
                            reporter.snapshot_change('modified', new_path)
698
684
            self._next_progress_entry()
699
685
        # Unversion IDs that were found to be deleted
700
 
        self.work_tree.unversion(deleted_ids)
 
686
        self.deleted_ids = deleted_ids
701
687
 
702
688
    def _record_unselected(self):
703
689
        # If specific files are selected, then all un-selected files must be
860
846
                content_summary)
861
847
 
862
848
        # Unversion IDs that were found to be deleted
863
 
        self.work_tree.unversion(deleted_ids)
 
849
        self.deleted_ids = deleted_ids
864
850
 
865
851
    def _commit_nested_tree(self, file_id, path):
866
852
        "Commit a nested tree."