summaryrefslogtreecommitdiffstats
path: root/python/pykde/svnmerge.py
blob: 7b90652bae4503b991036c2c72c4e71821a304f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import os, os.path

svnbase = "/home/jim/PyKDE/"
newbase = "/home/jim/PyKDE352/"

newfiles = os.listdir (os.path.join (newbase, "sip"))

for file in newfiles:
    newpath = os.path.join (newbase, "sip", file)
    if os.path.isdir (newpath):
        svnpath = os.path.join (svnbase, "sip", file)
        if os.path.exists (svnpath):
            newsip = os.listdir (newpath)
            svnsip = os.listdir (svnpath)
            for sip in newsip:
                os.system ("cp %s %s" % (os.path.join (newpath, sip), svnpath))
                if sip not in svnsip:
                    os.system ("svn add %s" % (os.path.join (svnpath, sip)))
                    print "added %s" % sip
        else:
            os.system ("cp -R %s %s" % (newpath, svnpath))
            os.system ("svn add %s" % svnpath)
            print "added %s" % svnpath

newfiles = os.listdir (os.path.join (newbase, "extra"))

for file in newfiles:
    newpath = os.path.join (newbase, "extra", file)
    if os.path.isdir (newpath):
        svnpath = os.path.join (svnbase, "extra", file)
        if os.path.exists (svnpath):
            newextra = os.listdir (newpath)
            svnextra = os.listdir (svnpath)
            for extra in newextra:
                os.system ("cp %s %s" % (os.path.join (newpath, extra), svnpath))
                if extra not in svnextra:
                    os.system ("svn add %s" % (os.path.join (svnpath, extra)))
                    print "added %s" % extra
        else:
            os.system ("cp -R %s %s" % (newpath, svnpath))
            os.system ("svn add %s" % svnpath)
            print "added %s" % svnpath

files = ["configure.py", "*.prj", "svnm*"]
                  
for file in files:
    os.system ("cp %s %s" % (os.path.join (newbase, file), os.path.join (svnbase, file)))