649 |
|
|
650 |
|
|
651 |
|
|
|
/* |
|
|
* file_has_conflict |
|
|
* |
|
|
* This function compares the timestamp of a file with ts_conflict set |
|
|
* to the timestamp on the actual file and returns TRUE or FALSE based |
|
|
* on the results. |
|
|
* |
|
|
* This function does not check for actual markers in the file and |
|
|
* file_has_markers() function should be called when that is interesting. |
|
|
* |
|
|
* ASSUMPTIONS |
|
|
* The ts_conflict field is not NULL. |
|
|
* |
|
|
* RETURNS |
|
|
* TRUE ts_conflict matches the current timestamp. |
|
|
* FALSE The ts_conflict field does not match the file's |
|
|
* timestamp. |
|
|
*/ |
|
|
int |
|
|
file_has_conflict (finfo, ts_conflict) |
|
|
const struct file_info *finfo; |
|
|
const char *ts_conflict; |
|
|
{ |
|
|
char *filestamp; |
|
|
int retcode; |
|
|
|
|
|
/* If ts_conflict is NULL, there was no merge since the last |
|
|
* commit and there can be no conflict. |
|
|
*/ |
|
|
assert (ts_conflict); |
|
|
|
|
|
/* |
|
|
* If the timestamp has changed and no |
|
|
* conflict indicators are found, it isn't a |
|
|
* conflict any more. |
|
|
*/ |
|
|
|
|
|
if (server_active) |
|
|
retcode = ts_conflict[0] == '='; |
|
|
else |
|
|
{ |
|
|
filestamp = time_stamp (finfo->file); |
|
|
retcode = !strcmp (ts_conflict, filestamp); |
|
|
free (filestamp); |
|
|
} |
|
|
|
|
|
return retcode; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
652 |
/* Does the file FINFO contain conflict markers? The whole concept |
/* Does the file FINFO contain conflict markers? The whole concept |
653 |
of looking at the contents of the file to figure out whether there are |
of looking at the contents of the file to figure out whether there are |
654 |
unresolved conflicts is kind of bogus (people do want to manage files |
unresolved conflicts is kind of bogus (people do want to manage files |