Den fre 20 aug. 2021 kl 12:11 skrev Daniel Shahaf <d...@daniel.shahaf.name>:
> Daniel Sahlberg wrote on Thu, Aug 19, 2021 at 23:23:49 +0200: > > Current output. Again XML indented for readability. It is the same WC as > > before, but with an additional revision 7 where I reverse merge what was > > merged in r6: > > At some point it becomes a good idea to post your test data so others > (including future you) can reproduce or tinker. Forms include: > > - shell script producing the working copy > [[[ #!/bin/sh P=`pwd` rm -rf $P/repo/ $P/wc/ svnadmin create repo svn co file://$P/repo/ wc cd wc mkdir a svn add a svn ci a -m 'add a' svn copy file://$P/repo/a file://$P/repo/b -m 'copy a to b' svn copy file://$P/repo/b file://$P/repo/c -m 'copy b to c' svn up echo "a foo" > a/foo svn add a/foo svn ci a -m 'add a/foo' svn up svn merge ^/a b svn ci -m 'merge a to b' svn up svn merge ^/b c svn ci -m 'merge b to c' svn up svn merge -r HEAD:3 . svn ci -m 'reverse merge everything' svn up ]]] > - test suite patch producing the working copy > log_with_merge_history_and_search should be used as a basis. > > [[[ > ⋮ > > ------------------------------------------------------------------------ > > r4 | dsahlberg | 2021-08-19 21:58:28 +0200 (Thu, 19 Aug 2021) | 1 line > > Merged via: r7, r5 > > ]]] > > As can be seen here, it is not visible in the plain text output that r7 > was > > actually a reverse merge. > > Hmm. There's an interesting question of whether we can amend the output > to make that clear. The CLI output is an API, and generally we try not > to change it unless the user opts in to new features (e.g., when > changelists were added, the CLI output for users who don't use > changelists wasn't changed), but there are exceptions (e.g., adding the > seventh column to `svn status` non-XML output). > The two options today are: - Reverse merged via: r7 or: - Merged via: r7, r5 The code is looking at the the way r4 was merged and then prints the revision numbers from the merge stack. With the patch we have enough information on the merge stack to print "(reverse)" on each revision that was subtractive, for example: - Merged via: r7 (reverse), r5 Another option would be to print both (and each revision only in the line where it belongs). - Reverse merged via: r7 - Merged via: r5 To do this one would have to loop through the merge_stack twice (at least) or keep a reasonably long buffer to store the list of revisions in case of a long stack. Both these changes might mess it up for someone consuming the CLI output and expecting to find one or the other of Merged via: or Reverse merged via:, or expecting to find just a simple list of revisions. I can't judge the risk/reward for changing this. Kind regards, Daniel