home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / rcs / sources / no_diffe.c < prev    next >
C/C++ Source or Header  |  1992-01-19  |  2KB  |  65 lines

  1. #ifndef lint
  2. static char rcsid[] = "$Id: no_difference.c,v 1.7.1.1 91/01/29 07:18:06 berliner Exp $";
  3. #endif 
  4.  
  5. /*
  6.  *    Copyright (c) 1989, Brian Berliner
  7.  *
  8.  *    You may distribute under the terms of the GNU General Public License
  9.  *    as specified in the README file that comes with the CVS 1.0 kit.
  10.  *
  11.  * No Difference
  12.  *
  13.  * The user file looks modified judging from its time stamp; however
  14.  * it needn't be.  No_difference() finds out whether it is or not.
  15.  * If it is, it adds its name to the Mlist.
  16.  * If it is not, it updates the administration.
  17.  *
  18.  * If we're deciding if a modified file that is to be merged is really
  19.  * modified (doGlist is set), we add the name to the Glist if it really
  20.  * is modified, otherwise it is added to the Olist to be simply extracted.
  21.  *
  22.  * Returns non-zero on error.
  23.  */
  24.  
  25. #include "cvs.h"
  26.  
  27. No_Difference(doGlist)
  28.     int doGlist;
  29. {
  30.     char tmp[MAXPATHLEN];
  31.  
  32.     (void) sprintf(tmp, "%s%c%s%s", CVSADM, DIRSEP, CVSPREFIX, User);
  33.     (void) sprintf(prog, "%s -p -q -r%s %s >%s", RCS_CO, VN_User, Rcs, tmp);
  34.     if (system(prog) == 0) {
  35.     if (xcmp(User, tmp) == 0) {
  36.         if (cvswrite == FALSE)
  37.         xchmod(User, 0);
  38.         Version_TS(Rcs, Tag, User);
  39.         (void) strcpy(TS_Rcs, TS_User);
  40.         Register(User, VN_User[0] ? VN_User : VN_Rcs, TS_User);
  41.         if (doGlist) {
  42.         (void) strcat(Olist, " ");
  43.         (void) strcat(Olist, User);
  44.         }
  45.     } else {
  46.         if (!iswritable(User))
  47.         xchmod(User, 1);
  48.         Version_TS(Rcs, Tag, User);
  49.         if (doGlist) {
  50.         (void) strcat(Glist, " ");
  51.         (void) strcat(Glist, User);
  52.         } else {
  53.         (void) strcat(Mlist, " ");
  54.         (void) strcat(Mlist, User);
  55.         }
  56.     }
  57.     (void) unlink(tmp);
  58.     } else {
  59.     warn(0, "could not check out revision %s of %s", VN_User, User);
  60.     (void) unlink(tmp);
  61.     return (1);
  62.     }
  63.     return (0);
  64. }
  65.