Skip to content
Snippets Groups Projects
Commit 224a058f authored by Pierre-Yves David's avatar Pierre-Yves David
Browse files

obsstore: `create` method return True if a marker is actually added

The obsstore method now have a return value. This informs caller about the
actual creation of a new markers. No new markers are created if it would have
been a duplicate.
parent 18ca31bb
No related branches found
No related tags found
No related merge requests found
......@@ -259,6 +259,9 @@
If you are a human writing code creating marker you want to use the
`createmarkers` function in this module instead.
return True if a new marker have been added, False if the markers
already existed (no op).
"""
if metadata is None:
metadata = {}
......@@ -270,7 +273,7 @@
if len(succ) != 20:
raise ValueError(succ)
marker = (str(prec), tuple(succs), int(flag), encodemeta(metadata))
self.add(transaction, [marker])
return bool(self.add(transaction, [marker]))
def add(self, transaction, markers):
"""Add new markers to the store
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment