Make new Diff Flag DF_KEEP_FLAGS, use in Diff.

Diff will now check the passed df_flags for the DF_KEEP_FLAGS bit, and if found it will NOT and-equals the flags with DF_ABORT_ALL_FILES, which means that automated Diff utilities can be more easily written, without breaking the manual pop-up window Diff Merge workflow functionality.
This commit is contained in:
TomAwezome 2022-10-23 18:35:41 -04:00
parent 4a4e7a20fb
commit d95f3b285b

View file

@ -36,6 +36,7 @@ I64 DiffEntriesCompare(CDocEntry *doc_e1, CDocEntry *doc_e2)
#define DF_ABORT_FILE 0x10
#define DF_ABORT_ALL_FILES 0x20
#define DF_NO_MORE_PROMPTS_THIS_FILE 0x40
#define DF_KEEP_FLAGS 0x80 // tells Diff NOT to &= with abort-all flag at call start
U0 DiffSel(CDoc *doc, I64 *_df_flags, I64 j1_lo, I64 j1_hi, I64 j2_lo, I64 j2_hi, I64 count1, I64 count2,
CDocEntry **doc_unsorted1, CDocEntry **doc_unsorted2)
@ -277,13 +278,8 @@ public Bool Diff(U8 *dst_file, U8 *src_file, I64 *_df_flags=NULL)
else
df_flags = 0;
// df_flags &= DF_ABORT_ALL_FILES; // This line removes ALL df_flags values passed to this function,
// while also setting df_flags to DF_ABORT_ALL_FILES
// if it somehow got passed with a value of DF_ABORT_ALL_FILES.
// ... this seems counterproductive, and makes utilizing Diff with df_flags
// very difficult... Changing this to instead !! UN-SET !! DF_ABORT_ALL_FILES,
// which is what I can only guess was the intended behaviour here? ........
df_flags &= ~(DF_ABORT_ALL_FILES);
if (!(df_flags & DF_KEEP_FLAGS))
df_flags &= DF_ABORT_ALL_FILES;
doc_e = doc1->head.next;
while (doc_e != doc1)