~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Jelmer Vernooij
  • Date: 2009-06-09 00:59:51 UTC
  • mto: (4443.1.1 bzr.dev)
  • mto: This revision was merged to the branch mainline in revision 4444.
  • Revision ID: jelmer@samba.org-20090609005951-apv900cdk35o2ygh
Move squashing of XML-invalid characters to XMLSerializer.

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
 
373
367
                # Prompt the user for a commit message if none provided
374
368
                message = message_callback(self)
375
369
                self.message = message
376
 
                self._escape_commit_message()
377
370
 
378
371
                # Add revision data to the local branch
379
372
                self.rev_id = self.builder.commit(self.message)
602
595
        if self.master_locked:
603
596
            self.master_branch.unlock()
604
597
 
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
598
    def _gather_parents(self):
617
599
        """Record the parents of a merge for merge detection."""
618
600
        # TODO: Make sure that this list doesn't contain duplicate