[Pkg-bazaar-commits] ./bzr-gtk/unstable r176: Don't make the user worry about strict commit unless we actually find unknown files.

Jelmer Vernooij jelmer at samba.org
Fri Apr 10 07:45:36 UTC 2009


------------------------------------------------------------
revno: 176
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Tue 2007-03-20 21:44:53 +0100
message:
  Don't make the user worry about strict commit unless we actually find unknown files.
modified:
  TODO
  commit.py
-------------- next part --------------
=== modified file 'TODO'
--- a/TODO	2007-03-09 19:04:40 +0000
+++ b/TODO	2007-03-20 20:44:53 +0000
@@ -1,10 +1,6 @@
 TODO list for Bzr-Gtk
 ---------------------
 
-- Strict commit should not be a checkbox. The GUI should rather ask the 
-  user whether (s)he wants to continue if there were no changes.
-- Commit with unknowns should not be a checkbox. The GUI should rather ask 
-  the user whether (s)he wants to continue while there were unknown files.
 - It should be possible to add unknown files from the commit dialog.
 - Eliminate radiobuttons in push but rather show the default location and 
   allow the user to change it

=== modified file 'commit.py'
--- a/commit.py	2007-03-06 13:48:35 +0000
+++ b/commit.py	2007-03-20 20:44:53 +0000
@@ -90,8 +90,6 @@
         
         # Create the widgets
         self._button_commit = gtk.Button(_("Comm_it"), use_underline=True)
-        self._check_strict = gtk.CheckButton(_("_Allow unknown files"),
-                                             use_underline=True)
         self._expander_files = gtk.Expander(_("File(s) to commit"))
         self._vpaned_main = gtk.VPaned()
         self._scrolledwindow_files = gtk.ScrolledWindow()
@@ -156,7 +154,6 @@
             if have_nm:
                 # 3 is the enum value for STATE_CONNECTED
                 self._check_local.set_active(dbus_iface.state() != 3)
-        self.vbox.pack_start(self._check_strict, False, False)
         
         # Create the file list
         self._create_file_view()
@@ -220,11 +217,17 @@
             local = self._check_local.get_active()
         else:
             local = False
+
+        if list(self.wt.unknowns()) != []:
+            response = question_dialog(_("Commit with unknowns?"),
+               _("Unknown files exist in the working tree. Commit anyway?"))
+            if response == gtk.RESPONSE_NO:
+                return
         
         try:
             self.wt.commit(message,
                        allow_pointless=False,
-                       strict=self._check_strict.get_active(),
+                       strict=False,
                        local=local,
                        specific_files=specific_files)
         except errors.PointlessCommit:
@@ -233,7 +236,7 @@
             if response == gtk.RESPONSE_YES:
                 self.wt.commit(message,
                                allow_pointless=True,
-                               strict=self._check_strict.get_active(),
+                               strict=False,
                                local=local,
                                specific_files=specific_files)
         self.response(gtk.RESPONSE_OK)



More information about the Pkg-bazaar-commits mailing list