/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

Fix indication of number of revisions pushed in dpush.

Show diffs side-by-side

added added

removed removed

Lines of Context:
539
539
            stop_revision = self.source.last_revision()
540
540
        # FIXME: Check for diverged branches
541
541
        def get_changed_refs(old_refs):
542
 
            result.old_revid = self.target.mapping.revision_id_foreign_to_bzr(old_refs.get("refs/heads/master", "0" * 40))
543
 
            refs = { "refs/heads/master": self.source.repository.lookup_bzr_revision_id(stop_revision)[0] }
 
542
            result.old_revid = self.target.mapping.revision_id_foreign_to_bzr(old_refs.get(self.target.ref, "0" * 40))
 
543
            refs = { self.target.ref: self.source.repository.lookup_bzr_revision_id(stop_revision)[0] }
544
544
            result.new_revid = stop_revision
545
545
            for name, sha in self.source.repository._git.refs.as_dict("refs/tags").iteritems():
546
546
                refs["refs/tags/%s" % name] = sha
624
624
        result = GitBranchPushResult()
625
625
        result.source_branch = self.source
626
626
        result.target_branch = self.target
627
 
        try:
628
 
            result.old_revid = self.target.last_revision()
629
 
        except NoSuchRef:
630
 
            result.old_revid = revision.NULL_REVISION
631
627
        if stop_revision is None:
632
628
            stop_revision = self.source.last_revision()
633
629
        # FIXME: Check for diverged branches
634
 
        refs = { "refs/heads/master": stop_revision }
 
630
        refs = { self.target.ref: stop_revision }
635
631
        for name, revid in self.source.tags.get_tag_dict().iteritems():
636
632
            if self.source.repository.has_revision(revid):
637
633
                refs["refs/tags/%s" % name] = revid
638
 
        revidmap, new_refs = self.target.repository.dfetch_refs(
 
634
        revidmap, old_refs, new_refs = self.target.repository.dfetch_refs(
639
635
            self.source.repository, refs)
640
 
        if revidmap != {}:
641
 
            self.target.generate_revision_history(revidmap[stop_revision])
642
 
            result.new_revid = revidmap[stop_revision]
643
 
        else:
644
 
            result.new_revid = result.old_revid
 
636
        result.old_revid = self.target.mapping.revision_id_foreign_to_bzr(
 
637
            old_refs.get(self.target.ref, "0" * 40))
 
638
        result.new_revid = self.target.mapping.revision_id_foreign_to_bzr(
 
639
            new_refs[self.target.ref])
645
640
        result.revidmap = revidmap
646
641
        return result
647
642