--------------------- PatchSet 176 Date: 2005/05/24 19:57:37 Author: david Branch: HEAD Tag: (none) Log: show branch ancestry Members: cvsps.c:4.99->4.100 cvsps_types.h:4.9->4.10 Index: cvsps/cvsps.c diff -u cvsps/cvsps.c:4.99 cvsps/cvsps.c:4.100 --- cvsps/cvsps.c:4.99 Wed Jan 26 14:46:41 2005 +++ cvsps/cvsps.c Tue May 24 15:57:37 2005 @@ -26,7 +26,7 @@ #include "cap.h" #include "cvs_direct.h" -RCSID("$Id: cvsps.c,v 4.99 2005/01/26 19:46:41 david Exp $"); +RCSID("$Id: cvsps.c,v 4.100 2005/05/24 19:57:37 david Exp $"); #define CVS_LOG_BOUNDARY "----------------------------\n" #define CVS_FILE_BOUNDARY "=============================================================================\n" @@ -75,6 +75,7 @@ static int do_write_cache; static int statistics; static const char * test_log_file; +static struct hash_table * branch_heads; /* settable via options */ static int timestamp_fuzz_factor = 300; @@ -101,6 +102,7 @@ static int cvs_direct; static int compress; static char compress_arg[8]; +static int track_branch_ancestry; static void check_norc(int, char *[]); static int parse_args(int, char *[]); @@ -112,7 +114,7 @@ static void assign_pre_revision(PatchSetMember *, CvsFileRevision * rev); static void check_print_patch_set(PatchSet *); static void print_patch_set(PatchSet *); -static void set_ps_id(const void *, const VISIT, const int); +static void walk_all_ps(const void *, const VISIT, const int); static void show_ps_tree_node(const void *, const VISIT, const int); static int compare_patch_sets_bk(const void *, const void *); static int compare_patch_sets(const void *, const void *); @@ -131,6 +133,7 @@ static int check_rev_funk(PatchSet *, CvsFileRevision *); static CvsFileRevision * rev_follow_branch(CvsFileRevision *, const char *); static int before_tag(CvsFileRevision * rev, const char * tag); +static void determine_branch_ancestor(PatchSet * ps, PatchSet * head_ps); int main(int argc, char *argv[]) { @@ -164,6 +167,7 @@ file_hash = create_hash_table(1023); global_symbols = create_hash_table(111); + branch_heads = create_hash_table(1023); /* this parses some of the CVS/ files, and initializes * the repository_path and other variables @@ -197,7 +201,7 @@ } ps_counter = 0; - twalk(ps_tree_bytime, set_ps_id); + twalk(ps_tree_bytime, walk_all_ps); resolve_global_symbols(); @@ -536,7 +540,7 @@ debug(DEBUG_APPERROR, " [--test-log ] [--bkcvs]"); debug(DEBUG_APPERROR, " [--no-rlog] [--diff-opts