obsolete: ensure all markers have a date
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Mon, 11 Feb 2013 11:20:12 +0100
changeset 18904 e9331e979d7a
parent 18903 5df602551eea
child 18905 012780620d4f
obsolete: ensure all markers have a date Obsolescence creates a sparse DAG mostly composed of a lot of small independent chain of markers. Date is the only simple and "reliable" way to sort them. The existence of a date is now enforced at creation time as I'm more and more convinced that date will have a key role in obsolescence markers exchange.
mercurial/obsolete.py
--- a/mercurial/obsolete.py	Mon Apr 08 16:51:38 2013 +0400
+++ b/mercurial/obsolete.py	Mon Feb 11 11:20:12 2013 +0100
@@ -250,6 +250,8 @@
         """
         if metadata is None:
             metadata = {}
+        if 'date' not in metadata:
+            metadata['date'] = "%d %d" % util.makedate()
         if len(prec) != 20:
             raise ValueError(prec)
         for succ in succs: