version 1.42, 2007/10/09 12:25:27 |
version 1.43, 2007/10/09 12:59:53 |
|
|
|
|
void cvs_annotate_local(struct cvs_file *); |
void cvs_annotate_local(struct cvs_file *); |
|
|
|
extern char *cvs_specified_tag; |
|
|
static int force_head = 0; |
static int force_head = 0; |
|
|
struct cvs_cmd cvs_cmd_annotate = { |
struct cvs_cmd cvs_cmd_annotate = { |
|
|
{ |
{ |
int i; |
int i; |
char date[10], rnum[13], *p; |
char date[10], rnum[13], *p; |
RCSNUM *rev; |
RCSNUM *bnum, *rev; |
struct cvs_line *line; |
struct cvs_line *line; |
struct cvs_line **alines; |
struct cvs_line **alines; |
|
|
|
|
cf->file_type != CVS_FILE) |
cf->file_type != CVS_FILE) |
return; |
return; |
|
|
if (cvs_specified_tag == NULL) |
if (cvs_specified_tag != NULL) { |
rcs_rev_getlines(cf->file_rcs, cf->file_rcs->rf_head, &alines); |
|
else { |
|
if ((rev = rcs_translate_tag(cvs_specified_tag, |
if ((rev = rcs_translate_tag(cvs_specified_tag, |
cf->file_rcs)) == NULL) { |
cf->file_rcs)) == NULL) { |
if (!force_head) |
if (!force_head) |
/* Stick at weird GNU cvs, ignore error. */ |
/* Stick at weird GNU cvs, ignore error. */ |
return; |
return; |
|
|
rev = rcsnum_alloc(); |
rev = rcsnum_alloc(); |
rcsnum_cpy(cf->file_rcs->rf_head, rev, 0); |
rcsnum_cpy(cf->file_rcs->rf_head, rev, 0); |
} |
} |
|
|
/* rcs_translate_tag may give back an unavailable revision. */ |
/* |
if (rcs_findrev(cf->file_rcs, rev) == NULL) { |
* If this is a revision in a branch, we have to go first |
if (!force_head) { |
* from HEAD to branch, then down to 1.1. After that, take |
/* Stick at weird GNU cvs, ignore error. */ |
* annotated branch and go up to branch revision. This must |
rcsnum_free(rev); |
* be done this way due to different handling of "a" and |
return; |
* "d" in rcs file for annotation. |
} |
*/ |
rcsnum_cpy(cf->file_rcs->rf_head, rev, 0); |
if (!RCSNUM_ISBRANCHREV(rev)) { |
|
bnum = rev; |
|
} else { |
|
bnum = rcsnum_alloc(); |
|
rcsnum_cpy(rev, bnum, 2); |
} |
} |
rcs_rev_getlines(cf->file_rcs, rev, &alines); |
|
|
rcs_rev_getlines(cf->file_rcs, bnum, &alines); |
|
|
|
/* |
|
* Go into branch and receive annotations for branch revision, |
|
* with inverted "a" and "d" meaning. |
|
*/ |
|
if (bnum != rev) { |
|
rcs_annotate_getlines(cf->file_rcs, rev, &alines); |
|
rcsnum_free(bnum); |
|
} |
rcsnum_free(rev); |
rcsnum_free(rev); |
|
} else { |
|
rcs_rev_getlines(cf->file_rcs, cf->file_rcs->rf_head, &alines); |
} |
} |
|
|
/* Stick at weird GNU cvs, ignore error. */ |
/* Stick at weird GNU cvs, ignore error. */ |