# HG changeset patch
# User Yuki KODAMA <endflow.net@gmail.com>
# Date 1252432807 -32400
# Node ID 4cc8000935d9358dbb2e2473f9d0574729bc6fa5
# Parent  7fda75c1944e0022db39d4db7f1083bc2b5bd885
history: reset 'origtip' variable when leave 'new' filter

After synchronizing, it turn on 'new' filter and new revisions are
shown with green color automatically, but it doesn't back to normal
colors even though I switch the filter from 'new' to 'all' till
restarting changelog viewer.

diff --git a/hggtk/history.py b/hggtk/history.py
--- a/hggtk/history.py
+++ b/hggtk/history.py
@@ -409,7 +409,10 @@
         opts.update(kwopts)
 
         # handle strips, rebases, etc
-        self.origtip = min(len(self.repo), self.origtip)
+        if self.filter == 'all':
+            self.origtip = len(self.repo)
+        else:
+            self.origtip = min(len(self.repo), self.origtip)
         opts['orig-tip'] = self.origtip
 
         self.nextbutton.set_sensitive(True)
