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

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-11-16 18:59:44 UTC
  • mfrom: (7143.15.15 more-cleanups)
  • Revision ID: breezy.the.bot@gmail.com-20181116185944-biefv1sub37qfybm
Sprinkle some PEP8iness.

Merged from https://code.launchpad.net/~jelmer/brz/more-cleanups/+merge/358611

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
        self.verifiers = {}
71
71
 
72
72
    def __nonzero__(self):
73
 
        return bool(self.revision_id or self.properties or self.explicit_parent_ids)
 
73
        return bool(self.revision_id or self.properties or
 
74
                    self.explicit_parent_ids)
74
75
 
75
76
 
76
77
class TreeSupplement(object):
81
82
    """
82
83
 
83
84
 
84
 
 
85
85
def parse_roundtripping_metadata(text):
86
86
    """Parse Bazaar roundtripping metadata."""
87
87
    ret = CommitSupplement()
96
96
            ret.verifiers[b"testament3-sha1"] = value.strip()
97
97
        elif key.startswith(b"property-"):
98
98
            name = key[len(b"property-"):]
99
 
            if not name in ret.properties:
 
99
            if name not in ret.properties:
100
100
                ret.properties[name] = value[1:].rstrip(b"\n")
101
101
            else:
102
102
                ret.properties[name] += b"\n" + value[1:].rstrip(b"\n")
115
115
    if metadata.revision_id:
116
116
        lines.append(b"revision-id: %s\n" % metadata.revision_id)
117
117
    if metadata.explicit_parent_ids:
118
 
        lines.append(b"parent-ids: %s\n" % b" ".join(metadata.explicit_parent_ids))
 
118
        lines.append(b"parent-ids: %s\n" %
 
119
                     b" ".join(metadata.explicit_parent_ids))
119
120
    for key in sorted(metadata.properties.keys()):
120
121
        for l in metadata.properties[key].split(b"\n"):
121
122
            lines.append(b"property-%s: %s\n" % (key, osutils.safe_utf8(l)))