diff options
author | 2007-01-05 07:13:49 +0000 | |
---|---|---|
committer | 2007-01-05 07:13:49 +0000 | |
commit | 93c883946d98a93e4b7b9aa3c9ee0f9bf35e1570 (patch) | |
tree | 55b6dc8bda63057157f19c1bf9552827876f623e /usr.bin/cvs/edit.c | |
parent | First shot of making the driver capable to parse several firmware files (diff) | |
download | wireguard-openbsd-93c883946d98a93e4b7b9aa3c9ee0f9bf35e1570.tar.xz wireguard-openbsd-93c883946d98a93e4b7b9aa3c9ee0f9bf35e1570.zip |
- introduce file comparison routine, cvs_file_cmp().
- compare the <file> in working dir and the one in CVS/Base/<file>
for the unedit command.
hints otto@, input and ok ray@ niallo@.
Diffstat (limited to 'usr.bin/cvs/edit.c')
-rw-r--r-- | usr.bin/cvs/edit.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.bin/cvs/edit.c b/usr.bin/cvs/edit.c index b745509e20d..189d688b70d 100644 --- a/usr.bin/cvs/edit.c +++ b/usr.bin/cvs/edit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: edit.c,v 1.16 2007/01/03 09:49:37 xsa Exp $ */ +/* $OpenBSD: edit.c,v 1.17 2007/01/05 07:13:49 xsa Exp $ */ /* * Copyright (c) 2006, 2007 Xavier Santolaria <xsa@openbsd.org> * @@ -177,7 +177,15 @@ cvs_unedit_local(struct cvs_file *cf) return; } - /* XXX: compare cf->file_path and bfpath */ + if (cvs_file_cmp(cf->file_path, bfpath) != 0) { + cvs_printf("%s has been modified; revert changes? ", + cf->file_name); + + if (cvs_yesno() == -1) { + xfree(bfpath); + return; + } + } cvs_rename(bfpath, cf->file_path); xfree(bfpath); |