/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

  • Committer: Jelmer Vernooij
  • Date: 2009-09-10 13:13:15 UTC
  • mto: (0.200.602 trunk)
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@samba.org-20090910131315-6890xg58pl2jseml
Allow serving remote URLs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
        except NotBranchError:
76
76
            target_bzrdir = BzrDir.create(dest_location, format=format)
77
77
        try:
78
 
            target_repo = target_bzrdir.find_repository()
 
78
            target_repo = target_bzrdir.open_repository()
79
79
        except NoRepositoryPresent:
80
80
            target_repo = target_bzrdir.create_repository(shared=True)
81
81
 
85
85
        interrepo = InterRepository.get(source_repo, target_repo)
86
86
        mapping = source_repo.get_mapping()
87
87
        refs = interrepo.fetch_refs()
88
 
        tags = {}
89
 
        for k, v in extract_tags(refs).iteritems():
90
 
            tags[k] = mapping.revision_id_foreign_to_bzr(v)
 
88
        tags = extract_tags(refs, mapping)
91
89
        pb = ui.ui_factory.nested_progress_bar()
92
90
        try:
93
91
            for i, (name, ref) in enumerate(refs.iteritems()):
107
105
                except NotBranchError:
108
106
                    head_branch = head_bzrdir.create_branch()
109
107
                revid = mapping.revision_id_foreign_to_bzr(ref)
110
 
                source_branch = GitBranch(source_repo.bzrdir, source_repo,
 
108
                source_branch = GitBranch(source_repo.bzrdir, source_repo, 
111
109
                    name, None, tags)
112
110
                source_branch.head = ref
113
111
                if head_branch.last_revision() != revid:
119
117
 
120
118
class cmd_git_object(Command):
121
119
    """List or display Git objects by SHA.
122
 
 
 
120
    
123
121
    Cat a particular object's Git representation if a SHA is specified.
124
122
    List all available SHAs otherwise.
125
123
    """
128
126
 
129
127
    aliases = ["git-objects", "git-cat"]
130
128
    takes_args = ["sha1?"]
131
 
    takes_options = [Option('directory',
 
129
    takes_options = [Option('directory', 
132
130
        short_name='d',
133
131
        help='Location of repository.', type=unicode),
134
132
        Option('pretty', help='Pretty-print objects.')]