aboutsummaryrefslogtreecommitdiffstats
path: root/CVSROOT
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1995-09-02 12:10:49 +0800
committerpeter <peter@FreeBSD.org>1995-09-02 12:10:49 +0800
commit4a72738369ac07d206d2626f1ac8f237813a9cd2 (patch)
tree71e06cfa18cb1787e12afbb14474aaa8ecdac8f7 /CVSROOT
parentde6c545d193f08034eaa1751fc3f632b089c713f (diff)
downloadfreebsd-ports-gnome-4a72738369ac07d206d2626f1ac8f237813a9cd2.tar.gz
freebsd-ports-gnome-4a72738369ac07d206d2626f1ac8f237813a9cd2.tar.zst
freebsd-ports-gnome-4a72738369ac07d206d2626f1ac8f237813a9cd2.zip
Correct cvsedit so that it does the 'right thing' (TM) when the user
quits without saving. Previously, it would cause cvs to abort the commit without giving any warning. Now, it does that cvs normally does when the user quits without saving, ie: ask if you want to abort, or use the empty message, or re-edit.
Diffstat (limited to 'CVSROOT')
-rwxr-xr-xCVSROOT/cvsedit15
1 files changed, 7 insertions, 8 deletions
diff --git a/CVSROOT/cvsedit b/CVSROOT/cvsedit
index 968665459329..354ab034db24 100755
--- a/CVSROOT/cvsedit
+++ b/CVSROOT/cvsedit
@@ -6,7 +6,7 @@
# To use this, make it executable, and set your editinfo DEFAULT line:
# DEFAULT /path/to/this/program
#
-# $Id: cvsedit,v 1.7 1995/08/27 23:07:50 peter Exp $
+# $Id: cvsedit,v 1.8 1995/08/28 12:14:04 rgrimes Exp $
#
# same rules as CVS
@@ -79,17 +79,16 @@ while(<IN>) {
close(IN);
close(OUT);
-# sanity check...
-if (!$first) {
- die("cvsedit: Empty log message not permitted!\n");
-}
-
unlink($filename . "~"); # Nuke likely editor backups..
unlink($filename . ".bak"); # Nuke likely editor backups..
-# Check to see if any differences. preserve stat() info if not.
+# Check to see if any differences.
$different = system("cmp -s $tmpfile $filename");
-if (!$different) {
+
+# Make a clean exit if there are no changes, or there is no 'text'
+# - for example, a user quit the editor without saving.
+# preserve stat() info if appropriate.
+if (!$different || !$first) {
unlink($tmpfile);
exit(0);
}