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

Clean up trailing whitespace.

Show diffs side-by-side

added added

removed removed

Lines of Context:
242
242
            t.ensure_base()
243
243
            format = self._get_checkout_format()
244
244
            checkout = format.initialize_on_transport(t)
245
 
            from_branch = branch.BranchReferenceFormat().initialize(checkout, 
 
245
            from_branch = branch.BranchReferenceFormat().initialize(checkout,
246
246
                self)
247
247
            tree = checkout.create_workingtree(revision_id,
248
248
                from_branch=from_branch, hardlink=hardlink)
251
251
            return self._create_heavyweight_checkout(to_location, revision_id,
252
252
            hardlink)
253
253
 
254
 
    def _create_heavyweight_checkout(self, to_location, revision_id=None, 
 
254
    def _create_heavyweight_checkout(self, to_location, revision_id=None,
255
255
                                     hardlink=False):
256
256
        """Create a new heavyweight checkout of this branch.
257
257
 
264
264
            to_location, force_new_tree=False, format=get_rich_root_format())
265
265
        checkout = checkout_branch.bzrdir
266
266
        checkout_branch.bind(self)
267
 
        # pull up to the specified revision_id to set the initial 
 
267
        # pull up to the specified revision_id to set the initial
268
268
        # branch tip correctly, and seed it with history.
269
269
        checkout_branch.pull(self, stop_revision=revision_id)
270
270
        return checkout.create_workingtree(revision_id, hardlink=hardlink)
322
322
            if self.old_revid == self.new_revid:
323
323
                to_file.write('No revisions to pull.\n')
324
324
            else:
325
 
                to_file.write('Now on revision %d (git sha: %s).\n' % 
 
325
                to_file.write('Now on revision %d (git sha: %s).\n' %
326
326
                        (self.new_revno, self.new_git_head))
327
327
        self._show_tag_conficts(to_file)
328
328
 
417
417
            graph = self.target.repository.get_graph(self.source.repository)
418
418
            result.old_revno, result.old_revid = \
419
419
                self.target.last_revision_info()
420
 
            self.update_revisions(stop_revision, overwrite=overwrite, 
 
420
            self.update_revisions(stop_revision, overwrite=overwrite,
421
421
                graph=graph)
422
422
            result.new_git_head = self._head
423
423
            result.tag_conflicts = self.source.tags.merge_to(self.target.tags,
442
442
        result.target_branch = self.target
443
443
        graph = self.target.repository.get_graph(self.source.repository)
444
444
        result.old_revno, result.old_revid = self.target.last_revision_info()
445
 
        self.update_revisions(stop_revision, overwrite=overwrite, 
446
 
            graph=graph)
 
445
        self.update_revisions(stop_revision, overwrite=overwrite, graph=graph)
447
446
        result.new_git_head = self._head
448
447
        result.tag_conflicts = self.source.tags.merge_to(self.target.tags,
449
448
            overwrite)
461
460
    @classmethod
462
461
    def is_compatible(self, source, target):
463
462
        from bzrlib.plugins.git.remote import RemoteGitBranch
464
 
        return (isinstance(source, LocalGitBranch) and 
 
463
        return (isinstance(source, LocalGitBranch) and
465
464
                isinstance(target, RemoteGitBranch))
466
465
 
467
466
    def _basic_push(self, overwrite=False, stop_revision=None):
478
477
            for name, sha in self.source.repository._git.refs.as_dict("refs/tags").iteritems():
479
478
                refs["refs/tags/%s" % name] = sha
480
479
            return refs
481
 
        self.target.repository.send_pack(get_changed_refs, 
 
480
        self.target.repository.send_pack(get_changed_refs,
482
481
                self.source.repository._git.object_store.generate_pack_contents)
483
482
        return result
484
483
 
489
488
    @classmethod
490
489
    def is_compatible(self, source, target):
491
490
        from bzrlib.plugins.git.remote import RemoteGitBranch
492
 
        return (isinstance(source, RemoteGitBranch) and 
 
491
        return (isinstance(source, RemoteGitBranch) and
493
492
                isinstance(target, LocalGitBranch))
494
493
 
495
494
    def _basic_push(self, overwrite=False, stop_revision=None):
509
508
            self.target.tags.set_tag(name, revid)
510
509
 
511
510
    def update_refs(self, stop_revision=None):
512
 
        interrepo = repository.InterRepository.get(self.source.repository, 
 
511
        interrepo = repository.InterRepository.get(self.source.repository,
513
512
            self.target.repository)
514
513
        if stop_revision is None:
515
514
            refs = interrepo.fetch_refs(branches=["HEAD"])
518
517
            refs = interrepo.fetch_refs(revision_id=stop_revision)
519
518
        return refs, stop_revision
520
519
 
521
 
    def pull(self, stop_revision=None, overwrite=False, 
 
520
    def pull(self, stop_revision=None, overwrite=False,
522
521
        possible_transports=None, local=False):
523
522
        # This type of branch can't be bound.
524
523
        if local:
533
532
        result.new_revid = self.target.last_revision()
534
533
        return result
535
534
 
536
 
    
 
535
 
537
536
class InterToGitBranch(branch.InterBranch):
538
537
    """InterBranch implementation that pulls from Git into bzr."""
539
538
 
543
542
 
544
543
    @classmethod
545
544
    def is_compatible(self, source, target):
546
 
        return (not isinstance(source, GitBranch) and 
 
545
        return (not isinstance(source, GitBranch) and
547
546
                isinstance(target, GitBranch))
548
547
 
549
548
    def update_revisions(self, *args, **kwargs):
550
549
        raise NoPushSupport()
551
550
 
552
 
    def push(self, overwrite=True, stop_revision=None, 
 
551
    def push(self, overwrite=True, stop_revision=None,
553
552
             _override_hook_source_branch=None):
554
553
        raise NoPushSupport()
555
554