summaryrefslogtreecommitdiffstats
path: root/contrib/cvs/src/classify.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/cvs/src/classify.c')
-rw-r--r--contrib/cvs/src/classify.c245
1 files changed, 92 insertions, 153 deletions
diff --git a/contrib/cvs/src/classify.c b/contrib/cvs/src/classify.c
index b0084a3..9a6489e 100644
--- a/contrib/cvs/src/classify.c
+++ b/contrib/cvs/src/classify.c
@@ -74,6 +74,7 @@ Classify_File (finfo, tag, date, options, force_tag_match, aflag, versp,
}
else if (RCS_isdead (vers->srcfile, vers->vn_rcs))
{
+ /* there is an RCS file, but it's dead */
if (vers->ts_user == NULL)
ret = T_UPTODATE;
else
@@ -83,43 +84,17 @@ Classify_File (finfo, tag, date, options, force_tag_match, aflag, versp,
ret = T_UNKNOWN;
}
}
- else
+ else if (!pipeout && vers->ts_user && No_Difference (finfo, vers))
{
- /* there is an rcs file */
-
- if (vers->ts_user == NULL)
- {
- /* There is no user file; needs checkout */
- ret = T_CHECKOUT;
- }
- else
- {
- if (pipeout)
- {
- /*
- * The user file doesn't necessarily have anything
- * to do with this.
- */
- ret = T_CHECKOUT;
- }
- /*
- * There is a user file; print a warning and add it to the
- * conflict list, only if it is indeed different from what we
- * plan to extract
- */
- else if (No_Difference (finfo, vers))
- {
- /* the files were different so it is a conflict */
- if (!really_quiet)
- error (0, 0, "move away %s; it is in the way",
- finfo->fullname);
- ret = T_CONFLICT;
- }
- else
- /* since there was no difference, still needs checkout */
- ret = T_CHECKOUT;
- }
+ /* the files were different so it is a conflict */
+ if (!really_quiet)
+ error (0, 0, "move away %s; it is in the way",
+ finfo->fullname);
+ ret = T_CONFLICT;
}
+ else
+ /* no user file or no difference, just checkout */
+ ret = T_CHECKOUT;
}
else if (strcmp (vers->vn_user, "0") == 0)
{
@@ -135,44 +110,35 @@ Classify_File (finfo, tag, date, options, force_tag_match, aflag, versp,
error (0, 0, "warning: new-born %s has disappeared", finfo->fullname);
ret = T_REMOVE_ENTRY;
}
+ else if (vers->vn_rcs == NULL ||
+ RCS_isdead (vers->srcfile, vers->vn_rcs))
+ /* No RCS file or RCS file revision is dead */
+ ret = T_ADDED;
else
{
- /* There is a user file */
-
- if (vers->vn_rcs == NULL)
- /* There is no RCS file, added file */
- ret = T_ADDED;
- else if (RCS_isdead (vers->srcfile, vers->vn_rcs))
- /* we are resurrecting. */
- ret = T_ADDED;
+ if (vers->srcfile->flags & INATTIC
+ && vers->srcfile->flags & VALID)
+ {
+ /* This file has been added on some branch other than
+ the one we are looking at. In the branch we are
+ looking at, the file was already valid. */
+ if (!really_quiet)
+ error (0, 0,
+ "conflict: %s has been added, but already exists",
+ finfo->fullname);
+ }
else
{
- if (vers->srcfile->flags & INATTIC
- && vers->srcfile->flags & VALID)
- {
- /* This file has been added on some branch other than
- the one we are looking at. In the branch we are
- looking at, the file was already valid. */
- if (!really_quiet)
- error (0, 0,
- "\
-conflict: %s has been added, but already exists",
- finfo->fullname);
- }
- else
- {
- /*
- * There is an RCS file, so someone else must have checked
- * one in behind our back; conflict
- */
- if (!really_quiet)
- error (0, 0,
- "\
-conflict: %s created independently by second party",
- finfo->fullname);
- }
- ret = T_CONFLICT;
+ /*
+ * There is an RCS file, so someone else must have checked
+ * one in behind our back; conflict
+ */
+ if (!really_quiet)
+ error (0, 0,
+ "conflict: %s created independently by second party",
+ finfo->fullname);
}
+ ret = T_CONFLICT;
}
}
else if (vers->vn_user[0] == '-')
@@ -193,14 +159,18 @@ conflict: %s created independently by second party",
*/
ret = T_REMOVE_ENTRY;
}
- else if (vers->vn_rcs == NULL
- ? vers->vn_user[1] == '\0'
- : strcmp (vers->vn_rcs, vers->vn_user + 1) == 0)
+ else if (strcmp (vers->vn_rcs, vers->vn_user + 1) == 0)
/*
* The RCS file is the same version as the user file was, and
* that's OK; remove it
*/
ret = T_REMOVED;
+ else if (pipeout)
+ /*
+ * The RCS file doesn't match the user's file, but it doesn't
+ * matter in this case
+ */
+ ret = T_NEEDS_MERGE;
else
{
@@ -227,7 +197,7 @@ conflict: %s created independently by second party",
else
{
/* A normal entry, TS_Rcs is valid */
- if (vers->vn_rcs == NULL)
+ if (vers->vn_rcs == NULL || RCS_isdead (vers->srcfile, vers->vn_rcs))
{
/* There is no RCS file */
@@ -251,30 +221,23 @@ conflict: %s created independently by second party",
finfo->fullname);
ret = T_REMOVE_ENTRY;
}
- else
+ else if (No_Difference (finfo, vers))
{
- /*
- * The user file has been modified and since it is no longer
- * in the repository, a conflict is raised
- */
- if (No_Difference (finfo, vers))
- {
- /* they are different -> conflict */
- if (!really_quiet)
- error (0, 0,
+ /* they are different -> conflict */
+ if (!really_quiet)
+ error (0, 0,
"conflict: %s is modified but no longer in the repository",
finfo->fullname);
- ret = T_CONFLICT;
- }
- else
- {
- /* they weren't really different */
- if (!really_quiet)
- error (0, 0,
- "warning: %s is not (any longer) pertinent",
- finfo->fullname);
- ret = T_REMOVE_ENTRY;
- }
+ ret = T_CONFLICT;
+ }
+ else
+ {
+ /* they weren't really different */
+ if (!really_quiet)
+ error (0, 0,
+ "warning: %s is not (any longer) pertinent",
+ finfo->fullname);
+ ret = T_REMOVE_ENTRY;
}
}
else if (strcmp (vers->vn_rcs, vers->vn_user) == 0)
@@ -321,50 +284,39 @@ conflict: %s created independently by second party",
ret = T_UPTODATE;
}
}
- else
+ else if (No_Difference (finfo, vers))
{
/*
- * The user file appears to have been modified, but we call
- * No_Difference to verify that it really has been modified
+ * they really are different; modified if we aren't
+ * changing any sticky -k options, else needs merge
*/
- if (No_Difference (finfo, vers))
- {
-
- /*
- * they really are different; modified if we aren't
- * changing any sticky -k options, else needs merge
- */
#ifdef XXX_FIXME_WHEN_RCSMERGE_IS_FIXED
- if (strcmp (vers->entdata->options ?
- vers->entdata->options : "", vers->options) == 0)
- ret = T_MODIFIED;
- else
- ret = T_NEEDS_MERGE;
-#else
+ if (strcmp (vers->entdata->options ?
+ vers->entdata->options : "", vers->options) == 0)
ret = T_MODIFIED;
- sticky_ck (finfo, aflag, vers);
-#endif
- }
else
- {
- /* file has not changed; check out if -k changed */
- if (strcmp (vers->entdata->options ?
- vers->entdata->options : "", vers->options) != 0)
- {
- ret = T_CHECKOUT;
- }
- else
- {
+ ret = T_NEEDS_MERGE;
+#else
+ ret = T_MODIFIED;
+ sticky_ck (finfo, aflag, vers);
+#endif
+ }
+ else if (strcmp (vers->entdata->options ?
+ vers->entdata->options : "", vers->options) != 0)
+ {
+ /* file has not changed; check out if -k changed */
+ ret = T_CHECKOUT;
+ }
+ else
+ {
- /*
- * else -> note that No_Difference will Register the
- * file already for us, using the new tag/date. This
- * is the desired behaviour
- */
- ret = T_UPTODATE;
- }
- }
+ /*
+ * else -> note that No_Difference will Register the
+ * file already for us, using the new tag/date. This
+ * is the desired behaviour
+ */
+ ret = T_UPTODATE;
}
}
else
@@ -388,7 +340,6 @@ conflict: %s created independently by second party",
/*
* The user file is still unmodified, so just get it as well
*/
-#ifdef SERVER_SUPPORT
if (strcmp (vers->entdata->options ?
vers->entdata->options : "", vers->options) != 0
|| (vers->srcfile != NULL
@@ -396,31 +347,19 @@ conflict: %s created independently by second party",
ret = T_CHECKOUT;
else
ret = T_PATCH;
-#else
- ret = T_CHECKOUT;
-#endif
}
+ else if (No_Difference (finfo, vers))
+ /* really modified, needs to merge */
+ ret = T_NEEDS_MERGE;
+ else if ((strcmp (vers->entdata->options ?
+ vers->entdata->options : "", vers->options)
+ != 0)
+ || (vers->srcfile != NULL
+ && (vers->srcfile->flags & INATTIC) != 0))
+ /* not really modified, check it out */
+ ret = T_CHECKOUT;
else
- {
- if (No_Difference (finfo, vers))
- /* really modified, needs to merge */
- ret = T_NEEDS_MERGE;
-#ifdef SERVER_SUPPORT
- else if ((strcmp (vers->entdata->options ?
- vers->entdata->options : "", vers->options)
- != 0)
- || (vers->srcfile != NULL
- && (vers->srcfile->flags & INATTIC) != 0))
- /* not really modified, check it out */
- ret = T_CHECKOUT;
- else
- ret = T_PATCH;
-#else
- else
- /* not really modified, check it out */
- ret = T_CHECKOUT;
-#endif
- }
+ ret = T_PATCH;
}
}
OpenPOWER on IntegriCloud