Fossil SCM
Merge latest change from trunk.
Commit
eb1b310fc726649d97fae660226a73ee8a860409
Parent
d7dc41586fc0d78…
10 files changed
+15
-8
+8
-3
+2
-2
+1
-1
+1
-1
+1
-1
+10
-6
+10
-6
+1
-1
+1
-1
+15
-8
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -990,16 +990,18 @@ | ||
| 990 | 990 | const char *zColor; /* Modified value of p->zColor */ |
| 991 | 991 | |
| 992 | 992 | assert( pBaseline==0 || pBaseline->zBaseline==0 ); |
| 993 | 993 | assert( pBaseline==0 || zBaselineUuid!=0 ); |
| 994 | 994 | blob_zero(pOut); |
| 995 | - zParentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d AND " | |
| 996 | - "EXISTS(SELECT 1 FROM event WHERE event.type='ci' and event.objid=%d)", | |
| 997 | - vid, vid); | |
| 998 | - if( !zParentUuid ){ | |
| 999 | - fossil_fatal("Could not find a valid check-in for RID %d. " | |
| 1000 | - "Possible checkout/repo mismatch.", vid); | |
| 995 | + if( vid ){ | |
| 996 | + zParentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d AND " | |
| 997 | + "EXISTS(SELECT 1 FROM event WHERE event.type='ci' and event.objid=%d)", | |
| 998 | + vid, vid); | |
| 999 | + if( !zParentUuid ){ | |
| 1000 | + fossil_fatal("Could not find a valid check-in for RID %d. " | |
| 1001 | + "Possible checkout/repo mismatch.", vid); | |
| 1002 | + } | |
| 1001 | 1003 | } |
| 1002 | 1004 | if( pBaseline ){ |
| 1003 | 1005 | blob_appendf(pOut, "B %s\n", zBaselineUuid); |
| 1004 | 1006 | manifest_file_rewind(pBaseline); |
| 1005 | 1007 | pFile = manifest_file_next(pBaseline, 0); |
| @@ -1091,11 +1093,11 @@ | ||
| 1091 | 1093 | nFBcard++; |
| 1092 | 1094 | } |
| 1093 | 1095 | if( p->zMimetype && p->zMimetype[0] ){ |
| 1094 | 1096 | blob_appendf(pOut, "N %F\n", p->zMimetype); |
| 1095 | 1097 | } |
| 1096 | - if( zParentUuid ){ | |
| 1098 | + if( vid ){ | |
| 1097 | 1099 | blob_appendf(pOut, "P %s", zParentUuid); |
| 1098 | 1100 | if( p->verifyDate ) checkin_verify_younger(vid, zParentUuid, zDate); |
| 1099 | 1101 | free(zParentUuid); |
| 1100 | 1102 | db_prepare(&q, "SELECT merge FROM vmerge WHERE id=0 OR id<-2"); |
| 1101 | 1103 | while( db_step(&q)==SQLITE_ROW ){ |
| @@ -1610,12 +1612,17 @@ | ||
| 1610 | 1612 | } |
| 1611 | 1613 | |
| 1612 | 1614 | /* |
| 1613 | 1615 | ** Do not allow a commit that will cause a fork unless the --allow-fork |
| 1614 | 1616 | ** or --force flags is used, or unless this is a private check-in. |
| 1617 | + ** The initial commit MUST have tags "trunk" and "sym-trunk". | |
| 1615 | 1618 | */ |
| 1616 | - if( sCiInfo.zBranch==0 && allowFork==0 && forceFlag==0 | |
| 1619 | + if( !vid ){ | |
| 1620 | + if( sCiInfo.zBranch==0 ){ | |
| 1621 | + sCiInfo.zBranch = db_get("main-branch", "trunk"); | |
| 1622 | + } | |
| 1623 | + }else if( sCiInfo.zBranch==0 && allowFork==0 && forceFlag==0 | |
| 1617 | 1624 | && g.markPrivate==0 && !is_a_leaf(vid) |
| 1618 | 1625 | ){ |
| 1619 | 1626 | fossil_fatal("would fork. \"update\" first or use --allow-fork."); |
| 1620 | 1627 | } |
| 1621 | 1628 | |
| 1622 | 1629 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -990,16 +990,18 @@ | |
| 990 | const char *zColor; /* Modified value of p->zColor */ |
| 991 | |
| 992 | assert( pBaseline==0 || pBaseline->zBaseline==0 ); |
| 993 | assert( pBaseline==0 || zBaselineUuid!=0 ); |
| 994 | blob_zero(pOut); |
| 995 | zParentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d AND " |
| 996 | "EXISTS(SELECT 1 FROM event WHERE event.type='ci' and event.objid=%d)", |
| 997 | vid, vid); |
| 998 | if( !zParentUuid ){ |
| 999 | fossil_fatal("Could not find a valid check-in for RID %d. " |
| 1000 | "Possible checkout/repo mismatch.", vid); |
| 1001 | } |
| 1002 | if( pBaseline ){ |
| 1003 | blob_appendf(pOut, "B %s\n", zBaselineUuid); |
| 1004 | manifest_file_rewind(pBaseline); |
| 1005 | pFile = manifest_file_next(pBaseline, 0); |
| @@ -1091,11 +1093,11 @@ | |
| 1091 | nFBcard++; |
| 1092 | } |
| 1093 | if( p->zMimetype && p->zMimetype[0] ){ |
| 1094 | blob_appendf(pOut, "N %F\n", p->zMimetype); |
| 1095 | } |
| 1096 | if( zParentUuid ){ |
| 1097 | blob_appendf(pOut, "P %s", zParentUuid); |
| 1098 | if( p->verifyDate ) checkin_verify_younger(vid, zParentUuid, zDate); |
| 1099 | free(zParentUuid); |
| 1100 | db_prepare(&q, "SELECT merge FROM vmerge WHERE id=0 OR id<-2"); |
| 1101 | while( db_step(&q)==SQLITE_ROW ){ |
| @@ -1610,12 +1612,17 @@ | |
| 1610 | } |
| 1611 | |
| 1612 | /* |
| 1613 | ** Do not allow a commit that will cause a fork unless the --allow-fork |
| 1614 | ** or --force flags is used, or unless this is a private check-in. |
| 1615 | */ |
| 1616 | if( sCiInfo.zBranch==0 && allowFork==0 && forceFlag==0 |
| 1617 | && g.markPrivate==0 && !is_a_leaf(vid) |
| 1618 | ){ |
| 1619 | fossil_fatal("would fork. \"update\" first or use --allow-fork."); |
| 1620 | } |
| 1621 | |
| 1622 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -990,16 +990,18 @@ | |
| 990 | const char *zColor; /* Modified value of p->zColor */ |
| 991 | |
| 992 | assert( pBaseline==0 || pBaseline->zBaseline==0 ); |
| 993 | assert( pBaseline==0 || zBaselineUuid!=0 ); |
| 994 | blob_zero(pOut); |
| 995 | if( vid ){ |
| 996 | zParentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d AND " |
| 997 | "EXISTS(SELECT 1 FROM event WHERE event.type='ci' and event.objid=%d)", |
| 998 | vid, vid); |
| 999 | if( !zParentUuid ){ |
| 1000 | fossil_fatal("Could not find a valid check-in for RID %d. " |
| 1001 | "Possible checkout/repo mismatch.", vid); |
| 1002 | } |
| 1003 | } |
| 1004 | if( pBaseline ){ |
| 1005 | blob_appendf(pOut, "B %s\n", zBaselineUuid); |
| 1006 | manifest_file_rewind(pBaseline); |
| 1007 | pFile = manifest_file_next(pBaseline, 0); |
| @@ -1091,11 +1093,11 @@ | |
| 1093 | nFBcard++; |
| 1094 | } |
| 1095 | if( p->zMimetype && p->zMimetype[0] ){ |
| 1096 | blob_appendf(pOut, "N %F\n", p->zMimetype); |
| 1097 | } |
| 1098 | if( vid ){ |
| 1099 | blob_appendf(pOut, "P %s", zParentUuid); |
| 1100 | if( p->verifyDate ) checkin_verify_younger(vid, zParentUuid, zDate); |
| 1101 | free(zParentUuid); |
| 1102 | db_prepare(&q, "SELECT merge FROM vmerge WHERE id=0 OR id<-2"); |
| 1103 | while( db_step(&q)==SQLITE_ROW ){ |
| @@ -1610,12 +1612,17 @@ | |
| 1612 | } |
| 1613 | |
| 1614 | /* |
| 1615 | ** Do not allow a commit that will cause a fork unless the --allow-fork |
| 1616 | ** or --force flags is used, or unless this is a private check-in. |
| 1617 | ** The initial commit MUST have tags "trunk" and "sym-trunk". |
| 1618 | */ |
| 1619 | if( !vid ){ |
| 1620 | if( sCiInfo.zBranch==0 ){ |
| 1621 | sCiInfo.zBranch = db_get("main-branch", "trunk"); |
| 1622 | } |
| 1623 | }else if( sCiInfo.zBranch==0 && allowFork==0 && forceFlag==0 |
| 1624 | && g.markPrivate==0 && !is_a_leaf(vid) |
| 1625 | ){ |
| 1626 | fossil_fatal("would fork. \"update\" first or use --allow-fork."); |
| 1627 | } |
| 1628 | |
| 1629 |
+8
-3
| --- src/comformat.c | ||
| +++ src/comformat.c | ||
| @@ -26,28 +26,33 @@ | ||
| 26 | 26 | ** Given a comment string zText, format that string for printing |
| 27 | 27 | ** on a TTY. Assume that the output cursors is indent spaces from |
| 28 | 28 | ** the left margin and that a single line can contain no more than |
| 29 | 29 | ** lineLength characters. Indent all subsequent lines by indent. |
| 30 | 30 | ** |
| 31 | -** lineLength must be less than 400. | |
| 32 | -** | |
| 33 | 31 | ** Return the number of newlines that are output. |
| 34 | 32 | */ |
| 35 | 33 | int comment_print(const char *zText, int indent, int lineLength){ |
| 36 | 34 | int tlen = lineLength - indent; |
| 37 | 35 | int si, sk, i, k; |
| 38 | 36 | int doIndent = 0; |
| 39 | - char zBuf[400]; | |
| 37 | + char *zBuf; | |
| 38 | + char zBuffer[400]; | |
| 40 | 39 | int lineCnt = 0; |
| 41 | 40 | |
| 41 | + if( lineLength > sizeof(zBuffer) ){ | |
| 42 | + zBuf = fossil_malloc(lineLength); | |
| 43 | + }else{ | |
| 44 | + zBuf = zBuffer; | |
| 45 | + } | |
| 42 | 46 | for(;;){ |
| 43 | 47 | while( fossil_isspace(zText[0]) ){ zText++; } |
| 44 | 48 | if( zText[0]==0 ){ |
| 45 | 49 | if( doIndent==0 ){ |
| 46 | 50 | fossil_print("\n"); |
| 47 | 51 | lineCnt = 1; |
| 48 | 52 | } |
| 53 | + if( zBuf!=zBuffer) fossil_free(zBuf); | |
| 49 | 54 | return lineCnt; |
| 50 | 55 | } |
| 51 | 56 | for(sk=si=i=k=0; zText[i] && k<tlen; i++){ |
| 52 | 57 | char c = zText[i]; |
| 53 | 58 | if( fossil_isspace(c) ){ |
| 54 | 59 |
| --- src/comformat.c | |
| +++ src/comformat.c | |
| @@ -26,28 +26,33 @@ | |
| 26 | ** Given a comment string zText, format that string for printing |
| 27 | ** on a TTY. Assume that the output cursors is indent spaces from |
| 28 | ** the left margin and that a single line can contain no more than |
| 29 | ** lineLength characters. Indent all subsequent lines by indent. |
| 30 | ** |
| 31 | ** lineLength must be less than 400. |
| 32 | ** |
| 33 | ** Return the number of newlines that are output. |
| 34 | */ |
| 35 | int comment_print(const char *zText, int indent, int lineLength){ |
| 36 | int tlen = lineLength - indent; |
| 37 | int si, sk, i, k; |
| 38 | int doIndent = 0; |
| 39 | char zBuf[400]; |
| 40 | int lineCnt = 0; |
| 41 | |
| 42 | for(;;){ |
| 43 | while( fossil_isspace(zText[0]) ){ zText++; } |
| 44 | if( zText[0]==0 ){ |
| 45 | if( doIndent==0 ){ |
| 46 | fossil_print("\n"); |
| 47 | lineCnt = 1; |
| 48 | } |
| 49 | return lineCnt; |
| 50 | } |
| 51 | for(sk=si=i=k=0; zText[i] && k<tlen; i++){ |
| 52 | char c = zText[i]; |
| 53 | if( fossil_isspace(c) ){ |
| 54 |
| --- src/comformat.c | |
| +++ src/comformat.c | |
| @@ -26,28 +26,33 @@ | |
| 26 | ** Given a comment string zText, format that string for printing |
| 27 | ** on a TTY. Assume that the output cursors is indent spaces from |
| 28 | ** the left margin and that a single line can contain no more than |
| 29 | ** lineLength characters. Indent all subsequent lines by indent. |
| 30 | ** |
| 31 | ** Return the number of newlines that are output. |
| 32 | */ |
| 33 | int comment_print(const char *zText, int indent, int lineLength){ |
| 34 | int tlen = lineLength - indent; |
| 35 | int si, sk, i, k; |
| 36 | int doIndent = 0; |
| 37 | char *zBuf; |
| 38 | char zBuffer[400]; |
| 39 | int lineCnt = 0; |
| 40 | |
| 41 | if( lineLength > sizeof(zBuffer) ){ |
| 42 | zBuf = fossil_malloc(lineLength); |
| 43 | }else{ |
| 44 | zBuf = zBuffer; |
| 45 | } |
| 46 | for(;;){ |
| 47 | while( fossil_isspace(zText[0]) ){ zText++; } |
| 48 | if( zText[0]==0 ){ |
| 49 | if( doIndent==0 ){ |
| 50 | fossil_print("\n"); |
| 51 | lineCnt = 1; |
| 52 | } |
| 53 | if( zBuf!=zBuffer) fossil_free(zBuf); |
| 54 | return lineCnt; |
| 55 | } |
| 56 | for(sk=si=i=k=0; zText[i] && k<tlen; i++){ |
| 57 | char c = zText[i]; |
| 58 | if( fossil_isspace(c) ){ |
| 59 |
+2
-2
| --- src/config.h | ||
| +++ src/config.h | ||
| @@ -25,12 +25,12 @@ | ||
| 25 | 25 | #ifndef _FILE_OFFSET_BITS |
| 26 | 26 | # define _FILE_OFFSET_BITS 64 |
| 27 | 27 | #endif |
| 28 | 28 | #define _LARGEFILE_SOURCE 1 |
| 29 | 29 | |
| 30 | -/* Make sure that in Win32 builds, _USE_32BIT_TIME_T is always defined. */ | |
| 31 | -#if defined(_WIN32) && !defined(_WIN64) && !defined(_USE_32BIT_TIME_T) | |
| 30 | +/* Make sure that in Win32 MinGW builds, _USE_32BIT_TIME_T is always defined. */ | |
| 31 | +#if defined(_WIN32) && !defined(_WIN64) && !defined(_MSC_VER) && !defined(_USE_32BIT_TIME_T) | |
| 32 | 32 | # define _USE_32BIT_TIME_T |
| 33 | 33 | #endif |
| 34 | 34 | |
| 35 | 35 | #ifdef HAVE_AUTOCONFIG_H |
| 36 | 36 | #include "autoconfig.h" |
| 37 | 37 |
| --- src/config.h | |
| +++ src/config.h | |
| @@ -25,12 +25,12 @@ | |
| 25 | #ifndef _FILE_OFFSET_BITS |
| 26 | # define _FILE_OFFSET_BITS 64 |
| 27 | #endif |
| 28 | #define _LARGEFILE_SOURCE 1 |
| 29 | |
| 30 | /* Make sure that in Win32 builds, _USE_32BIT_TIME_T is always defined. */ |
| 31 | #if defined(_WIN32) && !defined(_WIN64) && !defined(_USE_32BIT_TIME_T) |
| 32 | # define _USE_32BIT_TIME_T |
| 33 | #endif |
| 34 | |
| 35 | #ifdef HAVE_AUTOCONFIG_H |
| 36 | #include "autoconfig.h" |
| 37 |
| --- src/config.h | |
| +++ src/config.h | |
| @@ -25,12 +25,12 @@ | |
| 25 | #ifndef _FILE_OFFSET_BITS |
| 26 | # define _FILE_OFFSET_BITS 64 |
| 27 | #endif |
| 28 | #define _LARGEFILE_SOURCE 1 |
| 29 | |
| 30 | /* Make sure that in Win32 MinGW builds, _USE_32BIT_TIME_T is always defined. */ |
| 31 | #if defined(_WIN32) && !defined(_WIN64) && !defined(_MSC_VER) && !defined(_USE_32BIT_TIME_T) |
| 32 | # define _USE_32BIT_TIME_T |
| 33 | #endif |
| 34 | |
| 35 | #ifdef HAVE_AUTOCONFIG_H |
| 36 | #include "autoconfig.h" |
| 37 |
+1
-1
| --- src/descendants.c | ||
| +++ src/descendants.c | ||
| @@ -329,11 +329,11 @@ | ||
| 329 | 329 | "%s" |
| 330 | 330 | " AND event.objid IN (SELECT rid FROM leaves)" |
| 331 | 331 | " ORDER BY event.mtime DESC", |
| 332 | 332 | timeline_query_for_tty() |
| 333 | 333 | ); |
| 334 | - print_timeline(&q, 20, 0); | |
| 334 | + print_timeline(&q, 20, 79, 0); | |
| 335 | 335 | db_finalize(&q); |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | /* |
| 339 | 339 | ** COMMAND: leaves* |
| 340 | 340 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -329,11 +329,11 @@ | |
| 329 | "%s" |
| 330 | " AND event.objid IN (SELECT rid FROM leaves)" |
| 331 | " ORDER BY event.mtime DESC", |
| 332 | timeline_query_for_tty() |
| 333 | ); |
| 334 | print_timeline(&q, 20, 0); |
| 335 | db_finalize(&q); |
| 336 | } |
| 337 | |
| 338 | /* |
| 339 | ** COMMAND: leaves* |
| 340 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -329,11 +329,11 @@ | |
| 329 | "%s" |
| 330 | " AND event.objid IN (SELECT rid FROM leaves)" |
| 331 | " ORDER BY event.mtime DESC", |
| 332 | timeline_query_for_tty() |
| 333 | ); |
| 334 | print_timeline(&q, 20, 79, 0); |
| 335 | db_finalize(&q); |
| 336 | } |
| 337 | |
| 338 | /* |
| 339 | ** COMMAND: leaves* |
| 340 |
+1
-1
| --- src/search.c | ||
| +++ src/search.c | ||
| @@ -225,8 +225,8 @@ | ||
| 225 | 225 | if(nLimit>0){ |
| 226 | 226 | blob_appendf(&sql, "LIMIT %d", nLimit); |
| 227 | 227 | } |
| 228 | 228 | db_prepare(&q, blob_str(&sql)); |
| 229 | 229 | blob_reset(&sql); |
| 230 | - print_timeline(&q, 1000, 0); | |
| 230 | + print_timeline(&q, 1000, 79, 0); | |
| 231 | 231 | db_finalize(&q); |
| 232 | 232 | } |
| 233 | 233 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -225,8 +225,8 @@ | |
| 225 | if(nLimit>0){ |
| 226 | blob_appendf(&sql, "LIMIT %d", nLimit); |
| 227 | } |
| 228 | db_prepare(&q, blob_str(&sql)); |
| 229 | blob_reset(&sql); |
| 230 | print_timeline(&q, 1000, 0); |
| 231 | db_finalize(&q); |
| 232 | } |
| 233 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -225,8 +225,8 @@ | |
| 225 | if(nLimit>0){ |
| 226 | blob_appendf(&sql, "LIMIT %d", nLimit); |
| 227 | } |
| 228 | db_prepare(&q, blob_str(&sql)); |
| 229 | blob_reset(&sql); |
| 230 | print_timeline(&q, 1000, 79, 0); |
| 231 | db_finalize(&q); |
| 232 | } |
| 233 |
+1
-1
| --- src/tag.c | ||
| +++ src/tag.c | ||
| @@ -472,11 +472,11 @@ | ||
| 472 | 472 | if(nFindLimit>0){ |
| 473 | 473 | blob_appendf(&sql, " LIMIT %d", nFindLimit); |
| 474 | 474 | } |
| 475 | 475 | db_prepare(&q, "%s", blob_str(&sql)); |
| 476 | 476 | blob_reset(&sql); |
| 477 | - print_timeline(&q, 2000, 0); | |
| 477 | + print_timeline(&q, 2000, 79, 0); | |
| 478 | 478 | db_finalize(&q); |
| 479 | 479 | } |
| 480 | 480 | } |
| 481 | 481 | }else |
| 482 | 482 | |
| 483 | 483 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -472,11 +472,11 @@ | |
| 472 | if(nFindLimit>0){ |
| 473 | blob_appendf(&sql, " LIMIT %d", nFindLimit); |
| 474 | } |
| 475 | db_prepare(&q, "%s", blob_str(&sql)); |
| 476 | blob_reset(&sql); |
| 477 | print_timeline(&q, 2000, 0); |
| 478 | db_finalize(&q); |
| 479 | } |
| 480 | } |
| 481 | }else |
| 482 | |
| 483 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -472,11 +472,11 @@ | |
| 472 | if(nFindLimit>0){ |
| 473 | blob_appendf(&sql, " LIMIT %d", nFindLimit); |
| 474 | } |
| 475 | db_prepare(&q, "%s", blob_str(&sql)); |
| 476 | blob_reset(&sql); |
| 477 | print_timeline(&q, 2000, 79, 0); |
| 478 | db_finalize(&q); |
| 479 | } |
| 480 | } |
| 481 | }else |
| 482 | |
| 483 |
+10
-6
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1499,11 +1499,14 @@ | ||
| 1499 | 1499 | |
| 1500 | 1500 | /* |
| 1501 | 1501 | ** The input query q selects various records. Print a human-readable |
| 1502 | 1502 | ** summary of those records. |
| 1503 | 1503 | ** |
| 1504 | -** Limit the number of entries printed to nLine. | |
| 1504 | +** Limit the number of lines printed to mxLine. If mxLine is zero or | |
| 1505 | +** negative there is no limit. The line limit is approximate because | |
| 1506 | +** it is only checked on a per-entry basis. In verbose mode, the file | |
| 1507 | +** name details are considered to be part of the entry. | |
| 1505 | 1508 | ** |
| 1506 | 1509 | ** The query should return these columns: |
| 1507 | 1510 | ** |
| 1508 | 1511 | ** 0. rid |
| 1509 | 1512 | ** 1. uuid |
| @@ -1512,11 +1515,11 @@ | ||
| 1512 | 1515 | ** 4. Number of non-merge children |
| 1513 | 1516 | ** 5. Number of parents |
| 1514 | 1517 | ** 6. mtime |
| 1515 | 1518 | ** 7. branch |
| 1516 | 1519 | */ |
| 1517 | -void print_timeline(Stmt *q, int mxLine, int verboseFlag){ | |
| 1520 | +void print_timeline(Stmt *q, int mxLine, int width, int verboseFlag){ | |
| 1518 | 1521 | int nLine = 0; |
| 1519 | 1522 | char zPrevDate[20]; |
| 1520 | 1523 | const char *zCurrentUuid=0; |
| 1521 | 1524 | int fchngQueryInit = 0; /* True if fchngQuery is initialized */ |
| 1522 | 1525 | Stmt fchngQuery; /* Query for file changes on check-ins */ |
| @@ -1525,11 +1528,11 @@ | ||
| 1525 | 1528 | if( g.localOpen ){ |
| 1526 | 1529 | int rid = db_lget_int("checkout", 0); |
| 1527 | 1530 | zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 1528 | 1531 | } |
| 1529 | 1532 | |
| 1530 | - while( db_step(q)==SQLITE_ROW && nLine<=mxLine ){ | |
| 1533 | + while( db_step(q)==SQLITE_ROW && (mxLine<=0 || nLine<=mxLine) ){ | |
| 1531 | 1534 | int rid = db_column_int(q, 0); |
| 1532 | 1535 | const char *zId = db_column_text(q, 1); |
| 1533 | 1536 | const char *zDate = db_column_text(q, 2); |
| 1534 | 1537 | const char *zCom = db_column_text(q, 3); |
| 1535 | 1538 | int nChild = db_column_int(q, 4); |
| @@ -1541,11 +1544,11 @@ | ||
| 1541 | 1544 | |
| 1542 | 1545 | sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId); |
| 1543 | 1546 | if( memcmp(zDate, zPrevDate, 10) ){ |
| 1544 | 1547 | fossil_print("=== %.10s ===\n", zDate); |
| 1545 | 1548 | memcpy(zPrevDate, zDate, 10); |
| 1546 | - nLine++; | |
| 1549 | + nLine++; /* record another line */ | |
| 1547 | 1550 | } |
| 1548 | 1551 | if( zCom==0 ) zCom = ""; |
| 1549 | 1552 | fossil_print("%.8s ", &zDate[11]); |
| 1550 | 1553 | zPrefix[0] = 0; |
| 1551 | 1554 | if( nParent>1 ){ |
| @@ -1565,11 +1568,11 @@ | ||
| 1565 | 1568 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1566 | 1569 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1567 | 1570 | n += strlen(zPrefix); |
| 1568 | 1571 | } |
| 1569 | 1572 | zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); |
| 1570 | - nLine += comment_print(zFree, 9, 79); | |
| 1573 | + nLine += comment_print(zFree, 9, width); /* record another X lines */ | |
| 1571 | 1574 | sqlite3_free(zFree); |
| 1572 | 1575 | |
| 1573 | 1576 | if(verboseFlag){ |
| 1574 | 1577 | if( !fchngQueryInit ){ |
| 1575 | 1578 | db_prepare(&fchngQuery, |
| @@ -1594,10 +1597,11 @@ | ||
| 1594 | 1597 | }else if( isDel ){ |
| 1595 | 1598 | fossil_print(" DELETED %s\n",zFilename); |
| 1596 | 1599 | }else{ |
| 1597 | 1600 | fossil_print(" EDITED %s\n", zFilename); |
| 1598 | 1601 | } |
| 1602 | + nLine++; /* record another line */ | |
| 1599 | 1603 | } |
| 1600 | 1604 | db_reset(&fchngQuery); |
| 1601 | 1605 | } |
| 1602 | 1606 | } |
| 1603 | 1607 | if( fchngQueryInit ) db_finalize(&fchngQuery); |
| @@ -1781,11 +1785,11 @@ | ||
| 1781 | 1785 | blob_appendf(&sql, " AND event.type=%Q ", zType); |
| 1782 | 1786 | } |
| 1783 | 1787 | blob_appendf(&sql, " ORDER BY event.mtime DESC"); |
| 1784 | 1788 | db_prepare(&q, blob_str(&sql)); |
| 1785 | 1789 | blob_reset(&sql); |
| 1786 | - print_timeline(&q, n, verboseFlag); | |
| 1790 | + print_timeline(&q, n, 79, verboseFlag); | |
| 1787 | 1791 | db_finalize(&q); |
| 1788 | 1792 | } |
| 1789 | 1793 | |
| 1790 | 1794 | /* |
| 1791 | 1795 | ** This is a version of the "localtime()" function from the standard |
| 1792 | 1796 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1499,11 +1499,14 @@ | |
| 1499 | |
| 1500 | /* |
| 1501 | ** The input query q selects various records. Print a human-readable |
| 1502 | ** summary of those records. |
| 1503 | ** |
| 1504 | ** Limit the number of entries printed to nLine. |
| 1505 | ** |
| 1506 | ** The query should return these columns: |
| 1507 | ** |
| 1508 | ** 0. rid |
| 1509 | ** 1. uuid |
| @@ -1512,11 +1515,11 @@ | |
| 1512 | ** 4. Number of non-merge children |
| 1513 | ** 5. Number of parents |
| 1514 | ** 6. mtime |
| 1515 | ** 7. branch |
| 1516 | */ |
| 1517 | void print_timeline(Stmt *q, int mxLine, int verboseFlag){ |
| 1518 | int nLine = 0; |
| 1519 | char zPrevDate[20]; |
| 1520 | const char *zCurrentUuid=0; |
| 1521 | int fchngQueryInit = 0; /* True if fchngQuery is initialized */ |
| 1522 | Stmt fchngQuery; /* Query for file changes on check-ins */ |
| @@ -1525,11 +1528,11 @@ | |
| 1525 | if( g.localOpen ){ |
| 1526 | int rid = db_lget_int("checkout", 0); |
| 1527 | zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 1528 | } |
| 1529 | |
| 1530 | while( db_step(q)==SQLITE_ROW && nLine<=mxLine ){ |
| 1531 | int rid = db_column_int(q, 0); |
| 1532 | const char *zId = db_column_text(q, 1); |
| 1533 | const char *zDate = db_column_text(q, 2); |
| 1534 | const char *zCom = db_column_text(q, 3); |
| 1535 | int nChild = db_column_int(q, 4); |
| @@ -1541,11 +1544,11 @@ | |
| 1541 | |
| 1542 | sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId); |
| 1543 | if( memcmp(zDate, zPrevDate, 10) ){ |
| 1544 | fossil_print("=== %.10s ===\n", zDate); |
| 1545 | memcpy(zPrevDate, zDate, 10); |
| 1546 | nLine++; |
| 1547 | } |
| 1548 | if( zCom==0 ) zCom = ""; |
| 1549 | fossil_print("%.8s ", &zDate[11]); |
| 1550 | zPrefix[0] = 0; |
| 1551 | if( nParent>1 ){ |
| @@ -1565,11 +1568,11 @@ | |
| 1565 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1566 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1567 | n += strlen(zPrefix); |
| 1568 | } |
| 1569 | zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); |
| 1570 | nLine += comment_print(zFree, 9, 79); |
| 1571 | sqlite3_free(zFree); |
| 1572 | |
| 1573 | if(verboseFlag){ |
| 1574 | if( !fchngQueryInit ){ |
| 1575 | db_prepare(&fchngQuery, |
| @@ -1594,10 +1597,11 @@ | |
| 1594 | }else if( isDel ){ |
| 1595 | fossil_print(" DELETED %s\n",zFilename); |
| 1596 | }else{ |
| 1597 | fossil_print(" EDITED %s\n", zFilename); |
| 1598 | } |
| 1599 | } |
| 1600 | db_reset(&fchngQuery); |
| 1601 | } |
| 1602 | } |
| 1603 | if( fchngQueryInit ) db_finalize(&fchngQuery); |
| @@ -1781,11 +1785,11 @@ | |
| 1781 | blob_appendf(&sql, " AND event.type=%Q ", zType); |
| 1782 | } |
| 1783 | blob_appendf(&sql, " ORDER BY event.mtime DESC"); |
| 1784 | db_prepare(&q, blob_str(&sql)); |
| 1785 | blob_reset(&sql); |
| 1786 | print_timeline(&q, n, verboseFlag); |
| 1787 | db_finalize(&q); |
| 1788 | } |
| 1789 | |
| 1790 | /* |
| 1791 | ** This is a version of the "localtime()" function from the standard |
| 1792 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1499,11 +1499,14 @@ | |
| 1499 | |
| 1500 | /* |
| 1501 | ** The input query q selects various records. Print a human-readable |
| 1502 | ** summary of those records. |
| 1503 | ** |
| 1504 | ** Limit the number of lines printed to mxLine. If mxLine is zero or |
| 1505 | ** negative there is no limit. The line limit is approximate because |
| 1506 | ** it is only checked on a per-entry basis. In verbose mode, the file |
| 1507 | ** name details are considered to be part of the entry. |
| 1508 | ** |
| 1509 | ** The query should return these columns: |
| 1510 | ** |
| 1511 | ** 0. rid |
| 1512 | ** 1. uuid |
| @@ -1512,11 +1515,11 @@ | |
| 1515 | ** 4. Number of non-merge children |
| 1516 | ** 5. Number of parents |
| 1517 | ** 6. mtime |
| 1518 | ** 7. branch |
| 1519 | */ |
| 1520 | void print_timeline(Stmt *q, int mxLine, int width, int verboseFlag){ |
| 1521 | int nLine = 0; |
| 1522 | char zPrevDate[20]; |
| 1523 | const char *zCurrentUuid=0; |
| 1524 | int fchngQueryInit = 0; /* True if fchngQuery is initialized */ |
| 1525 | Stmt fchngQuery; /* Query for file changes on check-ins */ |
| @@ -1525,11 +1528,11 @@ | |
| 1528 | if( g.localOpen ){ |
| 1529 | int rid = db_lget_int("checkout", 0); |
| 1530 | zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 1531 | } |
| 1532 | |
| 1533 | while( db_step(q)==SQLITE_ROW && (mxLine<=0 || nLine<=mxLine) ){ |
| 1534 | int rid = db_column_int(q, 0); |
| 1535 | const char *zId = db_column_text(q, 1); |
| 1536 | const char *zDate = db_column_text(q, 2); |
| 1537 | const char *zCom = db_column_text(q, 3); |
| 1538 | int nChild = db_column_int(q, 4); |
| @@ -1541,11 +1544,11 @@ | |
| 1544 | |
| 1545 | sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId); |
| 1546 | if( memcmp(zDate, zPrevDate, 10) ){ |
| 1547 | fossil_print("=== %.10s ===\n", zDate); |
| 1548 | memcpy(zPrevDate, zDate, 10); |
| 1549 | nLine++; /* record another line */ |
| 1550 | } |
| 1551 | if( zCom==0 ) zCom = ""; |
| 1552 | fossil_print("%.8s ", &zDate[11]); |
| 1553 | zPrefix[0] = 0; |
| 1554 | if( nParent>1 ){ |
| @@ -1565,11 +1568,11 @@ | |
| 1568 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1569 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1570 | n += strlen(zPrefix); |
| 1571 | } |
| 1572 | zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); |
| 1573 | nLine += comment_print(zFree, 9, width); /* record another X lines */ |
| 1574 | sqlite3_free(zFree); |
| 1575 | |
| 1576 | if(verboseFlag){ |
| 1577 | if( !fchngQueryInit ){ |
| 1578 | db_prepare(&fchngQuery, |
| @@ -1594,10 +1597,11 @@ | |
| 1597 | }else if( isDel ){ |
| 1598 | fossil_print(" DELETED %s\n",zFilename); |
| 1599 | }else{ |
| 1600 | fossil_print(" EDITED %s\n", zFilename); |
| 1601 | } |
| 1602 | nLine++; /* record another line */ |
| 1603 | } |
| 1604 | db_reset(&fchngQuery); |
| 1605 | } |
| 1606 | } |
| 1607 | if( fchngQueryInit ) db_finalize(&fchngQuery); |
| @@ -1781,11 +1785,11 @@ | |
| 1785 | blob_appendf(&sql, " AND event.type=%Q ", zType); |
| 1786 | } |
| 1787 | blob_appendf(&sql, " ORDER BY event.mtime DESC"); |
| 1788 | db_prepare(&q, blob_str(&sql)); |
| 1789 | blob_reset(&sql); |
| 1790 | print_timeline(&q, n, 79, verboseFlag); |
| 1791 | db_finalize(&q); |
| 1792 | } |
| 1793 | |
| 1794 | /* |
| 1795 | ** This is a version of the "localtime()" function from the standard |
| 1796 |
+10
-6
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1499,11 +1499,14 @@ | ||
| 1499 | 1499 | |
| 1500 | 1500 | /* |
| 1501 | 1501 | ** The input query q selects various records. Print a human-readable |
| 1502 | 1502 | ** summary of those records. |
| 1503 | 1503 | ** |
| 1504 | -** Limit the number of entries printed to nLine. | |
| 1504 | +** Limit the number of lines printed to mxLine. If mxLine is zero or | |
| 1505 | +** negative there is no limit. The line limit is approximate because | |
| 1506 | +** it is only checked on a per-entry basis. In verbose mode, the file | |
| 1507 | +** name details are considered to be part of the entry. | |
| 1505 | 1508 | ** |
| 1506 | 1509 | ** The query should return these columns: |
| 1507 | 1510 | ** |
| 1508 | 1511 | ** 0. rid |
| 1509 | 1512 | ** 1. uuid |
| @@ -1512,11 +1515,11 @@ | ||
| 1512 | 1515 | ** 4. Number of non-merge children |
| 1513 | 1516 | ** 5. Number of parents |
| 1514 | 1517 | ** 6. mtime |
| 1515 | 1518 | ** 7. branch |
| 1516 | 1519 | */ |
| 1517 | -void print_timeline(Stmt *q, int mxLine, int verboseFlag){ | |
| 1520 | +void print_timeline(Stmt *q, int mxLine, int width, int verboseFlag){ | |
| 1518 | 1521 | int nLine = 0; |
| 1519 | 1522 | char zPrevDate[20]; |
| 1520 | 1523 | const char *zCurrentUuid=0; |
| 1521 | 1524 | int fchngQueryInit = 0; /* True if fchngQuery is initialized */ |
| 1522 | 1525 | Stmt fchngQuery; /* Query for file changes on check-ins */ |
| @@ -1525,11 +1528,11 @@ | ||
| 1525 | 1528 | if( g.localOpen ){ |
| 1526 | 1529 | int rid = db_lget_int("checkout", 0); |
| 1527 | 1530 | zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 1528 | 1531 | } |
| 1529 | 1532 | |
| 1530 | - while( db_step(q)==SQLITE_ROW && nLine<=mxLine ){ | |
| 1533 | + while( db_step(q)==SQLITE_ROW && (mxLine<=0 || nLine<=mxLine) ){ | |
| 1531 | 1534 | int rid = db_column_int(q, 0); |
| 1532 | 1535 | const char *zId = db_column_text(q, 1); |
| 1533 | 1536 | const char *zDate = db_column_text(q, 2); |
| 1534 | 1537 | const char *zCom = db_column_text(q, 3); |
| 1535 | 1538 | int nChild = db_column_int(q, 4); |
| @@ -1541,11 +1544,11 @@ | ||
| 1541 | 1544 | |
| 1542 | 1545 | sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId); |
| 1543 | 1546 | if( memcmp(zDate, zPrevDate, 10) ){ |
| 1544 | 1547 | fossil_print("=== %.10s ===\n", zDate); |
| 1545 | 1548 | memcpy(zPrevDate, zDate, 10); |
| 1546 | - nLine++; | |
| 1549 | + nLine++; /* record another line */ | |
| 1547 | 1550 | } |
| 1548 | 1551 | if( zCom==0 ) zCom = ""; |
| 1549 | 1552 | fossil_print("%.8s ", &zDate[11]); |
| 1550 | 1553 | zPrefix[0] = 0; |
| 1551 | 1554 | if( nParent>1 ){ |
| @@ -1565,11 +1568,11 @@ | ||
| 1565 | 1568 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1566 | 1569 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1567 | 1570 | n += strlen(zPrefix); |
| 1568 | 1571 | } |
| 1569 | 1572 | zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); |
| 1570 | - nLine += comment_print(zFree, 9, 79); | |
| 1573 | + nLine += comment_print(zFree, 9, width); /* record another X lines */ | |
| 1571 | 1574 | sqlite3_free(zFree); |
| 1572 | 1575 | |
| 1573 | 1576 | if(verboseFlag){ |
| 1574 | 1577 | if( !fchngQueryInit ){ |
| 1575 | 1578 | db_prepare(&fchngQuery, |
| @@ -1594,10 +1597,11 @@ | ||
| 1594 | 1597 | }else if( isDel ){ |
| 1595 | 1598 | fossil_print(" DELETED %s\n",zFilename); |
| 1596 | 1599 | }else{ |
| 1597 | 1600 | fossil_print(" EDITED %s\n", zFilename); |
| 1598 | 1601 | } |
| 1602 | + nLine++; /* record another line */ | |
| 1599 | 1603 | } |
| 1600 | 1604 | db_reset(&fchngQuery); |
| 1601 | 1605 | } |
| 1602 | 1606 | } |
| 1603 | 1607 | if( fchngQueryInit ) db_finalize(&fchngQuery); |
| @@ -1781,11 +1785,11 @@ | ||
| 1781 | 1785 | blob_appendf(&sql, " AND event.type=%Q ", zType); |
| 1782 | 1786 | } |
| 1783 | 1787 | blob_appendf(&sql, " ORDER BY event.mtime DESC"); |
| 1784 | 1788 | db_prepare(&q, blob_str(&sql)); |
| 1785 | 1789 | blob_reset(&sql); |
| 1786 | - print_timeline(&q, n, verboseFlag); | |
| 1790 | + print_timeline(&q, n, 79, verboseFlag); | |
| 1787 | 1791 | db_finalize(&q); |
| 1788 | 1792 | } |
| 1789 | 1793 | |
| 1790 | 1794 | /* |
| 1791 | 1795 | ** This is a version of the "localtime()" function from the standard |
| 1792 | 1796 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1499,11 +1499,14 @@ | |
| 1499 | |
| 1500 | /* |
| 1501 | ** The input query q selects various records. Print a human-readable |
| 1502 | ** summary of those records. |
| 1503 | ** |
| 1504 | ** Limit the number of entries printed to nLine. |
| 1505 | ** |
| 1506 | ** The query should return these columns: |
| 1507 | ** |
| 1508 | ** 0. rid |
| 1509 | ** 1. uuid |
| @@ -1512,11 +1515,11 @@ | |
| 1512 | ** 4. Number of non-merge children |
| 1513 | ** 5. Number of parents |
| 1514 | ** 6. mtime |
| 1515 | ** 7. branch |
| 1516 | */ |
| 1517 | void print_timeline(Stmt *q, int mxLine, int verboseFlag){ |
| 1518 | int nLine = 0; |
| 1519 | char zPrevDate[20]; |
| 1520 | const char *zCurrentUuid=0; |
| 1521 | int fchngQueryInit = 0; /* True if fchngQuery is initialized */ |
| 1522 | Stmt fchngQuery; /* Query for file changes on check-ins */ |
| @@ -1525,11 +1528,11 @@ | |
| 1525 | if( g.localOpen ){ |
| 1526 | int rid = db_lget_int("checkout", 0); |
| 1527 | zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 1528 | } |
| 1529 | |
| 1530 | while( db_step(q)==SQLITE_ROW && nLine<=mxLine ){ |
| 1531 | int rid = db_column_int(q, 0); |
| 1532 | const char *zId = db_column_text(q, 1); |
| 1533 | const char *zDate = db_column_text(q, 2); |
| 1534 | const char *zCom = db_column_text(q, 3); |
| 1535 | int nChild = db_column_int(q, 4); |
| @@ -1541,11 +1544,11 @@ | |
| 1541 | |
| 1542 | sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId); |
| 1543 | if( memcmp(zDate, zPrevDate, 10) ){ |
| 1544 | fossil_print("=== %.10s ===\n", zDate); |
| 1545 | memcpy(zPrevDate, zDate, 10); |
| 1546 | nLine++; |
| 1547 | } |
| 1548 | if( zCom==0 ) zCom = ""; |
| 1549 | fossil_print("%.8s ", &zDate[11]); |
| 1550 | zPrefix[0] = 0; |
| 1551 | if( nParent>1 ){ |
| @@ -1565,11 +1568,11 @@ | |
| 1565 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1566 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1567 | n += strlen(zPrefix); |
| 1568 | } |
| 1569 | zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); |
| 1570 | nLine += comment_print(zFree, 9, 79); |
| 1571 | sqlite3_free(zFree); |
| 1572 | |
| 1573 | if(verboseFlag){ |
| 1574 | if( !fchngQueryInit ){ |
| 1575 | db_prepare(&fchngQuery, |
| @@ -1594,10 +1597,11 @@ | |
| 1594 | }else if( isDel ){ |
| 1595 | fossil_print(" DELETED %s\n",zFilename); |
| 1596 | }else{ |
| 1597 | fossil_print(" EDITED %s\n", zFilename); |
| 1598 | } |
| 1599 | } |
| 1600 | db_reset(&fchngQuery); |
| 1601 | } |
| 1602 | } |
| 1603 | if( fchngQueryInit ) db_finalize(&fchngQuery); |
| @@ -1781,11 +1785,11 @@ | |
| 1781 | blob_appendf(&sql, " AND event.type=%Q ", zType); |
| 1782 | } |
| 1783 | blob_appendf(&sql, " ORDER BY event.mtime DESC"); |
| 1784 | db_prepare(&q, blob_str(&sql)); |
| 1785 | blob_reset(&sql); |
| 1786 | print_timeline(&q, n, verboseFlag); |
| 1787 | db_finalize(&q); |
| 1788 | } |
| 1789 | |
| 1790 | /* |
| 1791 | ** This is a version of the "localtime()" function from the standard |
| 1792 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1499,11 +1499,14 @@ | |
| 1499 | |
| 1500 | /* |
| 1501 | ** The input query q selects various records. Print a human-readable |
| 1502 | ** summary of those records. |
| 1503 | ** |
| 1504 | ** Limit the number of lines printed to mxLine. If mxLine is zero or |
| 1505 | ** negative there is no limit. The line limit is approximate because |
| 1506 | ** it is only checked on a per-entry basis. In verbose mode, the file |
| 1507 | ** name details are considered to be part of the entry. |
| 1508 | ** |
| 1509 | ** The query should return these columns: |
| 1510 | ** |
| 1511 | ** 0. rid |
| 1512 | ** 1. uuid |
| @@ -1512,11 +1515,11 @@ | |
| 1515 | ** 4. Number of non-merge children |
| 1516 | ** 5. Number of parents |
| 1517 | ** 6. mtime |
| 1518 | ** 7. branch |
| 1519 | */ |
| 1520 | void print_timeline(Stmt *q, int mxLine, int width, int verboseFlag){ |
| 1521 | int nLine = 0; |
| 1522 | char zPrevDate[20]; |
| 1523 | const char *zCurrentUuid=0; |
| 1524 | int fchngQueryInit = 0; /* True if fchngQuery is initialized */ |
| 1525 | Stmt fchngQuery; /* Query for file changes on check-ins */ |
| @@ -1525,11 +1528,11 @@ | |
| 1528 | if( g.localOpen ){ |
| 1529 | int rid = db_lget_int("checkout", 0); |
| 1530 | zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 1531 | } |
| 1532 | |
| 1533 | while( db_step(q)==SQLITE_ROW && (mxLine<=0 || nLine<=mxLine) ){ |
| 1534 | int rid = db_column_int(q, 0); |
| 1535 | const char *zId = db_column_text(q, 1); |
| 1536 | const char *zDate = db_column_text(q, 2); |
| 1537 | const char *zCom = db_column_text(q, 3); |
| 1538 | int nChild = db_column_int(q, 4); |
| @@ -1541,11 +1544,11 @@ | |
| 1544 | |
| 1545 | sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId); |
| 1546 | if( memcmp(zDate, zPrevDate, 10) ){ |
| 1547 | fossil_print("=== %.10s ===\n", zDate); |
| 1548 | memcpy(zPrevDate, zDate, 10); |
| 1549 | nLine++; /* record another line */ |
| 1550 | } |
| 1551 | if( zCom==0 ) zCom = ""; |
| 1552 | fossil_print("%.8s ", &zDate[11]); |
| 1553 | zPrefix[0] = 0; |
| 1554 | if( nParent>1 ){ |
| @@ -1565,11 +1568,11 @@ | |
| 1568 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1569 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1570 | n += strlen(zPrefix); |
| 1571 | } |
| 1572 | zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); |
| 1573 | nLine += comment_print(zFree, 9, width); /* record another X lines */ |
| 1574 | sqlite3_free(zFree); |
| 1575 | |
| 1576 | if(verboseFlag){ |
| 1577 | if( !fchngQueryInit ){ |
| 1578 | db_prepare(&fchngQuery, |
| @@ -1594,10 +1597,11 @@ | |
| 1597 | }else if( isDel ){ |
| 1598 | fossil_print(" DELETED %s\n",zFilename); |
| 1599 | }else{ |
| 1600 | fossil_print(" EDITED %s\n", zFilename); |
| 1601 | } |
| 1602 | nLine++; /* record another line */ |
| 1603 | } |
| 1604 | db_reset(&fchngQuery); |
| 1605 | } |
| 1606 | } |
| 1607 | if( fchngQueryInit ) db_finalize(&fchngQuery); |
| @@ -1781,11 +1785,11 @@ | |
| 1785 | blob_appendf(&sql, " AND event.type=%Q ", zType); |
| 1786 | } |
| 1787 | blob_appendf(&sql, " ORDER BY event.mtime DESC"); |
| 1788 | db_prepare(&q, blob_str(&sql)); |
| 1789 | blob_reset(&sql); |
| 1790 | print_timeline(&q, n, 79, verboseFlag); |
| 1791 | db_finalize(&q); |
| 1792 | } |
| 1793 | |
| 1794 | /* |
| 1795 | ** This is a version of the "localtime()" function from the standard |
| 1796 |
+1
-1
| --- src/update.c | ||
| +++ src/update.c | ||
| @@ -188,11 +188,11 @@ | ||
| 188 | 188 | "%s " |
| 189 | 189 | " AND event.objid IN leaves" |
| 190 | 190 | " ORDER BY event.mtime DESC", |
| 191 | 191 | timeline_query_for_tty() |
| 192 | 192 | ); |
| 193 | - print_timeline(&q, 100, 0); | |
| 193 | + print_timeline(&q, 100, 79, 0); | |
| 194 | 194 | db_finalize(&q); |
| 195 | 195 | fossil_fatal("Multiple descendants"); |
| 196 | 196 | } |
| 197 | 197 | } |
| 198 | 198 | tid = db_int(0, "SELECT rid FROM leaves, event" |
| 199 | 199 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -188,11 +188,11 @@ | |
| 188 | "%s " |
| 189 | " AND event.objid IN leaves" |
| 190 | " ORDER BY event.mtime DESC", |
| 191 | timeline_query_for_tty() |
| 192 | ); |
| 193 | print_timeline(&q, 100, 0); |
| 194 | db_finalize(&q); |
| 195 | fossil_fatal("Multiple descendants"); |
| 196 | } |
| 197 | } |
| 198 | tid = db_int(0, "SELECT rid FROM leaves, event" |
| 199 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -188,11 +188,11 @@ | |
| 188 | "%s " |
| 189 | " AND event.objid IN leaves" |
| 190 | " ORDER BY event.mtime DESC", |
| 191 | timeline_query_for_tty() |
| 192 | ); |
| 193 | print_timeline(&q, 100, 79, 0); |
| 194 | db_finalize(&q); |
| 195 | fossil_fatal("Multiple descendants"); |
| 196 | } |
| 197 | } |
| 198 | tid = db_int(0, "SELECT rid FROM leaves, event" |
| 199 |
+1
-1
| --- www/concepts.wiki | ||
| +++ www/concepts.wiki | ||
| @@ -79,11 +79,11 @@ | ||
| 79 | 79 | |
| 80 | 80 | <h3>2.1 Identification Of Artifacts</h3> |
| 81 | 81 | |
| 82 | 82 | A particular version of a particular file is called an "artifact". |
| 83 | 83 | Each artifact has a universally unique name which is the |
| 84 | -<a href="http://en.wikipedia.org/wiki/SHA">SHA1</a> hash of the content | |
| 84 | +<a href="http://en.wikipedia.org/wiki/SHA1">SHA1</a> hash of the content | |
| 85 | 85 | of that file expressed as 40 characters of lower-case hexadecimal. Such |
| 86 | 86 | a hash is referred to as the Artifact Identifier or Artifact ID |
| 87 | 87 | for the artifact. The SHA1 algorithm is created with the purpose of |
| 88 | 88 | providing a highly forgery-resistant identifier for a file. Given any |
| 89 | 89 | file it is simple to find the artifact ID for that file. But given a |
| 90 | 90 |
| --- www/concepts.wiki | |
| +++ www/concepts.wiki | |
| @@ -79,11 +79,11 @@ | |
| 79 | |
| 80 | <h3>2.1 Identification Of Artifacts</h3> |
| 81 | |
| 82 | A particular version of a particular file is called an "artifact". |
| 83 | Each artifact has a universally unique name which is the |
| 84 | <a href="http://en.wikipedia.org/wiki/SHA">SHA1</a> hash of the content |
| 85 | of that file expressed as 40 characters of lower-case hexadecimal. Such |
| 86 | a hash is referred to as the Artifact Identifier or Artifact ID |
| 87 | for the artifact. The SHA1 algorithm is created with the purpose of |
| 88 | providing a highly forgery-resistant identifier for a file. Given any |
| 89 | file it is simple to find the artifact ID for that file. But given a |
| 90 |
| --- www/concepts.wiki | |
| +++ www/concepts.wiki | |
| @@ -79,11 +79,11 @@ | |
| 79 | |
| 80 | <h3>2.1 Identification Of Artifacts</h3> |
| 81 | |
| 82 | A particular version of a particular file is called an "artifact". |
| 83 | Each artifact has a universally unique name which is the |
| 84 | <a href="http://en.wikipedia.org/wiki/SHA1">SHA1</a> hash of the content |
| 85 | of that file expressed as 40 characters of lower-case hexadecimal. Such |
| 86 | a hash is referred to as the Artifact Identifier or Artifact ID |
| 87 | for the artifact. The SHA1 algorithm is created with the purpose of |
| 88 | providing a highly forgery-resistant identifier for a file. Given any |
| 89 | file it is simple to find the artifact ID for that file. But given a |
| 90 |