synthrepo: synthesized dates must be positive, fit in 32-bit signed ints
authorMike Edgar <adgar@google.com>
Mon, 20 Oct 2014 13:59:13 -0400
changeset 23234 944d6cfbe166
parent 23233 c1f370dab456
child 23235 4cdc3e2810b9
synthrepo: synthesized dates must be positive, fit in 32-bit signed ints
contrib/synthrepo.py
--- 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()),