| | @@ -62,11 +62,11 @@ |
| 62 | 62 | int nTo; /* Number of lines in aTo[] */ |
| 63 | 63 | }; |
| 64 | 64 | |
| 65 | 65 | /* |
| 66 | 66 | ** Return an array of DLine objects containing a pointer to the |
| 67 | | -** start of each line and a hash of that line. The lower |
| 67 | +** start of each line and a hash of that line. The lower |
| 68 | 68 | ** bits of the hash store the length of each line. |
| 69 | 69 | ** |
| 70 | 70 | ** Trailing whitespace is removed from each line. 2010-08-20: Not any |
| 71 | 71 | ** more. If trailing whitespace is ignored, the "patch" command gets |
| 72 | 72 | ** confused by the diff output. Ticket [a9f7b23c2e376af5b0e5b] |
| | @@ -171,11 +171,11 @@ |
| 171 | 171 | } |
| 172 | 172 | if( nCopy==0 && nDel==0 ){ |
| 173 | 173 | p->aEdit[p->nEdit-1] += nIns; |
| 174 | 174 | return; |
| 175 | 175 | } |
| 176 | | - } |
| 176 | + } |
| 177 | 177 | if( p->nEdit+3>p->nEditAlloc ){ |
| 178 | 178 | expandEdit(p, p->nEdit*2 + 15); |
| 179 | 179 | if( p->aEdit==0 ) return; |
| 180 | 180 | } |
| 181 | 181 | p->aEdit[p->nEdit++] = nCopy; |
| | @@ -188,11 +188,11 @@ |
| 188 | 188 | ** Given a diff context in which the aEdit[] array has been filled |
| 189 | 189 | ** in, compute a context diff into pOut. |
| 190 | 190 | */ |
| 191 | 191 | static void contextDiff(DContext *p, Blob *pOut, int nContext){ |
| 192 | 192 | DLine *A; /* Left side of the diff */ |
| 193 | | - DLine *B; /* Right side of the diff */ |
| 193 | + DLine *B; /* Right side of the diff */ |
| 194 | 194 | int a = 0; /* Index of next line in A[] */ |
| 195 | 195 | int b = 0; /* Index of next line in B[] */ |
| 196 | 196 | int *R; /* Array of COPY/DELETE/INSERT triples */ |
| 197 | 197 | int r; /* Index into R[] */ |
| 198 | 198 | int nr; /* Number of COPY/DELETE/INSERT triples to process */ |
| | @@ -341,11 +341,11 @@ |
| 341 | 341 | ** input range. |
| 342 | 342 | ** |
| 343 | 343 | ** Ideally, the common sequence should be the longest possible common |
| 344 | 344 | ** sequence. However, an exact computation of LCS is O(N*N) which is |
| 345 | 345 | ** way too slow for larger files. So this routine uses an O(N) |
| 346 | | -** heuristic approximation based on hashing that usually works about |
| 346 | +** heuristic approximation based on hashing that usually works about |
| 347 | 347 | ** as well. But if the O(N) algorithm doesn't get a good solution |
| 348 | 348 | ** and N is not too large, we fall back to an exact solution by |
| 349 | 349 | ** calling optimalLCS(). |
| 350 | 350 | */ |
| 351 | 351 | static void longestCommonSequence( |
| | @@ -372,11 +372,11 @@ |
| 372 | 372 | iEYb = iEYp = iS2; |
| 373 | 373 | mid = (iE1 + iS1)/2; |
| 374 | 374 | for(i=iS1; i<iE1; i++){ |
| 375 | 375 | int limit = 0; |
| 376 | 376 | j = p->aTo[p->aFrom[i].h % p->nTo].iHash; |
| 377 | | - while( j>0 |
| 377 | + while( j>0 |
| 378 | 378 | && (j-1<iS2 || j>=iE2 || !same_dline(&p->aFrom[i], &p->aTo[j-1])) |
| 379 | 379 | ){ |
| 380 | 380 | if( limit++ > 10 ){ |
| 381 | 381 | j = 0; |
| 382 | 382 | break; |
| | @@ -425,11 +425,11 @@ |
| 425 | 425 | *piSX = iSXb; |
| 426 | 426 | *piSY = iSYb; |
| 427 | 427 | *piEX = iEXb; |
| 428 | 428 | *piEY = iEYb; |
| 429 | 429 | } |
| 430 | | - /* printf("LCS(%d..%d/%d..%d) = %d..%d/%d..%d\n", |
| 430 | + /* printf("LCS(%d..%d/%d..%d) = %d..%d/%d..%d\n", |
| 431 | 431 | iS1, iE1, iS2, iE2, *piSX, *piEX, *piSY, *piEY); */ |
| 432 | 432 | } |
| 433 | 433 | |
| 434 | 434 | /* |
| 435 | 435 | ** Do a single step in the difference. Compute a sequence of |
| | @@ -525,11 +525,11 @@ |
| 525 | 525 | |
| 526 | 526 | /* |
| 527 | 527 | ** Generate a report of the differences between files pA and pB. |
| 528 | 528 | ** If pOut is not NULL then a unified diff is appended there. It |
| 529 | 529 | ** is assumed that pOut has already been initialized. If pOut is |
| 530 | | -** NULL, then a pointer to an array of integers is returned. |
| 530 | +** NULL, then a pointer to an array of integers is returned. |
| 531 | 531 | ** The integers come in triples. For each triple, |
| 532 | 532 | ** the elements are the number of lines copied, the number of |
| 533 | 533 | ** lines deleted, and the number of lines inserted. The vector |
| 534 | 534 | ** is terminated by a triple of all zeros. |
| 535 | 535 | ** |
| | @@ -543,11 +543,11 @@ |
| 543 | 543 | Blob *pOut, /* Write unified diff here if not NULL */ |
| 544 | 544 | int nContext, /* Amount of context to unified diff */ |
| 545 | 545 | int ignoreEolWs /* Ignore whitespace at the end of lines */ |
| 546 | 546 | ){ |
| 547 | 547 | DContext c; |
| 548 | | - |
| 548 | + |
| 549 | 549 | /* Prepare the input files */ |
| 550 | 550 | memset(&c, 0, sizeof(c)); |
| 551 | 551 | c.aFrom = break_into_lines(blob_str(pA_Blob), blob_size(pA_Blob), |
| 552 | 552 | &c.nFrom, ignoreEolWs); |
| 553 | 553 | c.aTo = break_into_lines(blob_str(pB_Blob), blob_size(pB_Blob), |
| | @@ -710,11 +710,11 @@ |
| 710 | 710 | p->c.aEdit = 0; |
| 711 | 711 | p->c.nEdit = 0; |
| 712 | 712 | p->c.nEditAlloc = 0; |
| 713 | 713 | |
| 714 | 714 | /* Clear out the from file */ |
| 715 | | - free(p->c.aFrom); |
| 715 | + free(p->c.aFrom); |
| 716 | 716 | blob_zero(pParent); |
| 717 | 717 | |
| 718 | 718 | /* Return no errors */ |
| 719 | 719 | return 0; |
| 720 | 720 | } |
| | @@ -781,11 +781,11 @@ |
| 781 | 781 | } |
| 782 | 782 | db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)"); |
| 783 | 783 | compute_ancestors(mid, 1000000000); |
| 784 | 784 | annotation_start(p, &toAnnotate); |
| 785 | 785 | |
| 786 | | - db_prepare(&q, |
| 786 | + db_prepare(&q, |
| 787 | 787 | "SELECT mlink.fid," |
| 788 | 788 | " (SELECT uuid FROM blob WHERE rid=mlink.%s)," |
| 789 | 789 | " date(event.mtime), " |
| 790 | 790 | " coalesce(event.euser,event.user) " |
| 791 | 791 | " FROM mlink, event" |
| | @@ -803,11 +803,11 @@ |
| 803 | 803 | const char *zUuid = db_column_text(&q, 1); |
| 804 | 804 | const char *zDate = db_column_text(&q, 2); |
| 805 | 805 | const char *zUser = db_column_text(&q, 3); |
| 806 | 806 | if( webLabel ){ |
| 807 | 807 | zLabel = mprintf( |
| 808 | | - "<a href='%s/info/%s' target='infowindow'>%.10s</a> %s %9.9s", |
| 808 | + "<a href='%s/info/%s' target='infowindow'>%.10s</a> %s %9.9s", |
| 809 | 809 | g.zTop, zUuid, zUuid, zDate, zUser |
| 810 | 810 | ); |
| 811 | 811 | }else{ |
| 812 | 812 | zLabel = mprintf("%.10s %s %9.9s", zUuid, zDate, zUser); |
| 813 | 813 | } |
| | @@ -879,10 +879,14 @@ |
| 879 | 879 | ** |
| 880 | 880 | ** Options: |
| 881 | 881 | ** --limit N Only look backwards in time by N versions |
| 882 | 882 | ** --log List all versions analyzed |
| 883 | 883 | ** --filevers Show file version numbers rather than check-in versions |
| 884 | +** |
| 885 | +** |
| 886 | +** SUMMARY: fossil annotate FILENAME ?options? |
| 887 | +** Options: --limit N, --log, --filevers |
| 884 | 888 | */ |
| 885 | 889 | void annotate_cmd(void){ |
| 886 | 890 | int fnid; /* Filename ID */ |
| 887 | 891 | int fid; /* File instance ID */ |
| 888 | 892 | int mid; /* Manifest where file was checked in */ |
| | @@ -926,9 +930,9 @@ |
| 926 | 930 | printf("version %3d: %s\n", i+1, ann.azVers[i]); |
| 927 | 931 | } |
| 928 | 932 | printf("---------------------------------------------------\n"); |
| 929 | 933 | } |
| 930 | 934 | for(i=0; i<ann.nOrig; i++){ |
| 931 | | - fossil_print("%s: %.*s\n", |
| 935 | + fossil_print("%s: %.*s\n", |
| 932 | 936 | ann.aOrig[i].zSrc, ann.aOrig[i].n, ann.aOrig[i].z); |
| 933 | 937 | } |
| 934 | 938 | } |
| 935 | 939 | |