Fossil

Changes On Branch merge-conflict-when-no-file-on-pivot
Login

Changes On Branch merge-conflict-when-no-file-on-pivot

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch merge-conflict-when-no-file-on-pivot Excluding Merge-Ins

This is equivalent to a diff from 3783a24e to 88a76afc

2023-04-19
01:46
Produce merge conflict mark during merge when file exist in current version and in version to be merged, but not in common ancestor. ... (check-in: 7c75e47b user: mgagnon tags: trunk)
2023-04-18
17:47
Extend FTS index support to enable selection of different tokenizers, to support searching of Chinese content. ... (check-in: 0e5d27fe user: stephan tags: trunk)
2023-04-17
21:50
Merge latest changes from trunk. ... (Closed-Leaf check-in: 88a76afc user: mgagnon tags: merge-conflict-when-no-file-on-pivot)
17:25
Initial (and incomplete) work to extend FTS5 search to support the trigram tokenizer, per forum post bc458aea069c29ae5d. TODO is the addition of the trigram option in the UI-level search configuration. ... (check-in: 06c99b83 user: stephan tags: fts5-trigram)
2023-04-16
13:13
Merge trunk into forumpost-locking branch. ... (check-in: 0af37104 user: stephan tags: forumpost-locking)
2023-04-14
15:31
Squelch an unitialized var warning from gcc 12.2.1 on Alpine Linux. ... (check-in: 3783a24e user: stephan tags: trunk)
2023-04-13
07:01
Typo fix in capabilities.c, reported in forum. ... (check-in: 0df0586a user: danield tags: trunk)
2023-03-16
02:08
Produce merge conflict mark during merge when file exist in current version and in version to be merged, but not in common ancestor.

Related forum discussion including test script: f035bbc8461da6d2. ... (check-in: 04e1674c user: mgagnon tags: merge-conflict-when-no-file-on-pivot)


Changes to src/merge.c.

760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
    debug_fv_dump( debugFlag>=2 );
  }

  /************************************************************************
  ** All of the information needed to do the merge is now contained in the
  ** FV table.  Starting here, we begin to actually carry out the merge.
  **
  ** First, find files in M and V but not in P and report conflicts.
  ** The file in M will be ignored.  It will be treated as if it
  ** does not exist.
  */
  db_prepare(&q,
    "SELECT idm FROM fv WHERE idp=0 AND idv>0 AND idm>0"
  );
  while( db_step(&q)==SQLITE_ROW ){
    int idm = db_column_int(&q, 0);
    char *zName = db_text(0, "SELECT pathname FROM vfile WHERE id=%d", idm);
    fossil_warning("WARNING: no common ancestor for %s", zName);
    free(zName);
    db_multi_exec("UPDATE fv SET idm=0 WHERE idm=%d", idm);
  }
  db_finalize(&q);

  /*
  ** Find files that have changed from P->M but not P->V.
  ** Copy the M content over into V.
  */
  db_prepare(&q,
    "SELECT idv, ridm, fn, islinkm FROM fv"
    " WHERE idp>0 AND idv>0 AND idm>0"
    "   AND ridm!=ridp AND ridv=ridp AND NOT chnged"
  );







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|







760
761
762
763
764
765
766

















767
768
769
770
771
772
773
774
    debug_fv_dump( debugFlag>=2 );
  }

  /************************************************************************
  ** All of the information needed to do the merge is now contained in the
  ** FV table.  Starting here, we begin to actually carry out the merge.
  **

















  ** First, find files that have changed from P->M but not P->V.
  ** Copy the M content over into V.
  */
  db_prepare(&q,
    "SELECT idv, ridm, fn, islinkm FROM fv"
    " WHERE idp>0 AND idv>0 AND idm>0"
    "   AND ridm!=ridp AND ridv=ridp AND NOT chnged"
  );
807
808
809
810
811
812
813




814
815
816
817
818
819
820
821
822
823
824
      vfile_to_disk(0, idv, 0, 0);
    }
  }
  db_finalize(&q);

  /*
  ** Do a three-way merge on files that have changes on both P->M and P->V.




  */
  db_prepare(&q,
    "SELECT ridm, idv, ridp, ridv, %s, fn, isexe, islinkv, islinkm FROM fv"
    " WHERE idp>0 AND idv>0 AND idm>0"
    "   AND ridm!=ridp AND (ridv!=ridp OR chnged)",
    glob_expr("fv.fn", zBinGlob)
  );
  while( db_step(&q)==SQLITE_ROW ){
    int ridm = db_column_int(&q, 0);
    int idv = db_column_int(&q, 1);
    int ridp = db_column_int(&q, 2);







>
>
>
>



|







790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
      vfile_to_disk(0, idv, 0, 0);
    }
  }
  db_finalize(&q);

  /*
  ** Do a three-way merge on files that have changes on both P->M and P->V.
  **
  ** Proceed even if the file doesn't exist on P, just like the common ancestor
  ** of M and V is an empty file. In this case, merge conflict marks will be
  ** added to the file and user will be forced to take a decision.
  */
  db_prepare(&q,
    "SELECT ridm, idv, ridp, ridv, %s, fn, isexe, islinkv, islinkm FROM fv"
    " WHERE idv>0 AND idm>0"
    "   AND ridm!=ridp AND (ridv!=ridp OR chnged)",
    glob_expr("fv.fn", zBinGlob)
  );
  while( db_step(&q)==SQLITE_ROW ){
    int ridm = db_column_int(&q, 0);
    int idv = db_column_int(&q, 1);
    int ridp = db_column_int(&q, 2);