Changeset 782 for git/branches/dmik/xdiff/xdiffi.c
- Timestamp:
- Jun 23, 2014, 9:45:51 PM (11 years ago)
- Location:
- git/branches/dmik
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
git/branches/dmik ¶
- Property svn:mergeinfo changed
/git/vendor/2.0.0 (added) merged: 777 /git/vendor/current merged: 772,774,776
- Property svn:mergeinfo changed
-
TabularUnified git/branches/dmik/xdiff/xdiffi.c ¶
r626 r782 329 329 diffdata_t dd1, dd2; 330 330 331 if ( xpp->flags &XDF_PATIENCE_DIFF)331 if (XDF_DIFF_ALG(xpp->flags) == XDF_PATIENCE_DIFF) 332 332 return xdl_do_patience_diff(mf1, mf2, xpp, xe); 333 333 334 if ( xpp->flags &XDF_HISTOGRAM_DIFF)334 if (XDF_DIFF_ALG(xpp->flags) == XDF_HISTOGRAM_DIFF) 335 335 return xdl_do_histogram_diff(mf1, mf2, xpp, xe); 336 336 … … 395 395 xch->chg1 = chg1; 396 396 xch->chg2 = chg2; 397 xch->ignore = 0; 397 398 398 399 return xch; … … 491 492 /* 492 493 * Try to move back the possibly merged group of changes, to match 493 * the recorded pos tion in the other file.494 * the recorded position in the other file. 494 495 */ 495 496 while (ixref < ix) { … … 539 540 } 540 541 542 static int xdl_call_hunk_func(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb, 543 xdemitconf_t const *xecfg) 544 { 545 xdchange_t *xch, *xche; 546 547 for (xch = xscr; xch; xch = xche->next) { 548 xche = xdl_get_hunk(&xch, xecfg); 549 if (!xch) 550 break; 551 if (xecfg->hunk_func(xch->i1, xche->i1 + xche->chg1 - xch->i1, 552 xch->i2, xche->i2 + xche->chg2 - xch->i2, 553 ecb->priv) < 0) 554 return -1; 555 } 556 return 0; 557 } 558 559 static void xdl_mark_ignorable(xdchange_t *xscr, xdfenv_t *xe, long flags) 560 { 561 xdchange_t *xch; 562 563 for (xch = xscr; xch; xch = xch->next) { 564 int ignore = 1; 565 xrecord_t **rec; 566 long i; 567 568 rec = &xe->xdf1.recs[xch->i1]; 569 for (i = 0; i < xch->chg1 && ignore; i++) 570 ignore = xdl_blankline(rec[i]->ptr, rec[i]->size, flags); 571 572 rec = &xe->xdf2.recs[xch->i2]; 573 for (i = 0; i < xch->chg2 && ignore; i++) 574 ignore = xdl_blankline(rec[i]->ptr, rec[i]->size, flags); 575 576 xch->ignore = ignore; 577 } 578 } 541 579 542 580 int xdl_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp, … … 544 582 xdchange_t *xscr; 545 583 xdfenv_t xe; 546 emit_func_t ef = xecfg->emit_func ? 547 (emit_func_t)xecfg->emit_func : xdl_emit_diff; 584 emit_func_t ef = xecfg->hunk_func ? xdl_call_hunk_func : xdl_emit_diff; 548 585 549 586 if (xdl_do_diff(mf1, mf2, xpp, &xe) < 0) { … … 559 596 } 560 597 if (xscr) { 598 if (xpp->flags & XDF_IGNORE_BLANK_LINES) 599 xdl_mark_ignorable(xscr, &xe, xpp->flags); 600 561 601 if (ef(&xe, xscr, ecb, xecfg) < 0) { 562 602
Note:
See TracChangeset
for help on using the changeset viewer.