fsl wrapper

Check-in [f6ef89b074]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Manually merged in the fork detection code. Also make most options work with partial match
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:f6ef89b074d9ac02f00074b1bd03b0d52686306a
User & Date: matt 2012-05-01 04:26:18
Context
2012-05-01
22:33
Closing the fork check-in: d07c519b39 user: mrwellan tags: trunk
04:26
Manually merged in the fork detection code. Also make most options work with partial match check-in: f6ef89b074 user: matt tags: trunk
03:28
forced a fork check-in: 2a1ded8b0b user: matt tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to scripts/fsl.

411
412
413
414
415
416
417










418
419
420
421
422
423
424


425
426
427
428
429
430
431
...
496
497
498
499
500
501
502
503

504
505
506
507
508
509
510

511
512
513
514
515

516

517
518
519
520
521

522
523
524
525
526
527
528
529
...
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
...
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
...
565
566
567
568
569
570
571






572
573
574
575
#======================================================================

# From fossil email list by Kriangkrai Soatthiyanont nb// was "U\1\2"
function fsl_conflicts () {
    export CONFLICT_FLAG_FILE=`mktemp`
    $FOSSILEXE "$@" | sed -r 's/^EDITED(\s+)(.*)/grep -q "< BEGIN MERGE CONFLICT:" "\2" \&\& rm -f $CONFLICT_FLAG_FILE \&\& echo "CONFLICT   \2" || echo "\0"/e'; 
}











#======================================================================
# T H E   M A I N   H A N D L E R   A N D   P R O C E S S I N G 
#======================================================================

# repo commands
case "x$1" in ("xrepo")


    fsl_dbinit
    case "x$2" in 
	xhelp)
	fsl_help
	exit
	;;
	
................................................................................
        # echo No force
	shift
	fsl_mv "$@"
	exit
    fi
    ;;

    "xtimeline")

    shift
    $FOSSILEXE timeline "$@" | sed -e :a -e '$!N;s/\n         / /;ta' -e 'P;D'
    exit
    ;;

    # leaves output needs to be niceified, no need for a function
    "xleaves")

    shift
    $FOSSILEXE leaves "$@" | sed -e :a -e '$!N;s/\n         / /;ta' -e 'P;D'
    exit
    ;;


    xchanges | xstatus)

    fsl_conflicts "$@"
    rm -f $CONFLICT_FLAG_FILE
    exit
    ;;


    xci | xcommit)
    fsl_conflicts changes "$@"
    if [ ! -e $CONFLICT_FLAG_FILE ]; then
	rm -f $CONFLICT_FLAG_FILE
	read -p "ERROR: Conflicts detected. Type \"yes\" to continue: " -e ANSWER
	if [ $ANSWER = "yes" ]; then
	    $FOSSILEXE "$@"
	else
................................................................................
	fi
    else
	$FOSSILEXE "$@"
    fi
    exit
    ;;

    "xtag")
    case "x$2" in
	xadd | xcancel)
	$FOSSILEXE "$@"
	$FOSSILEXE sync
	exit
	;;
	
................................................................................
	$FOSSILEXE "$@"
	exit
	;;
    esac
    ;;

    # add mention of repo to help
    xhelp)
    if [ $# -gt 1 ]; then
       case "x$2" in 
          xrepo)
          fsl_help
          exit
          ;;
          
................................................................................

       esac
    else
       $FOSSILEXE help | sed -e 's/sync/sync        repo/'
    fi
    exit
    ;;







esac	

exec $FOSSILEXE "$@"







>
>
>
>
>
>
>
>
>
>






|
>
>







 







|
>






|
>





>
|
>





>
|







 







|







 







|







 







>
>
>
>
>
>




411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
...
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
...
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
...
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
...
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
#======================================================================

# From fossil email list by Kriangkrai Soatthiyanont nb// was "U\1\2"
function fsl_conflicts () {
    export CONFLICT_FLAG_FILE=`mktemp`
    $FOSSILEXE "$@" | sed -r 's/^EDITED(\s+)(.*)/grep -q "< BEGIN MERGE CONFLICT:" "\2" \&\& rm -f $CONFLICT_FLAG_FILE \&\& echo "CONFLICT   \2" || echo "\0"/e'; 
}

# check for forks
function fsl_fork_find {
    forks=`echo "SELECT tagxref.value FROM leaf, tagxref WHERE leaf.rid=tagxref.rid and tagxref.value != '' group by tagxref.value having count(tagxref.value) > 1;"|$FOSSILEXE sql`
    if [ "x$forks" != "x" ]; then
        echo
        echo "WARNING!!! Fork(s) detected on $forks, use \"fsl leaves\" and \"fsl merge\" to find and correct."
        echo
    fi
}

#======================================================================
# T H E   M A I N   H A N D L E R   A N D   P R O C E S S I N G 
#======================================================================

# repo commands
case "x$1" in 
    # repo
    xrep*)
    fsl_dbinit
    case "x$2" in 
	xhelp)
	fsl_help
	exit
	;;
	
................................................................................
        # echo No force
	shift
	fsl_mv "$@"
	exit
    fi
    ;;

    xtim*)
    fsl_fork_find
    shift
    $FOSSILEXE timeline "$@" | sed -e :a -e '$!N;s/\n         / /;ta' -e 'P;D'
    exit
    ;;

    # leaves output needs to be niceified, no need for a function
    xle*)
    fsl_fork_find
    shift
    $FOSSILEXE leaves "$@" | sed -e :a -e '$!N;s/\n         / /;ta' -e 'P;D'
    exit
    ;;

    # changes and status
    xcha* | xstat*)
    fsl_fork_find
    fsl_conflicts "$@"
    rm -f $CONFLICT_FLAG_FILE
    exit
    ;;

    # ci/commit
    xci | xcom*)
    fsl_conflicts changes "$@"
    if [ ! -e $CONFLICT_FLAG_FILE ]; then
	rm -f $CONFLICT_FLAG_FILE
	read -p "ERROR: Conflicts detected. Type \"yes\" to continue: " -e ANSWER
	if [ $ANSWER = "yes" ]; then
	    $FOSSILEXE "$@"
	else
................................................................................
	fi
    else
	$FOSSILEXE "$@"
    fi
    exit
    ;;

    xtag)
    case "x$2" in
	xadd | xcancel)
	$FOSSILEXE "$@"
	$FOSSILEXE sync
	exit
	;;
	
................................................................................
	$FOSSILEXE "$@"
	exit
	;;
    esac
    ;;

    # add mention of repo to help
    "xhelp")
    if [ $# -gt 1 ]; then
       case "x$2" in 
          xrepo)
          fsl_help
          exit
          ;;
          
................................................................................

       esac
    else
       $FOSSILEXE help | sed -e 's/sync/sync        repo/'
    fi
    exit
    ;;

    xup*)
    fsl_fork_find
    $FOSSILEXE "$@"
    exit
    ;;

esac	

exec $FOSSILEXE "$@"