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

Avoid use of deprecated get_apparent_author.

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
 
58
58
    """
59
59
 
60
 
    takes_args = ["src_location", "dest_location"]
 
60
    takes_args = ["src_location", "dest_location?"]
61
61
 
62
 
    def run(self, src_location, dest_location):
 
62
    def run(self, src_location, dest_location=None):
63
63
        from bzrlib.bzrdir import BzrDir, format_registry
64
 
        from bzrlib.errors import NoRepositoryPresent, NotBranchError
 
64
        from bzrlib.errors import (
 
65
            BzrCommandError,
 
66
            NoRepositoryPresent,
 
67
            NotBranchError,
 
68
            )
65
69
        from bzrlib.repository import Repository
 
70
        import os
 
71
        from bzrlib.plugins.git.repository import GitRepository
 
72
 
 
73
        if dest_location is None:
 
74
            dest_location = os.path.basename(src_location.rstrip("/\\"))
 
75
 
66
76
        source_repo = Repository.open(src_location)
 
77
        if not isinstance(source_repo, GitRepository):
 
78
            raise BzrCommandError("%r is not a git repository" % src_location)
67
79
        format = format_registry.make_bzrdir('rich-root-pack')
68
80
        try:
69
81
            target_bzrdir = BzrDir.open(dest_location)