contrib/synthrepo.py
changeset 23234 944d6cfbe166
parent 22709 889789a2ca9f
child 23235 4cdc3e2810b9
--- a/contrib/synthrepo.py	Thu Nov 06 01:48:29 2014 +0100
+++ b/contrib/synthrepo.py	Mon Oct 20 13:59:13 2014 -0400
@@ -428,6 +428,8 @@
             date = repo['tip'].date()[0] + pick(interarrival)
         else:
             date = time.time() - (86400 * count)
+        # dates in mercurial must be positive, fit in 32-bit signed integers.
+        date = min(0x7fffffff, max(0, date))
         user = random.choice(words) + '@' + random.choice(words)
         mc = context.memctx(repo, pl, makeline(minimum=2),
                             sorted(changes.iterkeys()),