SF.net SVN: geany-plugins:[1166] trunk/geany-plugins/wscript

eht16 at users.sourceforge.net eht16 at xxxxx
Mon Mar 15 14:01:58 UTC 2010


Revision: 1166
          http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1166&view=rev
Author:   eht16
Date:     2010-03-15 14:01:58 +0000 (Mon, 15 Mar 2010)

Log Message:
-----------
Fix/Improve GIT repository detection (patch by Thomas Martitz, thanks).

Modified Paths:
--------------
    trunk/geany-plugins/wscript

Modified: trunk/geany-plugins/wscript
===================================================================
--- trunk/geany-plugins/wscript	2010-03-14 20:22:36 UTC (rev 1165)
+++ trunk/geany-plugins/wscript	2010-03-15 14:01:58 UTC (rev 1166)
@@ -152,13 +152,21 @@
 preproc.standard_includes = []
 
 def configure(conf):
+	def in_git():
+		cmd = 'git ls-files >/dev/null 2>&1'
+		return (Utils.exec_command(cmd) == 0)
+
+	def in_svn():
+		return os.path.exists('.svn')
+
 	def conf_get_svn_rev():
 		# try GIT
-		if os.path.exists('.git'):
+		if in_git():
 			cmds = [ 'git svn find-rev HEAD 2>/dev/null',
 					 'git svn find-rev origin/trunk 2>/dev/null',
 					 'git svn find-rev trunk 2>/dev/null',
-					 'git svn find-rev master 2>/dev/null' ]
+					 'git svn find-rev master 2>/dev/null'
+					]
 			for c in cmds:
 				try:
 					stdout = Utils.cmd_output(c)
@@ -167,7 +175,7 @@
 				except:
 					pass
 		# try SVN
-		elif os.path.exists('.svn'):
+		elif in_svn():
 			try:
 				_env = None if is_win32 else {'LANG' : 'C'}
 				stdout = Utils.cmd_output(cmd='svn info --non-interactive', silent=True, env=_env)


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Plugins-Commits mailing list