Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7124080
D676.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
7 KB
Subscribers
None
D676.diff
View Options
diff --git a/swh/storage/in_memory.py b/swh/storage/in_memory.py
--- a/swh/storage/in_memory.py
+++ b/swh/storage/in_memory.py
@@ -290,33 +290,27 @@
"""Add revisions to the storage
Args:
- revisions (iterable): iterable of dictionaries representing the
- individual revisions to add. Each dict has the following keys:
+ revisions (Iterable[dict]): iterable of dictionaries representing
+ the individual revisions to add. Each dict has the following
+ keys:
- id (sha1_git): id of the revision to add
- - date (datetime.DateTime): date the revision was written
- - date_offset (int): offset from UTC in minutes the revision
- was written
- - date_neg_utc_offset (boolean): whether a null date_offset
- represents a negative UTC offset
- - committer_date (datetime.DateTime): date the revision got
+ - date (dict): date the revision was written
+ - committer_date (dict): date the revision got
added to the origin
- - committer_date_offset (int): offset from UTC in minutes the
- revision was added to the origin
- - committer_date_neg_utc_offset (boolean): whether a null
- committer_date_offset represents a negative UTC offset
- type (one of 'git', 'tar'): type of the revision added
- directory (sha1_git): the directory the revision points at
- message (bytes): the message associated with the revision
- - author_name (bytes): the name of the revision author
- - author_email (bytes): the email of the revision author
- - committer_name (bytes): the name of the revision committer
- - committer_email (bytes): the email of the revision committer
+ - author (Dict[str, bytes]): dictionary with keys:
+ name, fullname, email
+ - committer (Dict[str, bytes]): dictionary with keys:
+ name, fullname, email
- metadata (jsonb): extra information as dictionary
- synthetic (bool): revision's nature (tarball, directory
creates synthetic revision)
- parents (list of sha1_git): the parents of this revision
+ date dictionaries have the form defined in :mod:`swh.model`.
"""
for revision in revisions:
if revision['id'] not in self._revisions:
@@ -388,21 +382,19 @@
"""Add releases to the storage
Args:
- releases (iterable): iterable of dictionaries representing the
- individual releases to add. Each dict has the following keys:
+ releases (Iterable[dict]): iterable of dictionaries representing
+ the individual releases to add. Each dict has the following
+ keys:
- id (sha1_git): id of the release to add
- revision (sha1_git): id of the revision the release points to
- - date (datetime.DateTime): the date the release was made
- - date_offset (int): offset from UTC in minutes the release was
- made
- - date_neg_utc_offset (boolean): whether a null date_offset
- represents a negative UTC offset
+ - date (dict): the date the release was made
- name (bytes): the name of the release
- comment (bytes): the comment associated with the release
- - author_name (bytes): the name of the release author
- - author_email (bytes): the email of the release author
+ - author (Dict[str, bytes]): dictionary with keys:
+ name, fullname, email
+ the date dictionary has the form defined in :mod:`swh.model`.
"""
for rel in releases:
rel['date'] = normalize_timestamp(rel['date'])
diff --git a/swh/storage/storage.py b/swh/storage/storage.py
--- a/swh/storage/storage.py
+++ b/swh/storage/storage.py
@@ -523,15 +523,14 @@
"""Add revisions to the storage
Args:
- revisions (iterable): iterable of dictionaries representing the
- individual revisions to add. Each dict has the following keys:
+ revisions (Iterable[dict]): iterable of dictionaries representing
+ the individual revisions to add. Each dict has the following
+ keys:
- id (sha1_git): id of the revision to add
- - date (datetime.DateTime): date the revision was written
- - date_offset (int): offset from UTC in minutes the revision
- was written
- - date_neg_utc_offset (boolean): whether a null date_offset
- represents a negative UTC offset
+ - date (dict): date the revision was written
+ - committer_date (dict): date the revision got
+ added to the origin
- committer_date (datetime.DateTime): date the revision got
added to the origin
- committer_date_offset (int): offset from UTC in minutes the
@@ -541,15 +540,16 @@
- type (one of 'git', 'tar'): type of the revision added
- directory (sha1_git): the directory the revision points at
- message (bytes): the message associated with the revision
- - author_name (bytes): the name of the revision author
- - author_email (bytes): the email of the revision author
- - committer_name (bytes): the name of the revision committer
- - committer_email (bytes): the email of the revision committer
+ - author (Dict[str, bytes]): dictionary with keys:
+ name, fullname, email
+ - committer (Dict[str, bytes]): dictionary with keys:
+ name, fullname, email
- metadata (jsonb): extra information as dictionary
- synthetic (bool): revision's nature (tarball, directory
creates synthetic revision)
- parents (list of sha1_git): the parents of this revision
+ date dictionaries have the form defined in :mod:`swh.model`.
"""
db = self.get_db()
@@ -656,21 +656,21 @@
"""Add releases to the storage
Args:
- releases (iterable): iterable of dictionaries representing the
- individual releases to add. Each dict has the following keys:
+ releases (Iterable[dict]): iterable of dictionaries representing
+ the individual releases to add. Each dict has the following
+ keys:
- id (sha1_git): id of the release to add
- revision (sha1_git): id of the revision the release points to
- - date (datetime.DateTime): the date the release was made
- - date_offset (int): offset from UTC in minutes the release was
- made
+ - date (dict): the date the release was made
- date_neg_utc_offset (boolean): whether a null date_offset
represents a negative UTC offset
- name (bytes): the name of the release
- comment (bytes): the comment associated with the release
- - author_name (bytes): the name of the release author
- - author_email (bytes): the email of the release author
+ - author (Dict[str, bytes]): dictionary with keys:
+ name, fullname, email
+ the date dictionary has the form defined in :mod:`swh.model`.
"""
db = self.get_db()
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Dec 20 2024, 12:29 PM (11 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3227605
Attached To
D676: Fix docstrings for Storage.add_{release,revision}.
Event Timeline
Log In to Comment