/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 breezy/git/dir.py

  • Committer: Gustav Hartvigsson
  • Date: 2021-01-11 20:19:38 UTC
  • mfrom: (7526.3.2 work)
  • Revision ID: gustav.hartvigsson@gmail.com-20210111201938-omr9wjz3qdgyxe8k
MergedĀ lp:brz

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
    RepositoryAcquisitionPolicy,
40
40
    )
41
41
 
 
42
from .mapping import (
 
43
    decode_git_path,
 
44
    encode_git_path,
 
45
    )
42
46
from .push import (
43
47
    GitPushResult,
44
48
    )
213
217
                        target, basis.get_reference_revision(path),
214
218
                        force_new_repo=force_new_repo, recurse=recurse,
215
219
                        stacked=stacked)
 
220
        if getattr(result_repo, '_git', None):
 
221
            # Don't leak resources:
 
222
            # TODO(jelmer): This shouldn't be git-specific, and possibly
 
223
            # just use read locks.
 
224
            result_repo._git.object_store.close()
216
225
        return result
217
226
 
218
227
    def clone_on_transport(self, transport, revision_id=None,
537
546
                    target_branch._format, self._format)
538
547
            # TODO(jelmer): Do some consistency checking across branches..
539
548
            self.control_transport.put_bytes(
540
 
                'commondir', target_path.encode('utf-8'))
 
549
                'commondir', encode_git_path(target_path))
541
550
            # TODO(jelmer): Urgh, avoid mucking about with internals.
542
551
            self._git._commontransport = (
543
552
                target_branch.repository._git._commontransport.clone())
577
586
                base_url = self.user_url.rstrip('/')
578
587
            else:
579
588
                base_url = urlutils.local_path_to_url(
580
 
                    commondir.decode(osutils._fs_enc)).rstrip('/.git/') + '/'
 
589
                    decode_git_path(commondir)).rstrip('/.git/') + '/'
581
590
            return urlutils.join_segment_parameters(base_url, params)
582
591
        return None
583
592