From daf633418a4b411676580993fc8c15895182dde7 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Wed, 18 Nov 2009 21:44:37 -0800 Subject: [PATCH] models.main: Remove unused add_or_remove() method Signed-off-by: David Aguilar --- cola/models/main.py | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/cola/models/main.py b/cola/models/main.py index df6ac429..00b8853e 100644 --- a/cola/models/main.py +++ b/cola/models/main.py @@ -325,48 +325,6 @@ class MainModel(ObservableModel): self.subtree_sha1s.append(self.sha1s[idx]) self.subtree_names.append(name) - def add_or_remove(self, to_process): - """Invokes 'git add' to index the filenames in to_process that exist - and 'git rm' for those that do not exist.""" - - if not to_process: - return 'No files to add or remove.' - - to_add = [] - to_remove = [] - - for filename in to_process: - encfilename = core.encode(filename) - if os.path.exists(encfilename): - to_add.append(filename) - - status = 0 - if to_add: - newstatus, output = self.git.add(v=True, - with_stderr=True, - with_status=True, - *to_add) - status += newstatus - else: - output = '' - - if len(to_add) == len(to_process): - # to_process only contained unremoved files -- - # short-circuit the removal checks - return (status, output) - - # Process files to remote - for filename in to_process: - if not os.path.exists(filename): - to_remove.append(filename) - newstatus, out = self.git.rm(with_stderr=True, - with_status=True, - *to_remove) - if status == 0: - status += newstatus - output + '\n\n' + out - return (status, output) - def editor(self): return self.gui_config('editor') -- 2.11.4.GIT