# HG changeset patch
# User Yuki KODAMA <endflow....@gmail.com>
# Date 1253027772 -32400
# Node ID 15169b8281d263e158bf2036b5759619fe120abb
# Parent  897b52f5da7a0d1e7e2af80bfc5563195c89ed44
changeset: display message if the patch has no hunks

diff --git a/tortoisehg/hgtk/changeset.py b/tortoisehg/hgtk/changeset.py
--- a/tortoisehg/hgtk/changeset.py
+++ b/tortoisehg/hgtk/changeset.py
@@ -202,8 +202,7 @@
             if file:
                 self.append_patch_diff(file)
             else:
-                for _, _, f in model:
-                    self.append_patch_diff(f)
+                self.append_all_patch_diffs()

     def generate_change_header(self):
         buf, rev = self._buffer, self.currev
@@ -391,6 +390,15 @@
         pos = buf.get_iter_at_offset(offset)
         buf.apply_tag_by_name('mono', pos, eob)

+    def append_all_patch_diffs(self):
+        model = self._filelist
+        if len(model) > 1:
+            for st, fu, fn in model:
+                self.append_patch_diff(fn)
+        else:
+            self._buffer.insert(self._buffer.get_end_iter(),
+                                '\n' + _('[no hunks to display]'))
+
     def prepare_diff(self, difflines, offset, fname):
         'Borrowed from hgview; parses changeset diffs'
         def addtag( name, offset, length ):

Attachment: thg-kuy_rev4024.patch
Description: Binary data

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Tortoisehg-develop mailing list
Tortoisehg-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to