Ignore:
Timestamp:
05/28/08 08:27:48 (5 years ago)
Author:
<walter.franzini@…>
Hash name:
20080528062748-bb3d1-0edbfa79f9cacc8e2cf0182ff091c73d38bfb3b9
Message:

enable tags for the aegis target back-end

Now the aegis target back-end add a delta_name for each tags contained
in a changeset

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test-scripts/test-darcs2aegis-simple.sh

    r1565 r1566  
    33# Copyright (C) 2008 Walter Franzini 
    44# 
    5  
    6  
     5# NOTE: TABS in aegis metadata samples below must be preserved. 
     6# 
     7 
     8# 
     9# This test expects to be run from the tailor top source dir, change 
     10# the following line if the convention used by tailor developer(s) 
     11# differs. 
     12# 
    713here=`pwd` 
    814 
     
    6167 
    6268 
     69# 
     70# This test follows Aegis convention, where a test must be able to 
     71# work even when the development directory is not writable, this 
     72# happens when running tests in the integration stage. 
     73# 
    6374work=${TMPDIR-/tmp}/TAILOR.$$ 
    6475mkdir $work 
     
    214225cat > $work/tailor.conf <<EOF 
    215226[DEFAULT] 
    216 verbose = True 
    217 Debug = True 
     227verbose = true 
     228Debug = true 
    218229 
    219230[project] 
     
    246257 
    247258activity="check aegis project history" 
    248 aegis -list project_history -unformatted 2> log | cut -d\  -f 1,7- > history 
    249 if test $? -ne 0; then cat history; no_result; fi 
    250  
    251 diff ok history 
     259aegis -list project_history -unformatted 2> $work/log \ 
     260    | cut -d\  -f 1,7- > $work/history 
     261if test $? -ne 0; then cat $work/log; no_result; fi 
     262 
     263diff -u $work/ok $work/history 
    252264if test $? -ne 0; then fail; fi 
    253265 
     
    266278if test $? -ne 0; then cat log; no_result; fi 
    267279 
     280activity="tag 1.0.0" 
     281darcs tag 1.0.0 --repodir=$work/darcs-repo -A Nobody > log 2>&1 
     282if test $? -ne 0; then cat log; no_result; fi 
     283 
    268284cat > $work/logfile <<EOF 
    269285fourth commit 
     
    282298if test $? -ne 0; then cat log; fail; fi 
    283299 
     300# 
     301# Check the aegis project history. 
     302# fixme:  there is a gap in the change number sequence (13 is missing) 
     303#         because currently the change corresponding to the tags is 
     304#         still created even if it cannot be completed because it's empty 
     305# 
     306activity="check aegis project history (again)" 
     307 
    284308cat > $work/ok <<EOF 
    2853091 10 initial commit 
    2863102 11 second commit 
     311Name: "1.0.0" 
    2873123 12 third commit 
    288 4 13 fourth commit 
    289 EOF 
    290 if test $? -ne 0; then no_result; fi 
    291  
    292 activity="check aegis project history" 
    293 aegis -list project_history -unformatted 2> log | cut -d\  -f 1,7- > history 
     3134 14 fourth commit 
     314EOF 
     315if test $? -ne 0; then no_result; fi 
     316 
     317aegis -list project_history -unformatted 2> log > history 
    294318if test $? -ne 0; then cat history; no_result; fi 
    295319 
    296 diff ok history 
    297 if test $? -ne 0; then fail; fi 
    298  
     320cat > $work/massage_history.awk <<'EOF' 
     321/^Name:/ {print $0} 
     322/^[0-9]/ {print $1, $7, $8, $9} 
     323EOF 
     324if test $? -ne 0; then no_result; fi 
     325 
     326awk -f $work/massage_history.awk < history > history.new 
     327if test $? -ne 0; then no_result; fi 
     328 
     329diff -u ok history.new 
     330if test $? -ne 0; then fail; fi 
     331 
     332activity="check change 14 attributes" 
    299333cat > $work/ok <<EOF 
    300334brief_description = "fourth commit"; 
     
    316350if test $? -ne 0; then no_result; fi 
    317351 
    318 activity="check project content" 
    319 aegis -ca -l 13 > $work/change_attr 2> log 
     352aegis -ca -l 14 > $work/change_attr 2> log 
    320353if test $? -ne 0; then cat log; no_result; fi 
    321354 
     
    336369if test $? -ne 0; then no_result; fi 
    337370 
    338 diff $work/ok $work/out 
     371diff -u $work/ok $work/out 
     372if test $? -ne 0; then fail; fi 
     373 
     374# 
     375# Check the content of change 11 (second commit) 
     376# 
     377activity="check change 11 content" 
     378cat > $work/ok <<EOF 
     379source create 1 bar.txt 
     380source modify 1 -> 2 dir/foo.txt 
     381EOF 
     382if test $? -ne 0; then no_result; fi 
     383 
     384aegis -list change_files -unf -c 11 > $work/out 
     385if test $? -ne 0; then no_result; fi 
     386 
     387diff -u $work/ok $work/out 
     388if test $? -ne 0; then fail; fi 
     389 
     390# 
     391# Check the content of change 12 (third commit) 
     392# 
     393# Note: we check the change fstate file to verify the rename 
     394#       operation, since the unformatted output lacks some details.. 
     395# 
     396activity="check change 12 content" 
     397cat > $work/ok <<EOF 
     398src = 
     399[ 
     400        { 
     401                file_name = "bar.txt"; 
     402                uuid = "UUID"; 
     403                action = remove; 
     404                edit_origin = 
     405                { 
     406                        revision = "1"; 
     407                        encoding = none; 
     408                }; 
     409                usage = source; 
     410                move = "baz.txt"; 
     411        }, 
     412        { 
     413                file_name = "baz.txt"; 
     414                uuid = "UUID"; 
     415                action = create; 
     416                edit = 
     417                { 
     418                        revision = "2"; 
     419                        encoding = none; 
     420                }; 
     421                edit_origin = 
     422                { 
     423                        revision = "1"; 
     424                        encoding = none; 
     425                }; 
     426                usage = source; 
     427                move = "bar.txt"; 
     428        }, 
     429        { 
     430                file_name = "dir/foo.txt"; 
     431                uuid = "UUID"; 
     432                action = modify; 
     433                edit = 
     434                { 
     435                        revision = "3"; 
     436                        encoding = none; 
     437                }; 
     438                edit_origin = 
     439                { 
     440                        revision = "2"; 
     441                        encoding = none; 
     442                }; 
     443                usage = source; 
     444        }, 
     445]; 
     446EOF 
     447if test $? -ne 0; then no_result; fi 
     448 
     449check_it ok $workproj/info/change/0/012.fs 
     450 
     451# 
     452# Note: there is a gap in the change numbers sequence, the next should 
     453#       be 13, because the aegis target back-end needs to be improved 
     454#       in the case of changeset setting only a tag 
     455# 
     456activity="check change 14 content" 
     457cat > $work/ok <<EOF 
     458source modify 2 -> 3 baz.txt 
     459source remove 3 dir/foo.txt 
     460EOF 
     461if test $? -ne 0; then no_result; fi 
     462 
     463aegis -list change_files -unf -c 14 > $work/out 
     464if test $? -ne 0; then no_result; fi 
     465 
     466diff -u $work/ok $work/out 
     467if test $? -ne 0; then fail; fi 
     468 
     469# 
     470# Check the content of the baseline 
     471# 
     472activity="check the baseline" 
     473cat > $work/ok <<EOF 
     474src = 
     475[ 
     476        { 
     477                file_name = "aegis.conf"; 
     478                uuid = "UUID"; 
     479                action = create; 
     480                edit = 
     481                { 
     482                        revision = "1"; 
     483                        encoding = none; 
     484                }; 
     485                edit_origin = 
     486                { 
     487                        revision = "1"; 
     488                        encoding = none; 
     489                }; 
     490                usage = config; 
     491                file_fp = 
     492                { 
     493                        youngest = TIME; 
     494                        oldest = TIME; 
     495                        crypto = "GUNK"; 
     496                }; 
     497                diff_file_fp = 
     498                { 
     499                        youngest = TIME; 
     500                        oldest = TIME; 
     501                        crypto = "GUNK"; 
     502                }; 
     503        }, 
     504        { 
     505                file_name = "bar.txt"; 
     506                uuid = "UUID"; 
     507                action = remove; 
     508                edit = 
     509                { 
     510                        revision = "1"; 
     511                        encoding = none; 
     512                }; 
     513                edit_origin = 
     514                { 
     515                        revision = "1"; 
     516                        encoding = none; 
     517                }; 
     518                usage = source; 
     519                move = "baz.txt"; 
     520                deleted_by = 12; 
     521        }, 
     522        { 
     523                file_name = "baz.txt"; 
     524                uuid = "UUID"; 
     525                action = create; 
     526                edit = 
     527                { 
     528                        revision = "3"; 
     529                        encoding = none; 
     530                }; 
     531                edit_origin = 
     532                { 
     533                        revision = "3"; 
     534                        encoding = none; 
     535                }; 
     536                usage = source; 
     537                file_fp = 
     538                { 
     539                        youngest = TIME; 
     540                        oldest = TIME; 
     541                        crypto = "GUNK"; 
     542                }; 
     543                diff_file_fp = 
     544                { 
     545                        youngest = TIME; 
     546                        oldest = TIME; 
     547                        crypto = "GUNK"; 
     548                }; 
     549                move = "bar.txt"; 
     550        }, 
     551        { 
     552                file_name = "dir/foo.txt"; 
     553                uuid = "UUID"; 
     554                action = remove; 
     555                edit = 
     556                { 
     557                        revision = "3"; 
     558                        encoding = none; 
     559                }; 
     560                edit_origin = 
     561                { 
     562                        revision = "3"; 
     563                        encoding = none; 
     564                }; 
     565                usage = source; 
     566                diff_file_fp = 
     567                { 
     568                        youngest = TIME; 
     569                        oldest = TIME; 
     570                        crypto = "GUNK"; 
     571                }; 
     572                deleted_by = 14; 
     573        }, 
     574]; 
     575EOF 
     576if test $? -ne 0; then no_result; fi 
     577 
     578check_it ok $workproj/info/trunk.fs 
     579 
     580activity="check aegis.conf baseline copy" 
     581cat > $work/ok <<'EOF' 
     582 
     583build_command = "exit 0"; 
     584link_integration_directory = true; 
     585 
     586history_get_command = "aesvt -check-out -edit ${quote $edit} " 
     587    "-history ${quote $history} -f ${quote $output}"; 
     588history_put_command = "aesvt -check-in -history ${quote $history} " 
     589    "-f ${quote $input}"; 
     590history_query_command = "aesvt -query -history ${quote $history}"; 
     591history_content_limitation = binary_capable; 
     592 
     593diff_command = "set +e; $diff $orig $i > $out; test $$? -le 1"; 
     594merge_command = 
     595"(diff3 -e $i $orig $mr | sed -e '/^w$$/d' -e '/^q$$/d'; echo '1,$$p') " 
     596"| ed - $i > $out"; 
     597patch_diff_command = 
     598"set +e; $diff -C0 -L $index -L $index $orig $i > $out; test $$? -le 1"; 
     599 
     600shell_safe_filenames = false; 
     601EOF 
     602if test $? -ne 0; then no_result; fi 
     603 
     604diff ok $workproj/baseline/aegis.conf 
     605if test $? -ne 0; then fail; fi 
     606 
     607activity="check baz.txt baseline copy" 
     608cat > $work/ok <<EOF 
     609A simple text file 
     610wit some more text. 
     611more text again! 
     612ancora piu\` test 
     613EOF 
     614if test $? -ne 0; then no_result; fi 
     615 
     616diff ok $workproj/baseline/baz.txt 
    339617if test $? -ne 0; then fail; fi 
    340618 
Note: See TracChangeset for help on using the changeset viewer.