Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.1, 2.1.1, and 2.1.2

Merge with stable

Changeset 2b42738f1e42

Parents ca5df3b8912a

Parents 7d017d34af8c

by Steve Borho

Changes to 2 files · Browse files at 2b42738f1e42 Showing diff from parent ca5df3b8912a 7d017d34af8c Diff from another changeset...

 
66
67
68
 
 
 
 
 
 
 
 
69
70
71
 
66
67
68
69
70
71
72
73
74
75
76
77
78
79
@@ -66,6 +66,14 @@
  for d in (0, SECS_PER_DAY, 365 * SECS_PER_DAY):   assert_equals('#ffd4d4', cm.get_color(fakectx(0, d), d + age))   +def test_negative_age_calc(): + cm = colormap.AnnotateColorSaturation() + assert_equals('#ffaaaa', cm.get_color(fakectx(0, 0), 0), '0 days old') + assert_equals('#ffaaaa', cm.get_color(fakectx(0, 50 * SECS_PER_DAY), 0), + '-50 days old (should not raise ZeroDivisionError)') + assert_equals('#ffaaaa', cm.get_color(fakectx(0, 100 * SECS_PER_DAY), 0), + '-100 days old') +  def test_makeannotatepalette_latest_wins():   userstep = sys.maxint / 16   filectxs = [fakectx(0 * userstep, 0), fakectx(1 * userstep, 1),
 
102
103
104
105
 
106
107
108
 
102
103
104
 
105
106
107
108
@@ -102,7 +102,7 @@
  return _rescale(angle, 360.0 / self._maxhues)     def get_color(self, ctx, now): - days = _days(ctx, now) + days = max(_days(ctx, now), 0.0)   saturation = 255/((days/50) + 1)   if self._maxsaturations:   saturation = _rescaleceil(saturation, 255. / self._maxsaturations)