~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge_directive.py

  • Committer: Alexander Belchenko
  • Date: 2012-03-29 08:34:13 UTC
  • mto: (6015.44.14 2.4)
  • mto: This revision was merged to the branch mainline in revision 6513.
  • Revision ID: bialix@ukr.net-20120329083413-d4bqqdtfn2yrxp4f
change st_dev, st_ino, st_uid, st_gid from int members to properties.

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
 
from __future__ import absolute_import
18
17
 
19
18
from StringIO import StringIO
20
19
import re
83
82
    multiple_output_files = False
84
83
 
85
84
    def __init__(self, revision_id, testament_sha1, time, timezone,
86
 
                 target_branch, patch=None, source_branch=None,
87
 
                 message=None, bundle=None):
 
85
                 target_branch, patch=None, source_branch=None, message=None,
 
86
                 bundle=None):
88
87
        """Constructor.
89
88
 
90
89
        :param revision_id: The revision to merge
92
91
            merge.
93
92
        :param time: The current POSIX timestamp time
94
93
        :param timezone: The timezone offset
95
 
        :param target_branch: Location of branch to apply the merge to
 
94
        :param target_branch: The branch to apply the merge to
96
95
        :param patch: The text of a diff or bundle
97
96
        :param source_branch: A public location to merge the revision from
98
97
        :param message: The message to use when committing this merge
166
165
        :param target_branch: The url of the branch to merge into
167
166
        :param patch_type: 'bundle', 'diff' or None, depending on the type of
168
167
            patch desired.
169
 
        :param local_target_branch: the submit branch, either itself or a local copy
170
 
        :param public_branch: location of a public branch containing
171
 
            the target revision.
 
168
        :param local_target_branch: a local copy of the target branch
 
169
        :param public_branch: location of a public branch containing the target
 
170
            revision.
172
171
        :param message: Message to use when committing the merge
173
172
        :return: The merge directive
174
173
 
182
181
        if revision_id == _mod_revision.NULL_REVISION:
183
182
            t_revision_id = None
184
183
        t = testament.StrictTestament3.from_revision(repository, t_revision_id)
185
 
        if local_target_branch is None:
186
 
            submit_branch = _mod_branch.Branch.open(target_branch)
187
 
        else:
188
 
            submit_branch = local_target_branch
 
184
        submit_branch = _mod_branch.Branch.open(target_branch)
189
185
        if submit_branch.get_public_branch() is not None:
190
186
            target_branch = submit_branch.get_public_branch()
191
187
        if patch_type is None:
248
244
        :param branch: The source branch, to get the signing strategy
249
245
        :return: a string
250
246
        """
251
 
        my_gpg = gpg.GPGStrategy(branch.get_config_stack())
 
247
        my_gpg = gpg.GPGStrategy(branch.get_config())
252
248
        return my_gpg.sign(''.join(self.to_lines()))
253
249
 
254
250
    def to_email(self, mail_to, branch, sign=False):
260
256
        :param sign: If True, gpg-sign the email
261
257
        :return: an email message
262
258
        """
263
 
        mail_from = branch.get_config_stack().get('email')
 
259
        mail_from = branch.get_config().username()
264
260
        if self.message is not None:
265
261
            subject = self.message
266
262
        else:
377
373
            merge.
378
374
        :param time: The current POSIX timestamp time
379
375
        :param timezone: The timezone offset
380
 
        :param target_branch: Location of the branch to apply the merge to
 
376
        :param target_branch: The branch to apply the merge to
381
377
        :param patch: The text of a diff or bundle
382
378
        :param patch_type: None, "diff" or "bundle", depending on the contents
383
379
            of patch
571
567
        :param target_branch: The url of the branch to merge into
572
568
        :param include_patch: If true, include a preview patch
573
569
        :param include_bundle: If true, include a bundle
574
 
        :param local_target_branch: the target branch, either itself or a local copy
575
 
        :param public_branch: location of a public branch containing
576
 
            the target revision.
 
570
        :param local_target_branch: a local copy of the target branch
 
571
        :param public_branch: location of a public branch containing the target
 
572
            revision.
577
573
        :param message: Message to use when committing the merge
578
574
        :return: The merge directive
579
575
 
592
588
                t_revision_id = None
593
589
            t = testament.StrictTestament3.from_revision(repository,
594
590
                t_revision_id)
595
 
            if local_target_branch is None:
596
 
                submit_branch = _mod_branch.Branch.open(target_branch)
597
 
            else:
598
 
                submit_branch = local_target_branch
 
591
            submit_branch = _mod_branch.Branch.open(target_branch)
599
592
            submit_branch.lock_read()
600
593
            locked.append(submit_branch)
601
594
            if submit_branch.get_public_branch() is not None: