File: svnmerge.py

package info (click to toggle)
python-kde3 3.15.2%2B20060422-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 14,620 kB
  • ctags: 7,123
  • sloc: python: 5,100; cpp: 4,676; ansic: 629; makefile: 116
file content (23 lines) | stat: -rw-r--r-- 815 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import os, os.path

svnbase = "/home/jim/PyKDE/sip/"
newbase = "/home/jim/PyKDE350/sip/"

newfiles = os.listdir (newbase)

for file in newfiles:
    newpath = os.path.join (newbase, file)
    if os.path.isdir (newpath):
        svnpath = os.path.join (svnbase, 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