Commits

Steve Borho committed e712010

backout: update to new hg-1.7 backout behavior

Comments (0)

Files changed (1)

tortoisehg/hgtk/backout.py

         scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
         scrolledwindow.add(self.logview)
         msgvbox.pack_start(scrolledwindow)
+        self.logview.set_editable(False)
 
         ## tooltips
         self.tips = gtklib.Tooltips()
 
         ## merge after backout
         self.merge_button = gtk.CheckButton(
-                _('Merge with old dirstate parent after backout'))
+                _('Commit backout before merging with current working parent'))
+        self.merge_button.connect('toggled', self.merge_toggeled)
         hbox.pack_start(self.merge_button, False, False, 4)
         msgvbox.pack_start(hbox, False, False)
 
 
     def command_done(self, returncode, useraborted, *args):
         if returncode == 0:
-            self.cmd.set_result(_('Backed out successfully'), style='ok')
+            self.cmd.set_result(_('Backed out successfully, you must now '
+                                  'commit the results'), style='ok')
         elif useraborted:
             self.cmd.set_result(_('Canceled backout'), style='error')
         else:
         newmsg = (state and self.msgset['id'] or self.msgset['str'])
         self.buf.set_text(newmsg)
 
+    def merge_toggeled(self, checkbutton):
+        self.logview.set_editable(checkbutton.get_active())
+
     def backout(self):
         # prepare command line
-        start, end = self.buf.get_bounds()
-        msg = self.buf.get_text(start, end)
         cmdline = ['hg', 'backout', '--rev', self.rev]
         if self.merge_button.get_active():
+            start, end = self.buf.get_bounds()
+            msg = self.buf.get_text(start, end)
             cmdline += ['--merge']
-        cmdline += ['--message', hglib.fromutf(msg)]
+            cmdline += ['--message', hglib.fromutf(msg)]
 
         # start backing out
         self.execute_command(cmdline)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.