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

Some more test fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    revision as _mod_revision,
31
31
    )
32
32
 
33
 
try:
34
 
    from bzrlib.merge_directive import BaseMergeDirective
35
 
except ImportError:
36
 
    from bzrlib.merge_directive import (
37
 
        _BaseMergeDirective as BaseMergeDirective,
38
 
        )
 
33
from bzrlib.merge_directive import BaseMergeDirective
39
34
 
40
35
from bzrlib.plugins.git import (
41
36
    version_info as bzr_git_version_info,
114
109
 
115
110
    def __init__(self, revision_id, testament_sha1, time, timezone,
116
111
                 target_branch, source_branch=None, message=None,
117
 
                 patches=None):
 
112
                 patches=None, local_target_branch=None):
118
113
        super(GitMergeDirective, self).__init__(revision_id=revision_id,
119
114
            testament_sha1=testament_sha1, time=time, timezone=timezone,
120
115
            target_branch=target_branch, patch=None,
121
 
            source_branch=source_branch, message=message, bundle=None)
 
116
            source_branch=source_branch, message=message,
 
117
            bundle=None)
122
118
        self.patches = patches
123
119
 
124
120
    def to_lines(self):
131
127
    def _generate_commit(cls, repository, revision_id, num, total):
132
128
        s = StringIO()
133
129
        store = get_object_store(repository)
134
 
        commit = store[store._lookup_revision_sha1(revision_id)]
 
130
        store.lock_read()
 
131
        try:
 
132
            commit = store[store._lookup_revision_sha1(revision_id)]
 
133
        finally:
 
134
            store.unlock()
135
135
        from dulwich.patch import write_commit_patch, get_summary
136
136
        try:
137
137
            lhs_parent = repository.get_revision(revision_id).parent_ids[0]
171
171
            message=message, patches=patches)
172
172
 
173
173
 
174
 
def send_git(branch, revision_id, submit_branch, public_branch, no_patch,
175
 
             no_bundle, message, base_revision_id):
 
174
def send_git(branch, revision_id, submit_branch, public_branch, no_patch, no_bundle, message, base_revision_id, local_target_branch=None):
176
175
    if no_patch:
177
176
        raise errors.BzrCommandError("no patch not supported for git-am style patches")
178
177
    if no_bundle:
180
179
    return GitMergeDirective.from_objects(
181
180
        branch.repository, revision_id, time.time(),
182
181
        osutils.local_time_offset(), submit_branch,
183
 
        public_branch=public_branch, message=message)
 
182
        public_branch=public_branch, message=message,
 
183
        local_target_branch=local_target_branch)