view contrib/openvms/vms/hgmerge.com @ 51492:2e8a88e5809f

branchcache: stop writing more branchcache file on disk than needed Before this change, we were unconditionally writing a branchmap file for the filter level passed to `update_disk`. This is actually counter productive if no update were needed for this filter level. In many case, the branch cache for a filter level is identical to its parent "subset" and it is better to simply keep the subset update and reuse it every time instead of having to do identical work for similar subset. So we change the `update_disk` method to only write a file when that filter level differ from its parent. This removes many cases where identical files were written, requiring multiple boring update in the test suite. The only notable changes is the change to `test-strip-branch-cache.t`, this case was checking a scenario that no longer reproduce the bug as writing less branchmap file result in less stalled cache on disk. Strictly speaking, we could create a more convoluted scenario that create a similar issue. However the next changeset would also cover that scenario so we directly updated that test case to a "no longer buggy" state.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 10 Mar 2024 04:53:17 +0100
parents 44001e6f04de
children
line wrap: on
line source

$!
$! Custom merge tool to help solve merge conflict in OpenVMS
$! We recommand to solve this on other system
$!
$ set proc/par=extend
$ mine = p1
$ orig = p2
$ theirs = p3
$ tovms :== $ MERCURIAL_ROOT:[vms]tovms
$ merged = p1 + ".hgmerge"
$ tovms 'merged'
$ merged = tmpfn
$
$ define DECC$UNIX_LEVEL 90
$ gdiff3 :== $ MERCURIAL_ROOT:[vms]gdiff3
$ gdiff == "$ MERCURIAL_ROOT:[VMS]gdiff"
$! gdiff -u 'orig' 'mine'
$! gdiff -u 'orig' 'theirs'
$ if (f$search("''merged'") .nes. "") then -
          delete 'merged';*
$ define sys$output 'merged'
$ gdiff3 -"L" mine -"L" original -"L" theirs -"E" -m 'mine' 'orig' 'theirs'
$ status = $status
$ deassign sys$output
$ convert/fdl=mercurial_root:[vms]stmlf.fdl 'merged' 'merged'
$ purge/nolog 'merged'
$! No conflicts found.  Merge done.
$ if status .eqs. "%X006C8009"
$ then
$   tovms 'p1'
$   mine = tmpfn
$   rename 'merged' 'mine'
$   purge/nolog 'mine'
$   write sys$output "Merged ''mine'"
$   exit 1
$ endif
$
$! In all other cases, diff3 has found conflicts, added the proper conflict
$! markers to the merged file and we should now edit this file.  Fire up an
$! editor with the merged file and let the user manually resolve the conflicts.
$! When the editor exits successfully, there should be no conflict markers in
$! the merged file, otherwise we consider this merge failed.
$
$ if status .eqs. "%X006C8013"
$ then
$   deassign sys$input
$   edit 'merged'
$   open fi 'merged'
$   loop:
$     read fi srec/end=endloop
$     rec7 = f$extract(0, 7, srec)
$     if rec7 .eqs. "<<<<<<<" then goto conflict
$     if rec7 .eqs. "|||||||" then goto conflict
$     if rec7 .eqs. "=======" then goto conflict
$     if rec7 .eqs. ">>>>>>>" then goto conflict
$     goto loop
$   endloop:
$   close fi
$   tovms 'p1'
$   mine = tmpfn
$   rename 'merged' 'mine'
$   purge/nolog 'mine'
$   exit
$ endif
$ if (f$search("''merged'") .nes. "") then -
          delete 'merged';*
$ write sys$output "serious diff3 error, while trying to merge ''mine'"
$ exit 44
$ 
$ conflict:
$ close fi
$ if (f$search("''merged'") .nes. "") then -
          delete 'merged';*
$ write sys$output -
 "conflict markers still found in the working-copy.  Merge aborted for ''mine'"
$ exit 44