X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=site_scons%2FSparseTestHack.py;h=f1a6f83854fda659f4a77067b805a0a6f6b18b97;hb=eb2dc72ff79098515b03945c611955704b1babe3;hp=76e9ee27efc892b26f575a699e80c29f2be474a7;hpb=38fefda326ca127aa20a234755d9bb5cf0910516;p=senf.git diff --git a/site_scons/SparseTestHack.py b/site_scons/SparseTestHack.py index 76e9ee2..f1a6f83 100644 --- a/site_scons/SparseTestHack.py +++ b/site_scons/SparseTestHack.py @@ -129,3 +129,22 @@ def build(env, accept_unknown_tests=False): if only_tests: raise SCons.Errors.StopError("Unknown unit tests (only_tests): %s." % ", ".join("`%s'" % x for x in only_tests)) + +def findSCMChanges(): + + def scmchanges(dir): + if os.popen("cd %s; svnversion" % dir.abspath).read().strip() == "exported": + return [ dir.Entry(x) + for x in os.popen("cd %s; git ls-files --modified" + % dir.abspath).read().strip().split("\n") ] + else: + return [ dir.Entry(l[7:]) + for l in os.popen("cd %s; svn status" + % dir.abspath).read().rstrip().split("\n") + if l[0] == 'M' ] + + changes=scmchanges(env.Dir('#')) + for dir in env.Dir('senf/Ext').glob("*"): + if isinstance(dir,SCons.Node.FS.Dir): + changes.extend(scmchanges(dir)) + return [ x for x in changes if not isinstance(x,SCons.Node.FS.Dir) ]