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

  • Committer: Jelmer Vernooij
  • Date: 2018-06-14 17:59:16 UTC
  • mto: This revision was merged to the branch mainline in revision 7065.
  • Revision ID: jelmer@jelmer.uk-20180614175916-a2e2xh5k533guq1x
Move breezy.plugins.git to breezy.git.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
"""Basic push implementation."""
 
17
"""Push implementation that simply prints message saying push is not supported."""
 
18
 
 
19
from __future__ import absolute_import
18
20
 
19
21
from ..push import (
20
22
    PushResult,
23
25
    GitSmartRemoteNotSupported,
24
26
    )
25
27
 
26
 
 
27
28
class GitPushResult(PushResult):
28
29
 
29
30
    def _lookup_revno(self, revid):
30
31
        from .branch import _quick_lookup_revno
31
32
        try:
32
33
            return _quick_lookup_revno(self.source_branch, self.target_branch,
33
 
                                       revid)
 
34
                revid)
34
35
        except GitSmartRemoteNotSupported:
35
36
            return None
36
37
 
78
79
        tree = self._object_store.tree_cache.revision_tree(revid)
79
80
        rev = self.source.get_revision(revid)
80
81
        commit = None
81
 
        for path, obj in self._object_store._revision_to_objects(
82
 
                rev, tree, lossy):
83
 
            if obj.type_name == b"commit":
 
82
        for path, obj in self._object_store._revision_to_objects(rev, tree, lossy):
 
83
            if obj.type_name == "commit":
84
84
                commit = obj
85
85
            self._pending.append((obj, path))
86
86
        if commit is None:
87
87
            raise AssertionError("no commit object generated for revision %s" %
88
 
                                 revid)
 
88
                revid)
89
89
        return commit.id
90
90
 
91
91
    def __len__(self):