예제 #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
	test_api.setup_repos(id, setup)

	odump_path = test_api.dump_original(id)

	# Dump with prefix
	my_prefix = "a/b/c/d/e/f/";
	args.append("--prefix")
	args.append(my_prefix)
	rdump_path = test_api.dump_rsvndump(id, args)

	# Load & dump subdirectory prefix 
	vdump_path = test_api.dump_reload_rsvndump_sub(id, rdump_path, my_prefix, args[:-2])
	tmp = test_api.mktemp(id)
	shutil.move(vdump_path, tmp)

	# A final verification dump
	vdump_path = test_api.dump_reload(id, tmp)

	# Don't compare the UUID (is different due to prefix and subpath dumping)
	# and the date of the first revision
	files = [vdump_path, odump_path]
	for f in files:
		tmp = test_api.mktemp(id)
		o = open(tmp, "w")
		cnt = -1
		for line in open(f):
			if line.startswith("UUID: "):
				continue
			elif line == "svn:date\n":
				cnt = 2
			elif cnt > 0:
				cnt -= 1
				if cnt == 0:
					continue
			o.write(line)
		o.close()
		shutil.move(tmp, f)

	return test_api.diff(id, odump_path, vdump_path)