418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
|
undo_all_filesystem(0);
}
/*
** COMMAND: undo
** COMMAND: redo*
**
** Usage: %fossil undo ?OPTIONS? ?FILENAME...?
** or: %fossil redo ?OPTIONS? ?FILENAME...?
**
** Undo the changes to the working checkout caused by the most recent
** of the following operations:
**
** (1) fossil update (5) fossil stash apply
** (2) fossil merge (6) fossil stash drop
** (3) fossil revert (7) fossil stash goto
|
|
|
|
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
|
undo_all_filesystem(0);
}
/*
** COMMAND: undo
** COMMAND: redo*
**
** Usage: %fossil undo ?OPTIONS? ?--? ?FILENAME...?
** or: %fossil redo ?OPTIONS? ?--? ?FILENAME...?
**
** Undo the changes to the working checkout caused by the most recent
** of the following operations:
**
** (1) fossil update (5) fossil stash apply
** (2) fossil merge (6) fossil stash drop
** (3) fossil revert (7) fossil stash goto
|
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
|
** have done had the -n|--dry-run been omitted.
**
** A single level of undo/redo is supported. The undo/redo stack
** is cleared by the commit and checkout commands.
**
** Options:
** -n|--dry-run do not make changes but show what would be done
**
** See also: commit, status
*/
void undo_cmd(void){
int isRedo = g.argv[1][0]=='r';
int undo_available;
int dryRunFlag = find_option("dry-run", "n", 0)!=0;
const char *zCmd = isRedo ? "redo" : "undo";
if( !dryRunFlag ){
dryRunFlag = find_option("explain", 0, 0)!=0;
}
db_must_be_within_tree();
verify_all_options();
db_begin_transaction();
undo_available = db_lget_int("undo_available", 0);
if( dryRunFlag ){
if( undo_available==0 ){
fossil_print("No undo or redo is available\n");
}else{
Stmt q;
|
>
>
|
|
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
|
** have done had the -n|--dry-run been omitted.
**
** A single level of undo/redo is supported. The undo/redo stack
** is cleared by the commit and checkout commands.
**
** Options:
** -n|--dry-run do not make changes but show what would be done
** -- Treat all following arguments as non-flags, even if
** they look like flags.
**
** See also: commit, status
*/
void undo_cmd(void){
int isRedo = g.argv[1][0]=='r';
int undo_available;
int dryRunFlag = find_option("dry-run", "n", 0)!=0;
const char *zCmd = isRedo ? "redo" : "undo";
if( !dryRunFlag ){
dryRunFlag = find_option("explain", 0, 0)!=0;
}
db_must_be_within_tree();
verify_all_options2();
db_begin_transaction();
undo_available = db_lget_int("undo_available", 0);
if( dryRunFlag ){
if( undo_available==0 ){
fossil_print("No undo or redo is available\n");
}else{
Stmt q;
|