# HG changeset patch # User Pierre-Yves David # Date 1393352514 28800 # Node ID 224a058f7cd10e0f17a7b31f3c2a63f9dfece5bd # Parent 18ca31bb114f4792725ac221302268a30a1e33a7 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. diff -r 18ca31bb114f -r 224a058f7cd1 mercurial/obsolete.py --- a/mercurial/obsolete.py Thu Feb 27 15:31:44 2014 -0600 +++ b/mercurial/obsolete.py Tue Feb 25 10:21:54 2014 -0800 @@ -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