Commits

Adrian Buehlmann committed e479b15

tagadd: fallback to initial rev if tag is not found

Fixes #1112

Comments (0)

Files changed (1)

tortoisehg/hgtk/tagadd.py

         self.reventry = gtk.Entry()
         self.reventry.set_width_chars(12)
         self.reventry.set_text(rev)
+        self.initial_rev = rev
         self.reventry.connect('notify::text',
                                 lambda *a: self.update_sensitives())
         table.add_row(_('Revision:'), self.reventry)
         tagmap = self.repo.tags()
         tag = self.tagentry.get_text()
         if not tag or hglib.fromutf(tag) not in tagmap:
+            if self.initial_rev:
+                self.reventry.set_text(self.initial_rev)
             return
 
         node = tagmap[hglib.fromutf(tag)]