# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1506288997 -19800 # Node ID db3c85c2cb473f394a39248ddd48914161b6e204 # Parent f4956eb3a456b135718979fb14bb668fd65b85cb topics: initialize variable with default value instead of assigning later diff -r f4956eb3a456 -r db3c85c2cb47 hgext3rd/topic/__init__.py --- a/hgext3rd/topic/__init__.py Mon Sep 25 03:04:42 2017 +0530 +++ b/hgext3rd/topic/__init__.py Mon Sep 25 03:06:37 2017 +0530 @@ -818,6 +818,7 @@ topicstime = {} curtime = time.time() for t in topics: + secspassed = -1 maxtime = (0, 0) trevs = repo.revs("topic(%s)", t) # Need to check for the time of all changesets in the topic, whether @@ -836,10 +837,7 @@ rt = marker.date() if rt[0] > maxtime[0]: maxtime = rt - # is the topic still yet untouched - if not trevs: - secspassed = -1 - else: + if trevs: secspassed = (curtime - maxtime[0]) try: topicstime[secspassed][1].append(t)