Fossil

Check-in [76ae862e]
Login

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

Overview
Comment:Change the merge conflict marks to identify which part is original content and which part is the content merged in.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:76ae862ec9ee2be80a88efb8a2c871f002420469
User & Date: drh 2010-12-15 01:36:32
Context
2010-12-15
01:49
Report the number of conflicts at the end of a merge or update and offer a hint to the user about the "fossil undo" command. check-in: 070ce24d user: drh tags: trunk
01:36
Change the merge conflict marks to identify which part is original content and which part is the content merged in. check-in: 76ae862e user: drh tags: trunk
2010-12-14
15:44
Simplifications to the merge and update logic. Fix update so that it correctly carries file edits across name changes. check-in: fd8698c8 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/merge.c.

347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
    content_get(ridm, &m);
    blob_zero(&v);
    blob_read_from_file(&v, zFullPath);
    if( isBinary ){
      rc = -1;
      blob_zero(&r);
    }else{
      rc = blob_merge(&p, &m, &v, &r);
    }
    if( rc>=0 ){
      if( !nochangeFlag ){
        blob_write_to_file(&r, zFullPath);
      }
      db_multi_exec("UPDATE vfile SET mtime=0 WHERE id=%d", idv);
      if( rc>0 ){







|







347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
    content_get(ridm, &m);
    blob_zero(&v);
    blob_read_from_file(&v, zFullPath);
    if( isBinary ){
      rc = -1;
      blob_zero(&r);
    }else{
      rc = blob_merge(&p, &v, &m, &r);
    }
    if( rc>=0 ){
      if( !nochangeFlag ){
        blob_write_to_file(&r, zFullPath);
      }
      db_multi_exec("UPDATE vfile SET mtime=0 WHERE id=%d", idv);
      if( rc>0 ){

Changes to src/merge3.c.

149
150
151
152
153
154
155
156

157

158

159
160
161
162
163
164
165
int blob_merge(Blob *pPivot, Blob *pV1, Blob *pV2, Blob *pOut){
  int *aC1;              /* Changes from pPivot to pV1 */
  int *aC2;              /* Changes from pPivot to pV2 */
  int i1, i2;            /* Index into aC1[] and aC2[] */
  int nCpy, nDel, nIns;  /* Number of lines to copy, delete, or insert */
  int limit1, limit2;    /* Sizes of aC1[] and aC2[] */
  int nConflict = 0;     /* Number of merge conflicts seen so far */
  static const char zBegin[] = "<<<<<<< BEGIN MERGE CONFLICT\n";

  static const char zMid[]   = "============================\n";

  static const char zEnd[]   = ">>>>>>> END MERGE CONFLICT\n";


  blob_zero(pOut);         /* Merge results stored in pOut */

  /* Compute the edits that occur from pPivot => pV1 (into aC1)
  ** and pPivot => pV2 (into aC2).  Each of the aC1 and aC2 arrays is
  ** an array of integer triples.  Within each triple, the first integer
  ** is the number of lines of text to copy directly from the pivot,







|
>
|
>
|
>







149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
int blob_merge(Blob *pPivot, Blob *pV1, Blob *pV2, Blob *pOut){
  int *aC1;              /* Changes from pPivot to pV1 */
  int *aC2;              /* Changes from pPivot to pV2 */
  int i1, i2;            /* Index into aC1[] and aC2[] */
  int nCpy, nDel, nIns;  /* Number of lines to copy, delete, or insert */
  int limit1, limit2;    /* Sizes of aC1[] and aC2[] */
  int nConflict = 0;     /* Number of merge conflicts seen so far */
  static const char zBegin[] =
    "<<<<<<< BEGIN MERGE CONFLICT: original content first <<<<<<<\n";
  static const char zMid[]   =
    "======= original content above; merged content below =======\n";
  static const char zEnd[]   =
    ">>>>>>> END MERGE CONFLICT: merged content last >>>>>>>>>>>>\n";

  blob_zero(pOut);         /* Merge results stored in pOut */

  /* Compute the edits that occur from pPivot => pV1 (into aC1)
  ** and pPivot => pV2 (into aC2).  Each of the aC1 and aC2 arrays is
  ** an array of integer triples.  Within each triple, the first integer
  ** is the number of lines of text to copy directly from the pivot,