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

  • Committer: Vincent Ladeuil
  • Date: 2010-07-07 11:21:19 UTC
  • mto: (5193.7.1 unify-confs)
  • mto: This revision was merged to the branch mainline in revision 5349.
  • Revision ID: v.ladeuil+lp@free.fr-20100707112119-jwyh312df41w6l0o
Revert previous change as I can't reproduce the related problem anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
375
375
            recurse = True
376
376
            try:
377
377
                bzrdir = BzrDir.open_from_transport(current_transport)
378
 
            except errors.NotBranchError:
 
378
            except (errors.NotBranchError, errors.PermissionDenied):
379
379
                pass
380
380
            else:
381
381
                recurse, value = evaluate(bzrdir)
382
382
                yield value
383
383
            try:
384
384
                subdirs = list_current(current_transport)
385
 
            except errors.NoSuchFile:
 
385
            except (errors.NoSuchFile, errors.PermissionDenied):
386
386
                continue
387
387
            if recurse:
388
388
                for subdir in sorted(subdirs, reverse=True):
394
394
        """
395
395
        try:
396
396
            return [self.open_branch()]
397
 
        except errors.NotBranchError:
 
397
        except (errors.NotBranchError, errors.NoRepositoryPresent):
398
398
            return []
399
399
 
400
400
    @staticmethod
1244
1244
        repository_policy = result.determine_repository_policy(
1245
1245
            force_new_repo, stacked_branch_url, require_stacking=stacked)
1246
1246
        result_repo, is_new_repo = repository_policy.acquire_repository()
1247
 
        if is_new_repo and revision_id is not None and not stacked:
 
1247
        is_stacked = stacked or (len(result_repo._fallback_repositories) != 0)
 
1248
        if is_new_repo and revision_id is not None and not is_stacked:
1248
1249
            fetch_spec = graph.PendingAncestryResult(
1249
1250
                [revision_id], source_repository)
1250
1251
        else:
1958
1959
            format_string = transport.get_bytes(".bzr/branch-format")
1959
1960
        except errors.NoSuchFile:
1960
1961
            raise errors.NotBranchError(path=transport.base)
1961
 
 
1962
1962
        try:
1963
1963
            return klass._formats[format_string]
1964
1964
        except KeyError:
2873
2873
            self.revisions[rev_id] = rev
2874
2874
 
2875
2875
    def _load_old_inventory(self, rev_id):
2876
 
        old_inv_xml = self.branch.repository.inventory_store.get(rev_id).read()
 
2876
        f = self.branch.repository.inventory_store.get(rev_id)
 
2877
        try:
 
2878
            old_inv_xml = f.read()
 
2879
        finally:
 
2880
            f.close()
2877
2881
        inv = xml4.serializer_v4.read_inventory_from_string(old_inv_xml)
2878
2882
        inv.revision_id = rev_id
2879
2883
        rev = self.revisions[rev_id]
2957
2961
                ie.revision = previous_ie.revision
2958
2962
                return
2959
2963
        if ie.has_text():
2960
 
            text = self.branch.repository._text_store.get(ie.text_id)
2961
 
            file_lines = text.readlines()
 
2964
            f = self.branch.repository._text_store.get(ie.text_id)
 
2965
            try:
 
2966
                file_lines = f.readlines()
 
2967
            finally:
 
2968
                f.close()
2962
2969
            w.add_lines(rev_id, previous_revisions, file_lines)
2963
2970
            self.text_count += 1
2964
2971
        else:
3245
3252
        # XXX: It's a bit ugly that the network name is here, because we'd
3246
3253
        # like to believe that format objects are stateless or at least
3247
3254
        # immutable,  However, we do at least avoid mutating the name after
3248
 
        # it's returned.  See <https://bugs.edge.launchpad.net/bzr/+bug/504102>
 
3255
        # it's returned.  See <https://bugs.launchpad.net/bzr/+bug/504102>
3249
3256
        self._network_name = None
3250
3257
 
3251
3258
    def __repr__(self):