[jhbuild] fix detection of locally modified modulesets (#579796)



commit e0380afae990cbfa8db629c1fbf68c374a76b0cd
Author: Frederic Peters <fpeters 0d be>
Date:   Wed Apr 22 13:07:39 2009 +0200

    fix detection of locally modified modulesets (#579796)
    
    The check for locally modified modulesets was still using 'svn status',
    which obviously had not much impact now that we are using git.
---
 jhbuild/moduleset.py |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/jhbuild/moduleset.py b/jhbuild/moduleset.py
index 951b7d5..c1ecd27 100644
--- a/jhbuild/moduleset.py
+++ b/jhbuild/moduleset.py
@@ -413,8 +413,8 @@ def warn_local_modulesets(config):
         # moduleset-less checkout
         return
 
-    if not os.path.exists(os.path.join(moduleset_local_path, '.svn')):
-        # checkout was not done via subversion
+    if not os.path.exists(os.path.join(moduleset_local_path, '..', '.git')):
+        # checkout was not done via git
         return
 
     if type(config.moduleset) == type([]):
@@ -427,12 +427,13 @@ def warn_local_modulesets(config):
         return
 
     try:
-        svn_status = get_output(['svn', 'status'], cwd=moduleset_local_path)
+        git_diff = get_output(['git', 'diff', 'origin/master', '--', '.'],
+                cwd=moduleset_local_path).strip()
     except CommandError:
-        # svn error, ignore
+        # git error, ignore
         return
 
-    if not [x for x in svn_status.splitlines() if x.startswith('M')]:
+    if not git_diff:
         # no locally modified moduleset
         return
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]