[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Cvs-cvs] ccvs/src ChangeLog commit.c logmsg.c sanity.sh
From: |
Derek Robert Price |
Subject: |
[Cvs-cvs] ccvs/src ChangeLog commit.c logmsg.c sanity.sh |
Date: |
Fri, 19 Sep 2008 17:25:46 +0000 |
CVSROOT: /cvsroot/cvs
Module name: ccvs
Changes by: Derek Robert Price <dprice> 08/09/19 17:25:45
Modified files:
src : ChangeLog commit.c logmsg.c sanity.sh
Log message:
* commit.c (commit): Don't set update_dir for client/server calls to
do_editor().
* logmsg.c (do_editor): Some cleanup.
* sanity.sh (editor): Update to compensate.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/ChangeLog?cvsroot=cvs&r1=1.3604&r2=1.3605
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/commit.c?cvsroot=cvs&r1=1.286&r2=1.287
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/logmsg.c?cvsroot=cvs&r1=1.113&r2=1.114
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/sanity.sh?cvsroot=cvs&r1=1.1207&r2=1.1208
Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/ChangeLog,v
retrieving revision 1.3604
retrieving revision 1.3605
diff -u -b -r1.3604 -r1.3605
--- ChangeLog 19 Sep 2008 17:11:27 -0000 1.3604
+++ ChangeLog 19 Sep 2008 17:25:43 -0000 1.3605
@@ -1,5 +1,10 @@
2008-09-19 Derek R. Price <address@hidden>
+ * commit.c (commit): Don't set update_dir for client/server calls to
+ do_editor().
+ * logmsg.c (do_editor): Some cleanup.
+ * sanity.sh (editor): Update to compensate.
+
* edit.c (ncheck_fileproc): Some cleanup.
* checkout.c (checkout_proc): Use empty update dir instead of ".".
Index: commit.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/commit.c,v
retrieving revision 1.286
retrieving revision 1.287
diff -u -b -r1.286 -r1.287
--- commit.c 18 Sep 2008 17:43:56 -0000 1.286
+++ commit.c 19 Sep 2008 17:25:44 -0000 1.287
@@ -553,7 +553,7 @@
* The protocol is designed this way. This is a feature.
*/
if (use_editor)
- do_editor (".", &saved_message, NULL, find_args.ulist);
+ do_editor (NULL, &saved_message, NULL, find_args.ulist);
/* We always send some sort of message, even if empty. */
option_with_arg ("-m", saved_message ? saved_message : "");
Index: logmsg.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/logmsg.c,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -b -r1.113 -r1.114
--- logmsg.c 17 Sep 2008 19:53:30 -0000 1.113
+++ logmsg.c 19 Sep 2008 17:25:44 -0000 1.114
@@ -248,7 +248,7 @@
* -e option to the CVS executable.
*/
void
-do_editor (const char *dir, char **messagep, const char *repository,
+do_editor (const char *update_dir, char **messagep, const char *repository,
List *changes)
{
static int reuse_log_message = 0;
@@ -259,10 +259,11 @@
struct stat pre_stbuf, post_stbuf;
int retcode = 0;
+ /* One or the other is set, but not both. */
assert (!current_parsed_root->isremote != !repository);
TRACE (TRACE_FUNCTION, "do_editor (%s, %s, %s)",
- dir, TRACE_NULL (*messagep), repository);
+ update_dir, TRACE_NULL (*messagep), repository);
if (noexec || reuse_log_message)
return;
@@ -273,16 +274,16 @@
again:
/* Create a temporary file. */
- if( ( fp = cvs_temp_file( &fname ) ) == NULL )
- error( 1, errno, "cannot create temporary file" );
+ if (!(fp = cvs_temp_file (&fname)))
+ error (1, errno, "cannot create temporary file");
if (*messagep)
{
- (void) fputs (*messagep, fp);
+ fputs (*messagep, fp);
if ((*messagep)[0] == '\0' ||
(*messagep)[strlen (*messagep) - 1] != '\n')
- (void) fprintf (fp, "\n");
+ fprintf (fp, "\n");
}
if (repository)
@@ -298,7 +299,7 @@
/* Why "b"? */
tfp = CVS_FOPEN (CVSADM_TEMPLATE, "rb");
- if (tfp == NULL)
+ if (!tfp)
{
if (!existence_error (errno))
error (1, errno, "cannot read %s", CVSADM_TEMPLATE);
@@ -324,20 +325,20 @@
}
}
- (void) fprintf (fp,
- "%s----------------------------------------------------------------------\n",
+ fprintf (fp,
+"%s----------------------------------------------------------------------\n",
CVSEDITPREFIX);
- (void) fprintf (fp,
- "%sEnter Log. Lines beginning with `%.*s' are removed automatically\n%s\n",
+ fprintf (fp,
+"%sEnter Log. Lines beginning with `%.*s' are removed automatically\n%s\n",
CVSEDITPREFIX, CVSEDITPREFIXLEN, CVSEDITPREFIX,
CVSEDITPREFIX);
- if (dir != NULL && *dir)
- (void) fprintf (fp, "%sCommitting in %s\n%s\n", CVSEDITPREFIX,
- dir, CVSEDITPREFIX);
- if (changes != NULL)
+ if (update_dir)
+ fprintf (fp, "%sCommitting in %s\n%s\n", CVSEDITPREFIX,
+ NULL2DOT (update_dir), CVSEDITPREFIX);
+ if (changes)
setup_tmpfile (fp, CVSEDITPREFIX, changes);
- (void) fprintf (fp,
- "%s----------------------------------------------------------------------\n",
+ fprintf (fp,
+"%s----------------------------------------------------------------------\n",
CVSEDITPREFIX);
/* finish off the temp file */
@@ -349,8 +350,8 @@
/* run the editor */
run_setup (Editor);
run_add_arg (fname);
- if ((retcode = run_exec (RUN_TTY, RUN_TTY, RUN_TTY,
- RUN_NORMAL | RUN_SIGIGNORE)) != 0)
+ if (retcode = run_exec (RUN_TTY, RUN_TTY, RUN_TTY,
+ RUN_NORMAL | RUN_SIGIGNORE))
error (0, retcode == -1 ? errno : 0, "warning: editor session failed");
/* put the entire message back into the *messagep variable */
@@ -369,7 +370,7 @@
{
/* On NT, we might read less than st_size bytes, but we won't
read more. So this works. */
- *messagep = (char *) xmalloc (post_stbuf.st_size + 1);
+ *messagep = xmalloc (post_stbuf.st_size + 1);
(*messagep)[0] = '\0';
}
@@ -394,7 +395,7 @@
if (offset + line_length >= message_len)
expand_string (messagep, &message_len,
offset + line_length + 1);
- (void) strcpy (*messagep + offset, line);
+ strcpy (*messagep + offset, line);
offset += line_length;
}
}
@@ -402,21 +403,21 @@
error (0, errno, "warning: cannot close %s", fname);
/* canonicalize emply messages */
- if (*messagep != NULL &&
- (**messagep == '\0' || STREQ (*messagep, "\n")))
+ if (*messagep &&
+ ((*messagep)[0] == '\0' || STREQ (*messagep, "\n")))
{
free (*messagep);
*messagep = NULL;
}
- if (pre_stbuf.st_mtime == post_stbuf.st_mtime || *messagep == NULL)
+ if (pre_stbuf.st_mtime == post_stbuf.st_mtime || !*messagep)
{
for (;;)
{
- (void) printf ("\nLog message unchanged or not specified\n");
- (void) printf ("a)bort, c)ontinue, e)dit, !)reuse this message
unchanged for remaining dirs\n");
- (void) printf ("Action: (continue) ");
- (void) fflush (stdout);
+ printf ("\nLog message unchanged or not specified\n");
+ printf ("a)bort, c)ontinue, e)dit, !)reuse this message unchanged
for remaining dirs\n");
+ printf ("Action: (continue) ");
+ fflush (stdout);
line_length = getline (&line, &line_chars_allocated, stdin);
if (line_length < 0)
{
@@ -432,7 +433,8 @@
if (*line == 'a' || *line == 'A')
{
if (unlink_file (fname) < 0)
- error (0, errno, "warning: cannot remove temp file %s",
fname);
+ error (0, errno, "warning: cannot remove temp file %s",
+ quote (fname));
error (1, 0, "aborted by user");
}
if (*line == 'e' || *line == 'E')
@@ -442,7 +444,7 @@
reuse_log_message = 1;
break;
}
- (void) printf ("Unknown input\n");
+ printf ("Unknown input\n");
}
}
if (line)
Index: sanity.sh
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/sanity.sh,v
retrieving revision 1.1207
retrieving revision 1.1208
diff -u -b -r1.1207 -r1.1208
--- sanity.sh 19 Sep 2008 16:16:39 -0000 1.1207
+++ sanity.sh 19 Sep 2008 17:25:44 -0000 1.1208
@@ -16913,8 +16913,17 @@
"$CVSROOT_DIRNAME/first-dir/file2,v <-- file2
new revision: 1\.1\.2\.1; previous revision: 1\.1"
- dotest editor-log-file1 "${testcvs} log -N file1" "
-RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
+ if $remote; then
+ CITEXT=
+ else
+ CITEXT=\
+"xCVS: Committing in \\.
+xCVS:
+"
+ fi
+
+ dotest editor-log-file1 "$testcvs log -N file1" "
+RCS file: $CVSROOT_DIRNAME/first-dir/file1,v
Working file: file1
head: 1\.1
branch:
@@ -16925,25 +16934,21 @@
description:
----------------------------
revision 1\.1
-date: ${ISO8601DATE}; author: ${username}; state: Exp; commitid:
${commitid};
+date: $ISO8601DATE; author: $username; state: Exp; commitid: $commitid;
branches: 1\.1\.2;
${log_keyid}xCVS:
----------------------------------------------------------------------
xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
xCVS:
-xCVS: Committing in .
-xCVS:
-xCVS: Added Files:
+${CITEXT}xCVS: Added Files:
xCVS: file1 file2
xCVS: ----------------------------------------------------------------------
----------------------------
revision 1\.1\.2\.1
-date: ${ISO8601DATE}; author: ${username}; state: Exp; lines: ${PLUS}1 -0;
commitid: ${commitid};
+date: $ISO8601DATE; author: $username; state: Exp; lines: ${PLUS}1 -0;
commitid: $commitid;
${log_keyid}xCVS:
----------------------------------------------------------------------
xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
xCVS:
-xCVS: Committing in .
-xCVS:
-xCVS: Modified Files:
+${CITEXT}xCVS: Modified Files:
xCVS: Tag: br
xCVS: file1
xCVS: ----------------------------------------------------------------------
@@ -16951,8 +16956,8 @@
# The only difference between the two expect strings is the
# presence or absence of "Committing in ." for 1.1.2.1.
- dotest editor-log-file2 "${testcvs} log -N file2" "
-RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
+ dotest editor-log-file2 "$testcvs log -N file2" "
+RCS file: $CVSROOT_DIRNAME/first-dir/file2,v
Working file: file2
head: 1\.1
branch:
@@ -16963,19 +16968,17 @@
description:
----------------------------
revision 1\.1
-date: ${ISO8601DATE}; author: ${username}; state: Exp; commitid:
${commitid};
+date: $ISO8601DATE; author: $username; state: Exp; commitid: $commitid;
branches: 1\.1\.2;
${log_keyid}xCVS:
----------------------------------------------------------------------
xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
xCVS:
-xCVS: Committing in .
-xCVS:
-xCVS: Added Files:
+${CITEXT}xCVS: Added Files:
xCVS: file1 file2
xCVS: ----------------------------------------------------------------------
----------------------------
revision 1\.1\.2\.1
-date: ${ISO8601DATE}; author: ${username}; state: Exp; lines: ${PLUS}1 -0;
commitid: ${commitid};
+date: $ISO8601DATE; author: $username; state: Exp; lines: ${PLUS}1 -0;
commitid: $commitid;
${log_keyid}xCVS:
----------------------------------------------------------------------
xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
xCVS:
@@ -16995,25 +16998,21 @@
description:
----------------------------
revision 1\.1
-date: ${ISO8601DATE}; author: ${username}; state: Exp; commitid:
${commitid};
+date: $ISO8601DATE; author: $username; state: Exp; commitid: $commitid;
branches: 1\.1\.2;
${log_keyid}xCVS:
----------------------------------------------------------------------
xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
xCVS:
-xCVS: Committing in .
-xCVS:
-xCVS: Added Files:
+${CITEXT}xCVS: Added Files:
xCVS: file1 file2
xCVS: ----------------------------------------------------------------------
----------------------------
revision 1\.1\.2\.1
-date: ${ISO8601DATE}; author: ${username}; state: Exp; lines: ${PLUS}1 -0;
commitid: ${commitid};
+date: $ISO8601DATE; author: $username; state: Exp; lines: ${PLUS}1 -0;
commitid: $commitid;
${log_keyid}xCVS:
----------------------------------------------------------------------
xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
xCVS:
-xCVS: Committing in .
-xCVS:
-xCVS: Modified Files:
+${CITEXT}xCVS: Modified Files:
xCVS: Tag: br
xCVS: file2
xCVS: ----------------------------------------------------------------------
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Cvs-cvs] ccvs/src ChangeLog commit.c logmsg.c sanity.sh,
Derek Robert Price <=