Source

thg-qt-mq / csinfo-nostrconv.diff

Full commit
# HG changeset patch
# Parent 26a73cf0552b8b16d869b117032f6323485821be
csinfo: don't convert int revision to str

If rev == len(repo), repo[int(rev)] != repo[str(rev)].

Because revdetails widget, the owner of csinfo widget, handles rev as-is,
converting it to str at csinfo makes unexpected behavior.

TODO test!

diff --git a/tortoisehg/hgqt/csinfo.py b/tortoisehg/hgqt/csinfo.py
--- a/tortoisehg/hgqt/csinfo.py
+++ b/tortoisehg/hgqt/csinfo.py
@@ -312,10 +312,7 @@ class SummaryInfo(object):
 class SummaryBase(object):
 
     def __init__(self, target, custom, repo, info):
-        if target is None:
-            self.target = None
-        else:
-            self.target = str(target)
+        self.target = target
         self.custom = custom
         self.repo = repo
         self.info = info
@@ -338,11 +335,7 @@ class SummaryBase(object):
 
     def update(self, target=None, custom=None, repo=None):
         self.ctx = None
-        if target is None:
-            target = self.target
-        if target is not None:
-            target = str(target)
-            self.target = target
+        target = self.target
         if custom is not None:
             self.custom = custom
         if repo is None: