changeset 23234:944d6cfbe166

synthrepo: synthesized dates must be positive, fit in 32-bit signed ints
author Mike Edgar <adgar@google.com>
date Mon, 20 Oct 2014 13:59:13 -0400
parents c1f370dab456
children 4cdc3e2810b9
files contrib/synthrepo.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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()),