[PATCH 6 of 8] progress: cache tuple = (topic, pos, item, unit, total)

Augie Fackler durin42 at gmail.com
Thu Dec 9 17:41:06 CST 2010


# HG changeset patch
# User timeless <timeless at gmail.com>
# Date 1288093318 -10800
# Node ID fc30ad3b4f8d6d465be150e411dc24fb07ac4807
# Parent  f0ef6533d1cc76e38053bc192f91b65a9c41b89a
progress: cache tuple = (topic, pos, item, unit, total)

diff --git a/hgext/progress.py b/hgext/progress.py
--- a/hgext/progress.py
+++ b/hgext/progress.py
@@ -77,12 +77,13 @@
     def show(self, topic, pos, item, unit, total):
         if not shouldprint(self.ui):
             return
-        if self.printed == (topic, pos, item, unit, total):
+        tuple = (topic, pos, item, unit, total)
+        if self.printed == tuple:
             # don't double-print progress information, otherwise
             # possible in the case of unwinding the topic stack
             return
         termwidth = self.width()
-        self.printed = (topic, pos, item, unit, total)
+        self.printed = tuple
         head = ''
         needprogress = False
         tail = ''


More information about the Mercurial-devel mailing list