~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge_directive.py

  • Committer: Vincent Ladeuil
  • Date: 2007-07-22 15:44:59 UTC
  • mto: This revision was merged to the branch mainline in revision 2646.
  • Revision ID: v.ladeuil+lp@free.fr-20070722154459-520ws2gnifghkpgy
From review comments, use a private scheme for testing.

* bzrlib/transport/__init__.py:
(_unregister_urlparse_netloc_protocol): New function.

* bzrlib/tests/transport_util.py:
(InstrumentedTransport.__init__): Use a dedicated scheme.
(TestCaseWithConnectionHookedTransport.setUp): Reworked to
register the new transport.
(TestCaseWithConnectionHookedTransport.get_url): Use our dedicated
scheme.
(TestCaseWithConnectionHookedTransport.install_hooks,
TestCaseWithConnectionHookedTransport.reset_hooks): Registering
transport is setUp job.

Show diffs side-by-side

added added

removed removed

Lines of Context:
190
190
                    StringIO(self.get_raw_bundle()))
191
191
                # We don't use the bundle's target revision, because
192
192
                # MergeDirective.revision_id is authoritative.
193
 
                info.install_revisions(target_repo, stream_input=False)
 
193
                info.install_revisions(target_repo)
194
194
            else:
195
195
                source_branch = _mod_branch.Branch.open(self.source_branch)
196
196
                target_repo.fetch(source_branch.repository, self.revision_id)
325
325
 
326
326
class MergeDirective2(_BaseMergeDirective):
327
327
 
328
 
    _format_string = 'Bazaar merge directive format 2 (Bazaar 0.90)'
 
328
    _format_string = 'Bazaar merge directive format 2 (Bazaar 0.19)'
329
329
 
330
330
    def __init__(self, revision_id, testament_sha1, time, timezone,
331
331
                 target_branch, patch=None, source_branch=None, message=None,
486
486
                                               self.base_revision_id)
487
487
        # Convert line-endings to UNIX
488
488
        stored_patch = re.sub('\r\n?', '\n', self.patch)
489
 
        calculated_patch = re.sub('\r\n?', '\n', calculated_patch)
490
489
        # Strip trailing whitespace
491
490
        calculated_patch = re.sub(' *\n', '\n', calculated_patch)
492
491
        stored_patch = re.sub(' *\n', '\n', stored_patch)
512
511
 
513
512
class MergeDirectiveFormatRegistry(registry.Registry):
514
513
 
515
 
    def register(self, directive, format_string=None):
516
 
        if format_string is None:
517
 
            format_string = directive._format_string
518
 
        registry.Registry.register(self, format_string, directive)
 
514
    def register(self, directive):
 
515
        registry.Registry.register(self, directive._format_string, directive)
519
516
 
520
517
 
521
518
_format_registry = MergeDirectiveFormatRegistry()
522
519
_format_registry.register(MergeDirective)
523
520
_format_registry.register(MergeDirective2)
524
 
_format_registry.register(MergeDirective2,
525
 
                          'Bazaar merge directive format 2 (Bazaar 0.19)')