Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/svn/svn.py
Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | def convert_commit_message(self, msg: Union[str, bytes]) -> bytes: | ||||
Returns: | Returns: | ||||
The transformed message as bytes. | The transformed message as bytes. | ||||
""" | """ | ||||
if isinstance(msg, bytes): | if isinstance(msg, bytes): | ||||
return msg | return msg | ||||
return msg.encode("utf-8") | return msg.encode("utf-8") | ||||
def convert_commit_date(self, date: str) -> TimestampWithTimezone: | def convert_commit_date(self, date: bytes) -> TimestampWithTimezone: | ||||
"""Convert the message commit date into a timestamp in swh format. | """Convert the message commit date into a timestamp in swh format. | ||||
The precision is kept. | The precision is kept. | ||||
Args: | Args: | ||||
date: the commit date to convert. | date: the commit date to convert. | ||||
Returns: | Returns: | ||||
The transformed date. | The transformed date. | ||||
▲ Show 20 Lines • Show All 177 Lines • Show Last 20 Lines |