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)
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_incremental_sub(id, "dir2", 1, 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")
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")
def run(id, args = []): # Set up the test repository test_api.setup_repos(id, setup) rdump_path = test_api.dump_rsvndump(id, args) vdump_path = test_api.dump_reload(id, rdump_path) shutil.move(rdump_path, rdump_path+".orig") shutil.move(vdump_path, vdump_path+".orig") rdump_path = test_api.dump_rsvndump_incremental(id, 1, args) vdump_path = test_api.dump_reload(id, rdump_path) # We apply a patch to the incremental dump because it will miss # that a path has not been changed on copy (simply because it does # not consider previous revisions) patch_path = test_api.data_dir()+"/"+test_api.name(id)+".patch" if "--deltas" in args: patch_path += ".deltas" test_api.bspatch(id, rdump_path, patch_path) return test_api.diff(id, rdump_path+".orig", rdump_path)