Fossil SCM
| 33e518b… | drh | 1 | # |
| 33e518b… | drh | 2 | # Tests for merging with renames |
| 33e518b… | drh | 3 | # |
| 33e518b… | drh | 4 | # |
| 33e518b… | drh | 5 | |
| 33e518b… | drh | 6 | proc commit_id {version} { |
| 33e518b… | drh | 7 | regexp -line {^artifact:\s+(\S+)} [fossil whatis $version] - id |
| 33e518b… | drh | 8 | return $id |
| 33e518b… | drh | 9 | } |
| 33e518b… | drh | 10 | |
| 33e518b… | drh | 11 | require_no_open_checkout |
| 33e518b… | drh | 12 | |
| 33e518b… | drh | 13 | ################################################################# |
| 33e518b… | drh | 14 | # Test 1 # |
| 33e518b… | drh | 15 | # https://fossil-scm.org/forum/forumpost/549700437b # |
| 33e518b… | drh | 16 | ################################################################# |
| 33e518b… | drh | 17 | |
| 33e518b… | drh | 18 | test_setup |
| 33e518b… | drh | 19 | |
| 33e518b… | drh | 20 | write_file file1 "file1\n" |
| 33e518b… | drh | 21 | fossil add file1 |
| 33e518b… | drh | 22 | fossil commit -m "added file1" |
| 33e518b… | drh | 23 | |
| 33e518b… | drh | 24 | write_file file2 "file2\n" |
| 33e518b… | drh | 25 | fossil add file2 |
| 33e518b… | drh | 26 | fossil commit -m "added file2" --branch added |
| 33e518b… | drh | 27 | |
| 33e518b… | drh | 28 | write_file file2 "edit file2 on added\n" |
| 33e518b… | drh | 29 | fossil commit -m "edited file2" |
| 33e518b… | drh | 30 | |
| 33e518b… | drh | 31 | fossil mv --hard file2 file2.renamed |
| 33e518b… | drh | 32 | fossil commit -m "renamed file2" --branch renamed |
| 33e518b… | drh | 33 | |
| 33e518b… | drh | 34 | fossil branch new branched current |
| 33e518b… | drh | 35 | |
| 33e518b… | drh | 36 | write_file file2.renamed "edit file2.renamed on renamed\n" |
| 33e518b… | drh | 37 | fossil commit -m "edited file2.renamed" |
| 33e518b… | drh | 38 | |
| 33e518b… | drh | 39 | fossil update trunk |
| 33e518b… | drh | 40 | fossil merge renamed |
| 33e518b… | drh | 41 | fossil commit -m "merged from renamed" |
| 33e518b… | drh | 42 | |
| 33e518b… | drh | 43 | write_file file2.renamed "edit file2.renamed on trunk (1)\n" |
| 33e518b… | drh | 44 | fossil commit -m "edited file2.renamed on trunk (1)" |
| 33e518b… | drh | 45 | |
| 33e518b… | drh | 46 | fossil update branched |
| 33e518b… | drh | 47 | fossil merge trunk |
| 33e518b… | drh | 48 | test_status_list merge_renames_2-1.1 $RESULT {UPDATE file2.renamed} |
| 33e518b… | drh | 49 | fossil commit -m "merged edit from trunk (1:this merge succeeded)" |
| 33e518b… | drh | 50 | |
| 33e518b… | drh | 51 | fossil update trunk |
| 33e518b… | drh | 52 | write_file file2.renamed "edit2 file2.renamed on trunk (2)\n" |
| 33e518b… | drh | 53 | fossil commit -m "edited file2.renamed on trunk (2)" |
| 33e518b… | drh | 54 | |
| 33e518b… | drh | 55 | fossil update branched |
| 33e518b… | drh | 56 | fossil merge trunk |
| 33e518b… | drh | 57 | test_status_list merge_renames_2-1.2 $RESULT {UPDATE file2.renamed} |
| 33e518b… | drh | 58 | |
| 33e518b… | drh | 59 | test_cleanup |