# HG changeset patch
# User Yuki KODAMA <endflow....@gmail.com>
# Date 1257130885 -32400
# Branch stable
# Node ID 140554f49f726221c060072f550f25cef5e88b27
# Parent  8506bcd473d05c596cccf7b111564c576094d3dc
thgstrip: fill combobox with tags and branches

diff --git a/tortoisehg/hgtk/thgstrip.py b/tortoisehg/hgtk/thgstrip.py
--- a/tortoisehg/hgtk/thgstrip.py
+++ b/tortoisehg/hgtk/thgstrip.py
@@ -63,10 +63,24 @@
         self.revcombo = gtk.combo_box_entry_new_text()
         table.add_row(_('Strip:'), self.revcombo)
         reventry = self.revcombo.child
-        reventry.set_text(rev)
         reventry.set_width_chars(32)
         reventry.connect('activate', lambda b: self.response(gtk.RESPONSE_OK))

+        ### fill combo list
+        self.revcombo.append_text(rev)
+        self.revcombo.set_active(0)
+        dblist = repo.ui.config('tortoisehg', 'deadbranch', '')
+        deadbranches = [ x.strip() for x in dblist.split(',') ]
+        for name in repo.branchtags().keys():
+            if name not in deadbranches:
+                self.revcombo.append_text(name)
+
+        tags = list(repo.tags())
+        tags.sort()
+        tags.reverse()
+        for tag in tags:
+            self.revcombo.append_text(tag)
+
         def createlabel():
             label = gtk.Label()
             label.set_alignment(0, 0.5)
@@ -317,7 +331,7 @@
     def get_rev(self):
         """ Return integer revision number or None """
         revstr = self.revcombo.get_active_text()
-        if len(revstr) == 0:
+        if revstr is None or len(revstr) == 0:
             return None
         try:
             revnum = self.repo[revstr].rev()

Attachment: thg-kuy-stable_rev4840.patch
Description: Binary data

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) 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 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Tortoisehg-develop mailing list
Tortoisehg-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to