<commit_before>#include "system.h"
#include "sccs.h"
#include "range.h"
WHATSTR("@(#)%K%");

/*
 * r2c - convert rev to cset rev
 *
 * usage: file -r<rev> file
 *
 * XXX - expects to be standalone, one shot, does not free resources.
 */
int
r2c_main(int ac, char **av)
{
	char	*name;
	delta	*e;
	sccs	*s, *cset;
	char	buf[MAXPATH+200];
	char	tmpfile[MAXPATH];
	char	*t, *key, *shortkey;
	FILE	*f = 0;
	int	len;
	RANGE_DECL;

	if (ac == 2 && streq("--help", av[1])) {
		system("bk help r2c");
		return (0);
	}
	unless (av[1] && strneq(av[1], "-r", 2) && av[2] && !av[3]) { 
		/* doc 2.0 */
		system("bk help -s r2c");
		exit(1);
	}
	name = name2sccs(av[2]);
	unless (s = sccs_init(name, INIT_NOCKSUM)) {
		perror(name);
		exit(1);
	}
	if (proj_cd2root()) {
		fprintf(stderr, "r2c: cannot find package root.\n");
		exit(1);<commit_msg>Fixed problem reported by Bluearc where   cd /; bk r2c -r+ /repos/foo/foo.c failed.<commit_after>#include "system.h"
#include "sccs.h"
#include "range.h"
WHATSTR("@(#)%K%");

/*
 * r2c - convert rev to cset rev
 *
 * usage: file -r<rev> file
 *
 * XXX - expects to be standalone, one shot, does not free resources.
 */
int
r2c_main(int ac, char **av)
{
	char	*name;
	delta	*e;
	sccs	*s, *cset;
	char	buf[MAXPATH+200];
	char	tmpfile[MAXPATH];
	char	*t, *key, *shortkey;
	FILE	*f = 0;
	int	len;
	RANGE_DECL;

	if (ac == 2 && streq("--help", av[1])) {
		system("bk help r2c");
		return (0);
	}
	unless (av[1] && strneq(av[1], "-r", 2) && av[2] && !av[3]) { 
		/* doc 2.0 */
		system("bk help -s r2c");
		exit(1);
	}
	name = name2sccs(av[2]);
	unless (s = sccs_init(name, INIT_NOCKSUM)) {
		perror(name);
		exit(1);
	}
	if (chdir(proj_root(s->proj))) {
		fprintf(stderr, "r2c: cannot find package root.\n");
		exit(1);
{'fraction_non_alphanumeric': 0.2112192329708071, 'fraction_numerical': 0.028620492272467088, 'mean_word_length': 3.493573264781491, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '279881', 'n_tokens_mistral': 849, 'n_tokens_neox': 798, 'n_words': 202}