From f58341e4fc6d6ab39d259cb45120a66fbc19ade2 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Mon, 30 Mar 2009 22:38:49 +0200 Subject: Allow commitDialog to commit a single file. Signed-off-by: Matthieu Gautier --- g-ed-it/commitDialog.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'g-ed-it') diff --git a/g-ed-it/commitDialog.py b/g-ed-it/commitDialog.py index 61d4304..fa2a8e8 100644 --- a/g-ed-it/commitDialog.py +++ b/g-ed-it/commitDialog.py @@ -3,6 +3,8 @@ import os +import subprocess + class CommitDialog (object): def __init__(self,window,glade_xml): @@ -39,7 +41,14 @@ class CommitDialog (object): def on_commit_text_changed(self, commit_text_entry): pass - def show(self): + def show(self,fileName=None): + self.fileName = fileName + if self.fileName: + templateMsg = subprocess.Popen(["git-status","-s",os.path.basename(fileName)],stdout=subprocess.PIPE,cwd=os.path.dirname(fileName)).communicate()[0] + else: + cwd = os.path.dirname(self.window.get_active_document().get_uri_for_display()) + templateMsg = subprocess.Popen(["git-status","-s"],stdout=subprocess.PIPE,cwd=cwd).communicate()[0] + self.commit_text_box.get_buffer().set_text(templateMsg) self.commit_dialog.show() -- cgit