Пример #1
0
def dump_rsvndump_incremental(id, stepsize, args, repos=None):
    log(id, "\n*** dump_rsvndump_incremental (" + str(id) + ")\n")

    if not repos:
        repos = test.repo(id)
    dump = test.dumps(id) + "/rsvndump.dump"
    start = 0
    end = stepsize
    while True:
        try:
            if not platform.system() == "Windows":
                run("../../src/rsvndump",
                    uri("file://" + repos),
                    "--incremental",
                    "--no-incremental-header",
                    "--revision",
                    str(start) + ":" + str(end),
                    extra_args=tuple(args),
                    output=dump,
                    error=test.log(id))
            else:
                run("../../bin/rsvndump.exe",
                    uri("file://" + repos),
                    "--incremental",
                    "--no-incremental-header",
                    "--revision",
                    str(start) + ":" + str(end),
                    extra_args=tuple(args),
                    output=dump,
                    error=test.log(id))
            start = end + 1
            end = start + stepsize
        except:
            break
    return dump
Пример #2
0
def dump_original(id, repos=None):
    log(id, "\n*** dump_original (" + str(id) + ")\n")

    if not repos:
        repos = test.repo(id)
    dump = test.dumps(id) + "/original.dump"
    run("svnadmin", "dump", repos, output=dump, error=test.log(id))
    return dump
Пример #3
0
def dump_original(id, repos = None):
	log(id, "\n*** dump_original ("+str(id)+")\n")

	if not repos:
		repos = test.repo(id)
	dump = test.dumps(id)+"/original.dump"
	run("svnadmin", "dump", repos, output = dump, error = test.log(id))
	return dump
Пример #4
0
def dump_reload(id, dumpfile):
    log(id, "\n*** dump_reload (" + str(id) + ")\n")

    tmp = test.mkdtemp(id)
    run("svnadmin", "create", tmp, output=test.log(id))
    run("svnadmin", "load", tmp, input=dumpfile, output=test.log(id))

    dump = test.dumps(id) + "/validate.dump"
    run("svnadmin", "dump", tmp, output=dump, error=test.log(id))
    return dump
Пример #5
0
def dump_reload(id, dumpfile):
	log(id, "\n*** dump_reload ("+str(id)+")\n")

	tmp = test.mkdtemp(id)
	run("svnadmin", "create", tmp, output = test.log(id))
	run("svnadmin", "load", tmp, input = dumpfile, output = test.log(id))

	dump = test.dumps(id)+"/validate.dump"
	run("svnadmin", "dump", tmp, output = dump, error = test.log(id))
	return dump
Пример #6
0
def dump_rsvndump_incremental_sub(id, path, stepsize, args, repos=None):
    log(id, "\n*** dump_rsvndump_incremental (" + str(id) + ")\n")

    if not repos:
        repos = test.repo(id)
    dump = test.dumps(id) + "/rsvndump.dump"

    # Fetch history
    history = mktemp(id)
    run("svnlook", "history", repos, path, output=history, error=test.log(id))
    f = open(history, "r")
    hist = f.readlines()
    f.close()
    hist.reverse()

    # Filter history
    regex = re.compile(" *[0-9]*   \/" + path + "$", re.IGNORECASE)
    hist = [h for h in hist if regex.search(h)]

    # Iteratve over history
    regex = re.compile(" *([0-9]*)", re.IGNORECASE)
    start = 0
    end = 0
    for h in hist:
        match = regex.match(h)
        if not match:
            break
        end = int(match.group())
        if end - start < stepsize:
            continue

        if not platform.system() == "Windows":
            run("../../src/rsvndump",
                uri("file://" + repos + "/" + path),
                "--incremental",
                "--no-incremental-header",
                "--revision",
                str(start) + ":" + str(end),
                extra_args=tuple(args),
                output=dump,
                error=test.log(id))
        else:
            run("../../bin/rsvndump",
                uri("file://" + repos + "/" + path),
                "--incremental",
                "--no-incremental-header",
                "--revision",
                str(start) + ":" + str(end),
                extra_args=tuple(args),
                output=dump,
                error=test.log(id))
        start = end + 1

    return dump
Пример #7
0
def dump_rsvndump(id, args, repos = None):
	log(id, "\n*** dump_rsvndump ("+str(id)+")\n")

	if not repos:
		repos = test.repo(id)
	dump = test.dumps(id)+"/rsvndump.dump"
	if not platform.system() == "Windows":
		run("../../src/rsvndump", uri("file://"+repos), extra_args = tuple(args), output = dump, error = test.log(id))
	else:
		run("../../bin/rsvndump.exe", uri("file://"+repos), extra_args = tuple(args), output = dump, error = test.log(id))
	return dump
Пример #8
0
def dump_reload_rsvndump_sub(id, dumpfile, path, args):
	log(id, "\n*** dump_reload ("+str(id)+")\n")

	tmp = test.mkdtemp(id)
	run("svnadmin", "create", tmp, output = test.log(id))
	run("svnadmin", "load", tmp, input = dumpfile, output = test.log(id))

	dump = test.dumps(id)+"/validate.dump"
	if not platform.system() == "Windows":
		run("../../src/rsvndump", uri("file://"+tmp+"/"+path), extra_args = tuple(args), output = dump, error = test.log(id))
	else:
		run("../../bin/rsvndump.exe", uri("file://"+tmp+"/"+path), extra_args = tuple(args), output = dump, error = test.log(id))
	return dump
Пример #9
0
def dump_rsvndump(id, args, repos=None):
    log(id, "\n*** dump_rsvndump (" + str(id) + ")\n")

    if not repos:
        repos = test.repo(id)
    dump = test.dumps(id) + "/rsvndump.dump"
    if not platform.system() == "Windows":
        run("../../src/rsvndump",
            uri("file://" + repos),
            extra_args=tuple(args),
            output=dump,
            error=test.log(id))
    else:
        run("../../bin/rsvndump.exe",
            uri("file://" + repos),
            extra_args=tuple(args),
            output=dump,
            error=test.log(id))
    return dump
Пример #10
0
def dump_rsvndump_incremental(id, stepsize, args, repos = None):
	log(id, "\n*** dump_rsvndump_incremental ("+str(id)+")\n")

	if not repos:
		repos = test.repo(id)
	dump = test.dumps(id)+"/rsvndump.dump"
	start = 0
	end = stepsize
	while True:
		try:
			if not platform.system() == "Windows":
				run("../../src/rsvndump", uri("file://"+repos), "--incremental", "--no-incremental-header", "--revision", str(start)+":"+str(end), extra_args = tuple(args), output = dump, error = test.log(id))
			else:
				run("../../bin/rsvndump.exe", uri("file://"+repos), "--incremental", "--no-incremental-header", "--revision", str(start)+":"+str(end), extra_args = tuple(args), output = dump, error = test.log(id))
			start = end+1
			end = start+stepsize
		except:
			break
	return dump
Пример #11
0
def dump_reload_rsvndump_sub(id, dumpfile, path, args):
    log(id, "\n*** dump_reload (" + str(id) + ")\n")

    tmp = test.mkdtemp(id)
    run("svnadmin", "create", tmp, output=test.log(id))
    run("svnadmin", "load", tmp, input=dumpfile, output=test.log(id))

    dump = test.dumps(id) + "/validate.dump"
    if not platform.system() == "Windows":
        run("../../src/rsvndump",
            uri("file://" + tmp + "/" + path),
            extra_args=tuple(args),
            output=dump,
            error=test.log(id))
    else:
        run("../../bin/rsvndump.exe",
            uri("file://" + tmp + "/" + path),
            extra_args=tuple(args),
            output=dump,
            error=test.log(id))
    return dump
Пример #12
0
def dump_rsvndump_incremental_sub(id, path, stepsize, args, repos = None):
	log(id, "\n*** dump_rsvndump_incremental ("+str(id)+")\n")

	if not repos:
		repos = test.repo(id)
	dump = test.dumps(id)+"/rsvndump.dump"

	# Fetch history
	history = mktemp(id)
	run("svnlook", "history", repos, path, output = history, error = test.log(id))
	f = open(history, "r")
	hist = f.readlines()
	f.close()
	hist.reverse()

	# Filter history
	regex = re.compile(" *[0-9]*   \/"+path+"$", re.IGNORECASE)
	hist = [h for h in hist if regex.search(h)]

	# Iteratve over history
	regex = re.compile(" *([0-9]*)", re.IGNORECASE)
	start = 0
	end = 0
	for h in hist:
		match = regex.match(h)
		if not match:
			break
		end = int(match.group())
		if end-start < stepsize:
			continue

		if not platform.system() == "Windows":
			run("../../src/rsvndump", uri("file://"+repos+"/"+path), "--incremental", "--no-incremental-header", "--revision", str(start)+":"+str(end), extra_args = tuple(args), output = dump, error = test.log(id))
		else:
			run("../../bin/rsvndump", uri("file://"+repos+"/"+path), "--incremental", "--no-incremental-header", "--revision", str(start)+":"+str(end), extra_args = tuple(args), output = dump, error = test.log(id))
		start = end+1

	return dump