mercurial/util.py
changeset 27066 6f1f8e88f036
parent 27016 448cbdab5883
child 27112 39c14e89b881
--- a/mercurial/util.py	Sat Nov 14 17:44:01 2015 -0800
+++ b/mercurial/util.py	Sat Nov 14 17:30:10 2015 -0800
@@ -1367,9 +1367,10 @@
     if "%1" in format or "%2" in format or "%z" in format:
         sign = (tz > 0) and "-" or "+"
         minutes = abs(tz) // 60
+        q, r = divmod(minutes, 60)
         format = format.replace("%z", "%1%2")
-        format = format.replace("%1", "%c%02d" % (sign, minutes // 60))
-        format = format.replace("%2", "%02d" % (minutes % 60))
+        format = format.replace("%1", "%c%02d" % (sign, q))
+        format = format.replace("%2", "%02d" % r)
     try:
         t = time.gmtime(float(t) - tz)
     except ValueError: