Hmm, a merge attempt isn't that hard, here's another script that does
that, and has the same problem.

We don't use local file repositories, but this has the same symptom as
w/ a remote server.

hope it's either an easy fix or an easy workaround...

--Jason
import subprocess
import os

def getDirAsURL():
        return "file:///"+(os.getcwd().replace('\\','/'))

def writeFile(filename,s):
        with open(filename,"w") as f:
                f.write(s)
        
def shellexec(a):
        print(str(a))
        subprocess.call(a)
        
def svnadd(path):
        shellexec(["svn","add",path])
        
def svncommit(path,username,msg):
        shellexec(["svn","commit",path,"--username",username,"-m",msg])
        
def svnpropset(path,propname,propval):
        shellexec(["svn","propset",propname,propval,path])
        
def svnupdate(path):
        shellexec(["svn","update",path])
        
def svnversion(path):
        shellexec(["svnversion",path])
        
def svncopy(src,dest,username,msg):
        
shellexec(["svn","copy",src,dest,"--username",username,"-m",msg,"--parents"])
        
def svncheckout(src,dest):
        shellexec(["svn","co",src,dest]);

def svnmkdir(path):
        shellexec(["svn","mkdir",path,"--parents"])
        
def svnmerge_r(src,dest):
        shellexec(["svn","merge","--reintegrate", src, dest])
        
user = "daemon"
shellexec(["svnadmin","create","repos"])
svncheckout(getDirAsURL()+"/repos","working")
svnmkdir("working/foo/trunk/")
svnmkdir("working/bar/trunk/")
svncommit("working",user,"init checkin")

svncheckout(getDirAsURL()+"/repos/foo/trunk","w_foo")
writeFile("w_foo/blah.txt","this is blah.txt, first version")
svnadd("w_foo/blah.txt")
svncommit("w_foo",user,"init checkin")
writeFile("w_foo/blah.txt","this is blah.txt, second version")
svncommit("w_foo",user,"next checkin")

svncheckout(getDirAsURL()+"/repos/bar/trunk","w_bar")
writeFile("w_bar/hohum.txt","hohum.txt")
svnadd("w_bar/hohum.txt")
svncommit("w_bar",user,"another checkin")
svncopy("w_bar",getDirAsURL()+"/repos/bar/branches/br1",user,"making a branch")

writeFile("w_foo/blah.txt","this is blah.txt, third version")
svncommit("w_foo",user,"next checkin")

svnupdate("w_bar")
svnpropset("w_bar","svn:externals"," blah.txt -r 3 ^/foo/trunk/blah.txt")
svncommit("w_bar",user,"add externals")

svnupdate("w_bar")
svnversion("w_bar")
svnmerge_r(getDirAsURL()+"/repos/bar/branches/br1","w_bar")

Reply via email to