Changeset 1584 in tailor


Ignore:
Timestamp:
05/30/08 10:26:45 (5 years ago)
Author:
<walter.franzini@…>
Hash name:
20080530082645-bb3d1-e730328812d7929b56c431ece3c8d053fa4c0b72
Message:

aegis backend simulate the (missing) aemv -keep command
The aegis -move command does not provide the -keep option to preserve
the content of the newly created file, so the target backend simulate
that behavior.

Files:
2 edited

Legend:

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

    r1578 r1584  
    129129if test $? -ne 0; then no_result; fi 
    130130 
     131cat > $work/darcs-repo/bar.txt <<EOF 
     132This will be baz.txt 
     133EOF 
     134if test $? -ne 0; then no_result; fi 
     135 
    131136darcs mv bar.txt baz.txt --repodir=$work/darcs-repo > log 2>&1 
    132137if test $? -ne 0; then cat log; no_result; fi 
     
    139144# Initialize the aegis repository 
    140145# 
    141  
    142146unset AEGIS_PROJECT 
    143147unset AEGIS_CHANGE 
     
    261265 
    262266diff -u $work/ok $work/history 
     267if test $? -ne 0; then fail; fi 
     268 
     269activity="check the aegis baseline vs. darcs repository" 
     270diff $work/darcs-repo/baz.txt $workproj/baseline/baz.txt 
     271if test $? -ne 0; then fail; fi 
     272 
     273diff $work/darcs-repo/dir/foo.txt $workproj/baseline/dir/foo.txt 
    263274if test $? -ne 0; then fail; fi 
    264275 
     
    604615if test $? -ne 0; then fail; fi 
    605616 
    606 activity="check baz.txt baseline copy" 
    607 cat > $work/ok <<EOF 
    608 A simple text file 
    609 wit some more text. 
    610 more text again! 
    611 ancora piu\` test 
    612 EOF 
    613 if test $? -ne 0; then no_result; fi 
    614  
    615 diff ok $workproj/baseline/baz.txt 
     617diff $work/darcs-repo/baz.txt $workproj/baseline/baz.txt 
    616618if test $? -ne 0; then fail; fi 
    617619 
  • vcpx/repository/aegis/target.py

    r1570 r1584  
    315315 
    316316    def __move_file(self, old_name, new_name): 
     317        # 
     318        # The aegis command to rename files does not have the -keep 
     319        # option to preserve the content of the file, do it manually. 
     320        # 
     321        fp = open(os.path.join(self.repository.basedir, new_name), 'rb') 
     322        content = fp.read() 
     323        fp.close() 
    317324        cmd = self.repository.command("-move", 
    318325                                      "-not-logging", 
     
    326333                "%s returned status %d, saying: %s" % 
    327334                (str(move_file), move_file.exit_status, output.read())) 
     335 
     336        # 
     337        # Restore the previously saved content of the renamed file. 
     338        # 
     339        fp = open(os.path.join(self.repository.basedir, new_name), 'wb') 
     340        fp.write(content) 
     341        fp.close() 
    328342 
    329343    def __remove_file(self, file_name): 
Note: See TracChangeset for help on using the changeset viewer.