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

  • Committer: Gustav Hartvigsson
  • Date: 2021-01-09 21:36:27 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20210109213627-h1xwcutzy9m7a99b
Added 'Case Preserving Working Tree Use Cases' from Canonical Wiki

* Addod a page from the Canonical Bazaar wiki
  with information on the scmeatics of case
  perserving filesystems an a case insensitive
  filesystem works.
  
  * Needs re-work, but this will do as it is the
    same inforamoton as what was on the linked
    page in the currint documentation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
            )
88
88
        from ..errors import (
89
89
            BzrError,
90
 
            BzrCommandError,
 
90
            CommandError,
91
91
            NoRepositoryPresent,
92
92
            NotBranchError,
93
93
            )
115
115
 
116
116
        source_repo = Repository.open(src_location)
117
117
        if not isinstance(source_repo, GitRepository):
118
 
            raise BzrCommandError(
 
118
            raise CommandError(
119
119
                gettext("%r is not a git repository") % src_location)
120
120
        try:
121
121
            target_controldir = ControlDir.open_from_transport(dest_transport)
128
128
            target_repo = target_controldir.create_repository(shared=True)
129
129
 
130
130
        if not target_repo.supports_rich_root():
131
 
            raise BzrCommandError(
 
131
            raise CommandError(
132
132
                gettext("Target repository doesn't support rich roots"))
133
133
 
134
134
        interrepo = InterRepository.get(source_repo, target_repo)
187
187
    @display_command
188
188
    def run(self, sha1=None, directory=".", pretty=False):
189
189
        from ..errors import (
190
 
            BzrCommandError,
 
190
            CommandError,
191
191
            )
192
192
        from ..controldir import (
193
193
            ControlDir,
204
204
                try:
205
205
                    obj = object_store[sha1.encode('ascii')]
206
206
                except KeyError:
207
 
                    raise BzrCommandError(
 
207
                    raise CommandError(
208
208
                        gettext("Object not found: %s") % sha1)
209
209
                if pretty:
210
210
                    text = obj.as_pretty_string()
304
304
    def run(self, target, package, directory='.'):
305
305
        from ..branch import Branch
306
306
        from ..errors import (
307
 
            BzrCommandError,
 
307
            CommandError,
308
308
            NoSuchRevision,
309
309
            )
310
310
        from ..trace import warning
311
311
        from ..repository import Repository
 
312
        from .mapping import encode_git_path
312
313
        from .object_store import get_object_store
313
314
        from .pristine_tar import (
314
315
            revision_pristine_tar_data,
318
319
        target_bzr = Repository.open(target)
319
320
        target = getattr(target_bzr, '_git', None)
320
321
        if target is None:
321
 
            raise BzrCommandError("Target not a git repository")
 
322
            raise CommandError("Target not a git repository")
322
323
        git_store = get_object_store(source.repository)
323
324
        with git_store.lock_read():
324
325
            tag_dict = source.tags.get_tag_dict()
345
346
                    warning(
346
347
                        "base git id %s for %s missing in target repository",
347
348
                        gitid, filename)
348
 
                store_git_pristine_tar_data(target, filename.encode('utf-8'),
 
349
                store_git_pristine_tar_data(target, encode_git_path(filename),
349
350
                                            delta, gitid)