~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Jonathan Lange
  • Date: 2009-06-26 08:46:52 UTC
  • mto: (4484.1.1 bring-1.16.1-back)
  • mto: This revision was merged to the branch mainline in revision 4485.
  • Revision ID: jml@canonical.com-20090626084652-x7wn8yimd3fj0j0y
Tweak NEWS slightly based on mbp's feedback.

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
 
111
114
    def missing(self, path):
112
115
        pass
113
116
 
150
153
    def deleted(self, path):
151
154
        self._note('deleted %s', path)
152
155
 
 
156
    def escaped(self, escape_count, message):
 
157
        self._note("replaced %d control characters in message", escape_count)
 
158
 
153
159
    def missing(self, path):
154
160
        self._note('missing %s', path)
155
161
 
367
373
                # Prompt the user for a commit message if none provided
368
374
                message = message_callback(self)
369
375
                self.message = message
 
376
                self._escape_commit_message()
370
377
 
371
378
                # Add revision data to the local branch
372
379
                self.rev_id = self.builder.commit(self.message)
595
602
        if self.master_locked:
596
603
            self.master_branch.unlock()
597
604
 
 
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
 
598
616
    def _gather_parents(self):
599
617
        """Record the parents of a merge for merge detection."""
600
618
        # TODO: Make sure that this list doesn't contain duplicate