1. Henrik Stuart
  2. hgtk

Commits

Henrik Stuart  committed 5b54eba

commit: omit file list when committing everything

This, incidentally, allows one to commit .hgsubstate changes (this is only allowed by
Mercurial if no files are specified).

Review: Sune Foldager

  • Participants
  • Parent commits 20f5e7f
  • Branches hgtk

Comments (0)

Files changed (1)

File tortoisehg/hgtk/commit.py

View file
  • Ignore whitespace
             self.patch_text = None
         self.branchbutton.set_sensitive(not (self.mqmode or self.qnew))
 
+    def all_commitable_selected(self, selected, addremove=True):
+        commitable = 'MARS'
+        if addremove:
+            ar_list = self.relevant_checked_files('?!')
+            if len(ar_list) > 0 and self.should_addremove(ar_list):
+                return False
+        all_mars_files = [item[FM_PATH] for item in self.filemodel
+                if item[FM_STATUS] in commitable]
+        return set(selected) == set(all_mars_files)
+
     def commit_clicked(self, toolbutton, data=None):
         if not self.isuptodate():
             return
         cmdline += ['--message=' + hglib.fromutf(self.opts['message'])]
         if self.qnew:
             cmdline += [hglib.fromutf(self.get_qnew_name())]
-        if files:
+        if files and not self.all_commitable_selected(files):
             cmdline.append('--')
             cmdline += files
         if autopush: