示例#1
0
def run(id, args = []):
	# Set up the test repository
	test_api.setup_repos(id, setup)

	odump_path = test_api.dump_original(id)
	rdump_path = test_api.dump_rsvndump_sub(id, "dir1", args)
	tmp = test_api.dump_reload(id, rdump_path)

	vdump_path = test_api.data_dir()+"/"+test_api.name(id)+".dump"
	if "--deltas" in args:
		vdump_path += ".deltas"
	if "--keep-revnums" in args:
		vdump_path += ".keep_revnums"

	# We need to strip the date property from the dumpfile generated
	# by rsvndump in order to validate it properly
	tmp = test_api.mktemp(id)
	o = open(tmp, "w")
	cnt = -1
	for line in open(rdump_path):
		if line == "svn:date\n":
			cnt = 2
		elif cnt > 0:
			cnt -= 1
			if cnt == 0:
				continue
		o.write(line)
	o.close()
	shutil.move(tmp, rdump_path)

	return test_api.diff(id, rdump_path, vdump_path)
示例#2
0
def run(id, args=[]):
    # Set up the test repository
    repo1 = test_api.setup_repos(id, setup)

    args.append("--prefix")
    args.append("foo/")
    rdump_path = test_api.dump_rsvndump_sub(id, "foo", args)

    repo2 = test_api.repos_load(id, rdump_path)
    return test_api.diff_repos(id, repo1, "foo", repo2, "foo")
示例#3
0
def run(id, args = []):
	# Set up the test repository
	repo1 = test_api.setup_repos(id, setup)

	args.append("--prefix")
	args.append("foo/");
	rdump_path = test_api.dump_rsvndump_sub(id, "foo", args)

	repo2 = test_api.repos_load(id, rdump_path)
	return test_api.diff_repos(id, repo1, "foo", repo2, "foo")
示例#4
0
def run(id, args = []):
	# Set up the test repository
	test_api.setup_repos(id, setup)

	args.append("--keep-revnums")
	odump_path = test_api.dump_original(id)
	rdump_path = test_api.dump_rsvndump_sub(id, "dir1", args)
	try:
		test_api.dump_reload(id, rdump_path)
	except:
		return False
	return True
示例#5
0
def run(id, args = []):
	# Set up the test repository
	repo1 = test_api.setup_repos(id, setup)

	args.append("--prefix")
	args.append("dir2/");
	rdump_path = test_api.dump_rsvndump_sub(id, "dir2", args)

	# Because of the prefix, the dump needs to be patched (move prefix construction
	# to revision 4, so it can be compared with the original one)
	if "--keep-revnums" in args:
		test_api.patch(id, rdump_path, test_api.data_dir()+"/"+test_api.name(id)+".keep_revnums.patch")

	repo2 = test_api.repos_load(id, rdump_path)
	return test_api.diff_repos(id, repo1, "dir2", repo2, "dir2")
示例#6
0
def run(id, args = []):
	# Set up the test repository
	repo1 = test_api.setup_repos(id, setup)

	args.append("--prefix")
	args.append("dir2/");
	rdump_path = test_api.dump_rsvndump_sub(id, "dir2", args)

	# Because of the prefix, the dump needs to be patched (move prefix construction
	# to revision 4, so it can be compared with the original one)
	if "--keep-revnums" in args:
		test_api.patch(id, rdump_path, test_api.data_dir()+"/"+test_api.name(id)+".keep_revnums.patch")

	repo2 = test_api.repos_load(id, rdump_path)
	return test_api.diff_repos(id, repo1, "dir2", repo2, "dir2")