/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-11-17 00:47:52 UTC
  • mfrom: (7182 work)
  • mto: This revision was merged to the branch mainline in revision 7305.
  • Revision ID: jelmer@jelmer.uk-20181117004752-6ywampe5pfywlby4
Merge trunk.

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
 
"""Push implementation that simply prints message saying push is not supported."""
 
17
"""Basic push implementation."""
18
18
 
19
19
from __future__ import absolute_import
20
20
 
25
25
    GitSmartRemoteNotSupported,
26
26
    )
27
27
 
 
28
 
28
29
class GitPushResult(PushResult):
29
30
 
30
31
    def _lookup_revno(self, revid):
31
32
        from .branch import _quick_lookup_revno
32
33
        try:
33
34
            return _quick_lookup_revno(self.source_branch, self.target_branch,
34
 
                revid)
 
35
                                       revid)
35
36
        except GitSmartRemoteNotSupported:
36
37
            return None
37
38
 
79
80
        tree = self._object_store.tree_cache.revision_tree(revid)
80
81
        rev = self.source.get_revision(revid)
81
82
        commit = None
82
 
        for path, obj in self._object_store._revision_to_objects(rev, tree, lossy):
 
83
        for path, obj in self._object_store._revision_to_objects(
 
84
                rev, tree, lossy):
83
85
            if obj.type_name == b"commit":
84
86
                commit = obj
85
87
            self._pending.append((obj, path))
86
88
        if commit is None:
87
89
            raise AssertionError("no commit object generated for revision %s" %
88
 
                revid)
 
90
                                 revid)
89
91
        return commit.id
90
92
 
91
93
    def __len__(self):