/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/url_policy_open.py

  • Committer: Richard Wilbur
  • Date: 2016-02-04 19:07:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6618.
  • Revision ID: richard.wilbur@gmail.com-20160204190728-p0zvfii6zase0fw7
Update COPYING.txt from the original http://www.gnu.org/licenses/gpl-2.0.txt  (Only differences were in whitespace.)  Thanks to Petr Stodulka for pointing out the discrepancy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
import threading
22
22
 
23
 
from . import (
 
23
from bzrlib import (
24
24
    errors,
25
25
    urlutils,
26
26
    )
27
 
from .branch import Branch
28
 
from .controldir import (
 
27
from bzrlib.branch import Branch
 
28
from bzrlib.controldir import (
29
29
    ControlDir,
30
30
    )
31
31
 
212
212
 
213
213
        This is in a module-level function rather than performed at module
214
214
        level so that it can be called in setUp for testing `BranchOpener`
215
 
        as breezy.tests.TestCase.setUp clears hooks.
 
215
        as bzrlib.tests.TestCase.setUp clears hooks.
216
216
        """
217
217
        Branch.hooks.install_named_hook(
218
218
            'transform_fallback_location',
281
281
 
282
282
        This exists as a separate method only to be overriden in unit tests.
283
283
        """
284
 
        controldir = ControlDir.open(url, probers=self.probers)
285
 
        return controldir.get_branch_reference()
 
284
        bzrdir = ControlDir.open(url, probers=self.probers)
 
285
        return bzrdir.get_branch_reference()
286
286
 
287
287
    def open(self, url):
288
288
        """Open the Bazaar branch at url, first checking it.
290
290
        What is acceptable means is defined by the policy's `follow_reference` and
291
291
        `check_one_url` methods.
292
292
        """
293
 
        if not isinstance(url, str):
 
293
        if type(url) != str:
294
294
            raise TypeError
295
295
 
296
296
        url = self.check_and_follow_branch_reference(url)