Fossil SCM

In the 'unsaved changes' error of the patch command, make it explicit that the patch cannot be applied (because it otherwise comes across as informational, not an error).

stephan 2024-09-05 09:19 trunk
Commit 8c5faa368ff19b8b2888f8313b4f8d5fd0c1c691feb5091082fed68ed9bf809c
1 file changed +2 -1
+2 -1
--- src/patch.c
+++ src/patch.c
@@ -384,11 +384,12 @@
384384
Blob cmd;
385385
386386
blob_init(&cmd, 0, 0);
387387
if( unsaved_changes(0) ){
388388
if( (mFlags & PATCH_FORCE)==0 ){
389
- fossil_fatal("there are unsaved changes in the current check-out");
389
+ fossil_fatal("Cannot apply patch: there are unsaved changes "
390
+ "in the current check-out");
390391
}else{
391392
blob_appendf(&cmd, "%$ revert", g.nameOfExe);
392393
if( mFlags & PATCH_DRYRUN ){
393394
fossil_print("%s\n", blob_str(&cmd));
394395
}else{
395396
--- src/patch.c
+++ src/patch.c
@@ -384,11 +384,12 @@
384 Blob cmd;
385
386 blob_init(&cmd, 0, 0);
387 if( unsaved_changes(0) ){
388 if( (mFlags & PATCH_FORCE)==0 ){
389 fossil_fatal("there are unsaved changes in the current check-out");
 
390 }else{
391 blob_appendf(&cmd, "%$ revert", g.nameOfExe);
392 if( mFlags & PATCH_DRYRUN ){
393 fossil_print("%s\n", blob_str(&cmd));
394 }else{
395
--- src/patch.c
+++ src/patch.c
@@ -384,11 +384,12 @@
384 Blob cmd;
385
386 blob_init(&cmd, 0, 0);
387 if( unsaved_changes(0) ){
388 if( (mFlags & PATCH_FORCE)==0 ){
389 fossil_fatal("Cannot apply patch: there are unsaved changes "
390 "in the current check-out");
391 }else{
392 blob_appendf(&cmd, "%$ revert", g.nameOfExe);
393 if( mFlags & PATCH_DRYRUN ){
394 fossil_print("%s\n", blob_str(&cmd));
395 }else{
396

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button