# HG changeset patch # User Pierre-Yves David # Date 2014-08-14 05:44:47 # Node ID 570f87422f544d72807457a5ed703983acf668a8 # Parent 9be81b86ca97790d3a79c0383a31416cfef5e4d0 obsstore: add an explicit `date` argument to obsstore.create The date will become an official field in the markers (and ultimately in the on-disk format). We start by making it an official argument for the function. diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py --- a/mercurial/obsolete.py +++ b/mercurial/obsolete.py @@ -259,7 +259,8 @@ class obsstore(object): def __nonzero__(self): return bool(self._all) - def create(self, transaction, prec, succs=(), flag=0, metadata=None): + def create(self, transaction, prec, succs=(), flag=0, date=None, + metadata=None): """obsolete: add a new obsolete marker * ensuring it is hashable @@ -275,7 +276,9 @@ class obsstore(object): if metadata is None: metadata = {} if 'date' not in metadata: - metadata['date'] = "%d %d" % util.makedate() + if date is None: + date = util.makedate() + metadata['date'] = "%d %d" % date if len(prec) != 20: raise ValueError(prec) for succ in succs: