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

  • Committer: Jelmer Vernooij
  • Date: 2018-04-02 17:32:04 UTC
  • mto: (0.414.1 work)
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@jelmer.uk-20180402173204-8u16s4jwz3o39fql
Add support for the mergetag property in git.

Show diffs side-by-side

added added

removed removed

Lines of Context:
263
263
        :param verifiers: Verifiers info
264
264
        :return dulwich.objects.Commit represent the revision:
265
265
        """
266
 
        from dulwich.objects import Commit
 
266
        from dulwich.objects import Commit, Tag
267
267
        commit = Commit()
268
268
        commit.tree = tree_sha
269
269
        if not lossy:
335
335
                raise NoPushSupport()
336
336
        if type(commit.message) is not str:
337
337
            raise TypeError(commit.message)
 
338
        i = 0
 
339
        propname = 'git-mergetag-0'
 
340
        while propname in rev.properties:
 
341
            commit.mergetag.append(Tag.from_raw_string(rev.properties[propname]))
 
342
            i += 1
 
343
            propname = 'git-mergetag-%d' % i
338
344
        if 'git-extra' in rev.properties:
339
345
            commit.extra.extend([l.split(' ', 1) for l in rev.properties['git-extra'].splitlines()])
340
346
        return commit
388
394
        if commit.gpgsig:
389
395
            rev.properties['git-gpg-signature'] = commit.gpgsig.decode('ascii')
390
396
        if commit.mergetag:
391
 
            raise AssertionError('unable to import mergetag')
 
397
            for i, tag in enumerate(commit.mergetag):
 
398
                rev.properties['git-mergetag-%d' % i] = tag.as_raw_string()
392
399
        rev.timestamp = commit.commit_time
393
400
        rev.timezone = commit.commit_timezone
394
401
        rev.parent_ids = None