diff options
author | Matthieu Gautier <starmad@pegase.localdomain> | 2009-03-30 22:38:49 +0200 |
---|---|---|
committer | Matthieu Gautier <starmad@pegase.localdomain> | 2009-03-30 22:38:49 +0200 |
commit | f58341e4fc6d6ab39d259cb45120a66fbc19ade2 (patch) | |
tree | 9658b2606f0531796f310b9a85e06a285ddcae1a /g-ed-it | |
parent | b4cb78b1c6b9a05a5dba9f85fc831d8249fc72f4 (diff) | |
download | g-ed-it-f58341e4fc6d6ab39d259cb45120a66fbc19ade2.tar.gz g-ed-it-f58341e4fc6d6ab39d259cb45120a66fbc19ade2.tar.xz g-ed-it-f58341e4fc6d6ab39d259cb45120a66fbc19ade2.zip |
Allow commitDialog to commit a single file.
Signed-off-by: Matthieu Gautier <starmad@pegase.localdomain>
Diffstat (limited to 'g-ed-it')
-rw-r--r-- | g-ed-it/commitDialog.py | 11 |
1 files changed, 10 insertions, 1 deletions
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() |