[BACK]Return to ci.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / rcs

Diff for /src/usr.bin/rcs/ci.c between version 1.37 and 1.38

version 1.37, 2005/10/16 14:10:57 version 1.38, 2005/10/16 22:23:54
Line 77 
Line 77 
         RCSNUM *frev, *newrev;          RCSNUM *frev, *newrev;
         char fpath[MAXPATHLEN];          char fpath[MAXPATHLEN];
         char *rcs_msg, *filec, *deltatext, *username;          char *rcs_msg, *filec, *deltatext, *username;
           const char *symbol = NULL;
         struct rcs_lock *lkp;          struct rcs_lock *lkp;
         BUF *bp;          BUF *bp;
   
Line 88 
Line 89 
         interactive = 1;          interactive = 1;
   
   
         while ((ch = rcs_getopt(argc, argv, "d::f::j:k:l::m:M:N:qr::u::Vw:")) != -1) {          while ((ch = rcs_getopt(argc, argv, "d::f::j:k:l::m:M:N:n:qr::u::Vw:")) != -1) {
                 switch (ch) {                  switch (ch) {
                 case 'd':                  case 'd':
                         if (rcs_optarg == NULL)                          if (rcs_optarg == NULL)
Line 124 
Line 125 
                         interactive = 0;                          interactive = 0;
                         cvs_printf("rcs_msg: %s\n", rcs_msg);                          cvs_printf("rcs_msg: %s\n", rcs_msg);
                         break;                          break;
                   case 'n':
                           if ((symbol = strdup(rcs_optarg)) == NULL) {
                                   cvs_log(LP_ERRNO, "out of memory");
                                   exit(1);
                           }
                           if (rcs_sym_check(symbol) != 1) {
                                   cvs_log(LP_ERR, "invalid symbol `%s'", symbol);
                                   exit(1);
                           }
                           break;
                 case 'q':                  case 'q':
                         verbose = 0;                          verbose = 0;
                         break;                          break;
Line 322 
Line 333 
                 if (rcs_deltatext_set(file, frev, filec) == -1) {                  if (rcs_deltatext_set(file, frev, filec) == -1) {
                         cvs_log(LP_ERR, "failed to set new head revision");                          cvs_log(LP_ERR, "failed to set new head revision");
                         exit(1);                          exit(1);
                   }
   
                   /*
                    * Attach a symbolic name to this revision if specified.
                    */
                   if (symbol != NULL) {
                           cvs_printf("symbol: %s\n", symbol);
                           int ret = 0;
                           if ((ret = rcs_sym_add(file, symbol, newrev) == -1)
                               && (rcs_errno == RCS_ERR_DUPENT)) {
                                   char tmp[16];
                                   rcsnum_tostr(rcs_sym_getrev(file, symbol), tmp, sizeof(tmp));
                                   cvs_log(LP_ERR, "symbolic name %s already bound to %s",
                                       symbol, tmp);
                                   status = 1;
                                   rcs_close(file);
                                   continue;
                           } else if (ret == -1) {
                                   cvs_printf("problem adding symbol: %s\n", symbol);
                                   status = 1;
                                   rcs_close(file);
                                   continue;
                           }
                 }                  }
   
                 free(deltatext);                  free(deltatext);

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38