Fossil SCM
Merge trunk. Add the "-W|--width WIDTH" option to "fossil timeline". Default is 80.
Commit
3710f2ac5bddee0559065866d7f0bd788a4f3799
Parent
25d0049045e2caa…
14 files changed
+15
-8
+3
-4
+3
-4
+2
-2
+1
-1
+1
-1
+1
-1
+1
-1
+1
-1
+1
-1
+14
-6
+14
-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 |
+3
-4
| --- src/comformat.c | ||
| +++ src/comformat.c | ||
| @@ -26,31 +26,30 @@ | ||
| 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 = fossil_malloc(strlen(zText)+400); | |
| 40 | 38 | int lineCnt = 0; |
| 41 | 39 | |
| 42 | 40 | for(;;){ |
| 43 | 41 | while( fossil_isspace(zText[0]) ){ zText++; } |
| 44 | 42 | if( zText[0]==0 ){ |
| 45 | 43 | if( doIndent==0 ){ |
| 46 | 44 | fossil_print("\n"); |
| 47 | 45 | lineCnt = 1; |
| 48 | 46 | } |
| 47 | + fossil_free(zBuf); | |
| 49 | 48 | return lineCnt; |
| 50 | 49 | } |
| 51 | - for(sk=si=i=k=0; zText[i] && k<tlen; i++){ | |
| 50 | + for(sk=si=i=k=0; zText[i] && ((tlen<=0)||(k<tlen)); i++){ | |
| 52 | 51 | char c = zText[i]; |
| 53 | 52 | if( fossil_isspace(c) ){ |
| 54 | 53 | si = i; |
| 55 | 54 | sk = k; |
| 56 | 55 | if( k==0 || zBuf[k-1]!=' ' ){ |
| 57 | 56 |
| --- src/comformat.c | |
| +++ src/comformat.c | |
| @@ -26,31 +26,30 @@ | |
| 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 | si = i; |
| 55 | sk = k; |
| 56 | if( k==0 || zBuf[k-1]!=' ' ){ |
| 57 |
| --- src/comformat.c | |
| +++ src/comformat.c | |
| @@ -26,31 +26,30 @@ | |
| 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 = fossil_malloc(strlen(zText)+400); |
| 38 | int lineCnt = 0; |
| 39 | |
| 40 | for(;;){ |
| 41 | while( fossil_isspace(zText[0]) ){ zText++; } |
| 42 | if( zText[0]==0 ){ |
| 43 | if( doIndent==0 ){ |
| 44 | fossil_print("\n"); |
| 45 | lineCnt = 1; |
| 46 | } |
| 47 | fossil_free(zBuf); |
| 48 | return lineCnt; |
| 49 | } |
| 50 | for(sk=si=i=k=0; zText[i] && ((tlen<=0)||(k<tlen)); i++){ |
| 51 | char c = zText[i]; |
| 52 | if( fossil_isspace(c) ){ |
| 53 | si = i; |
| 54 | sk = k; |
| 55 | if( k==0 || zBuf[k-1]!=' ' ){ |
| 56 |
+3
-4
| --- src/comformat.c | ||
| +++ src/comformat.c | ||
| @@ -26,31 +26,30 @@ | ||
| 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 = fossil_malloc(strlen(zText)+400); | |
| 40 | 38 | int lineCnt = 0; |
| 41 | 39 | |
| 42 | 40 | for(;;){ |
| 43 | 41 | while( fossil_isspace(zText[0]) ){ zText++; } |
| 44 | 42 | if( zText[0]==0 ){ |
| 45 | 43 | if( doIndent==0 ){ |
| 46 | 44 | fossil_print("\n"); |
| 47 | 45 | lineCnt = 1; |
| 48 | 46 | } |
| 47 | + fossil_free(zBuf); | |
| 49 | 48 | return lineCnt; |
| 50 | 49 | } |
| 51 | - for(sk=si=i=k=0; zText[i] && k<tlen; i++){ | |
| 50 | + for(sk=si=i=k=0; zText[i] && ((tlen<=0)||(k<tlen)); i++){ | |
| 52 | 51 | char c = zText[i]; |
| 53 | 52 | if( fossil_isspace(c) ){ |
| 54 | 53 | si = i; |
| 55 | 54 | sk = k; |
| 56 | 55 | if( k==0 || zBuf[k-1]!=' ' ){ |
| 57 | 56 |
| --- src/comformat.c | |
| +++ src/comformat.c | |
| @@ -26,31 +26,30 @@ | |
| 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 | si = i; |
| 55 | sk = k; |
| 56 | if( k==0 || zBuf[k-1]!=' ' ){ |
| 57 |
| --- src/comformat.c | |
| +++ src/comformat.c | |
| @@ -26,31 +26,30 @@ | |
| 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 = fossil_malloc(strlen(zText)+400); |
| 38 | int lineCnt = 0; |
| 39 | |
| 40 | for(;;){ |
| 41 | while( fossil_isspace(zText[0]) ){ zText++; } |
| 42 | if( zText[0]==0 ){ |
| 43 | if( doIndent==0 ){ |
| 44 | fossil_print("\n"); |
| 45 | lineCnt = 1; |
| 46 | } |
| 47 | fossil_free(zBuf); |
| 48 | return lineCnt; |
| 49 | } |
| 50 | for(sk=si=i=k=0; zText[i] && ((tlen<=0)||(k<tlen)); i++){ |
| 51 | char c = zText[i]; |
| 52 | if( fossil_isspace(c) ){ |
| 53 | si = i; |
| 54 | sk = k; |
| 55 | if( k==0 || zBuf[k-1]!=' ' ){ |
| 56 |
+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, 80, 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, 80, 0); |
| 335 | db_finalize(&q); |
| 336 | } |
| 337 | |
| 338 | /* |
| 339 | ** COMMAND: leaves* |
| 340 |
+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, 80, 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, 80, 0); |
| 335 | db_finalize(&q); |
| 336 | } |
| 337 | |
| 338 | /* |
| 339 | ** COMMAND: leaves* |
| 340 |
+1
-1
| --- src/search.c | ||
| +++ src/search.c | ||
| @@ -222,8 +222,8 @@ | ||
| 222 | 222 | blob_appendf(&sql,"AND x>%d ", iBest/3); |
| 223 | 223 | } |
| 224 | 224 | blob_append(&sql, "ORDER BY x DESC, date DESC ", -1); |
| 225 | 225 | db_prepare(&q, blob_str(&sql)); |
| 226 | 226 | blob_reset(&sql); |
| 227 | - print_timeline(&q, nLimit, 0); | |
| 227 | + print_timeline(&q, nLimit, 80, 0); | |
| 228 | 228 | db_finalize(&q); |
| 229 | 229 | } |
| 230 | 230 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -222,8 +222,8 @@ | |
| 222 | blob_appendf(&sql,"AND x>%d ", iBest/3); |
| 223 | } |
| 224 | blob_append(&sql, "ORDER BY x DESC, date DESC ", -1); |
| 225 | db_prepare(&q, blob_str(&sql)); |
| 226 | blob_reset(&sql); |
| 227 | print_timeline(&q, nLimit, 0); |
| 228 | db_finalize(&q); |
| 229 | } |
| 230 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -222,8 +222,8 @@ | |
| 222 | blob_appendf(&sql,"AND x>%d ", iBest/3); |
| 223 | } |
| 224 | blob_append(&sql, "ORDER BY x DESC, date DESC ", -1); |
| 225 | db_prepare(&q, blob_str(&sql)); |
| 226 | blob_reset(&sql); |
| 227 | print_timeline(&q, nLimit, 80, 0); |
| 228 | db_finalize(&q); |
| 229 | } |
| 230 |
+1
-1
| --- src/search.c | ||
| +++ src/search.c | ||
| @@ -222,8 +222,8 @@ | ||
| 222 | 222 | blob_appendf(&sql,"AND x>%d ", iBest/3); |
| 223 | 223 | } |
| 224 | 224 | blob_append(&sql, "ORDER BY x DESC, date DESC ", -1); |
| 225 | 225 | db_prepare(&q, blob_str(&sql)); |
| 226 | 226 | blob_reset(&sql); |
| 227 | - print_timeline(&q, nLimit, 0); | |
| 227 | + print_timeline(&q, nLimit, 80, 0); | |
| 228 | 228 | db_finalize(&q); |
| 229 | 229 | } |
| 230 | 230 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -222,8 +222,8 @@ | |
| 222 | blob_appendf(&sql,"AND x>%d ", iBest/3); |
| 223 | } |
| 224 | blob_append(&sql, "ORDER BY x DESC, date DESC ", -1); |
| 225 | db_prepare(&q, blob_str(&sql)); |
| 226 | blob_reset(&sql); |
| 227 | print_timeline(&q, nLimit, 0); |
| 228 | db_finalize(&q); |
| 229 | } |
| 230 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -222,8 +222,8 @@ | |
| 222 | blob_appendf(&sql,"AND x>%d ", iBest/3); |
| 223 | } |
| 224 | blob_append(&sql, "ORDER BY x DESC, date DESC ", -1); |
| 225 | db_prepare(&q, blob_str(&sql)); |
| 226 | blob_reset(&sql); |
| 227 | print_timeline(&q, nLimit, 80, 0); |
| 228 | db_finalize(&q); |
| 229 | } |
| 230 |
+1
-1
| --- src/tag.c | ||
| +++ src/tag.c | ||
| @@ -469,11 +469,11 @@ | ||
| 469 | 469 | " ORDER BY event.mtime DESC", |
| 470 | 470 | timeline_query_for_tty(), zType, tagid |
| 471 | 471 | ); |
| 472 | 472 | db_prepare(&q, "%s", blob_str(&sql)); |
| 473 | 473 | blob_reset(&sql); |
| 474 | - print_timeline(&q, nFindLimit, 0); | |
| 474 | + print_timeline(&q, nFindLimit, 80, 0); | |
| 475 | 475 | db_finalize(&q); |
| 476 | 476 | } |
| 477 | 477 | } |
| 478 | 478 | }else |
| 479 | 479 | |
| 480 | 480 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -469,11 +469,11 @@ | |
| 469 | " ORDER BY event.mtime DESC", |
| 470 | timeline_query_for_tty(), zType, tagid |
| 471 | ); |
| 472 | db_prepare(&q, "%s", blob_str(&sql)); |
| 473 | blob_reset(&sql); |
| 474 | print_timeline(&q, nFindLimit, 0); |
| 475 | db_finalize(&q); |
| 476 | } |
| 477 | } |
| 478 | }else |
| 479 | |
| 480 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -469,11 +469,11 @@ | |
| 469 | " ORDER BY event.mtime DESC", |
| 470 | timeline_query_for_tty(), zType, tagid |
| 471 | ); |
| 472 | db_prepare(&q, "%s", blob_str(&sql)); |
| 473 | blob_reset(&sql); |
| 474 | print_timeline(&q, nFindLimit, 80, 0); |
| 475 | db_finalize(&q); |
| 476 | } |
| 477 | } |
| 478 | }else |
| 479 | |
| 480 |
+1
-1
| --- src/tag.c | ||
| +++ src/tag.c | ||
| @@ -469,11 +469,11 @@ | ||
| 469 | 469 | " ORDER BY event.mtime DESC", |
| 470 | 470 | timeline_query_for_tty(), zType, tagid |
| 471 | 471 | ); |
| 472 | 472 | db_prepare(&q, "%s", blob_str(&sql)); |
| 473 | 473 | blob_reset(&sql); |
| 474 | - print_timeline(&q, nFindLimit, 0); | |
| 474 | + print_timeline(&q, nFindLimit, 80, 0); | |
| 475 | 475 | db_finalize(&q); |
| 476 | 476 | } |
| 477 | 477 | } |
| 478 | 478 | }else |
| 479 | 479 | |
| 480 | 480 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -469,11 +469,11 @@ | |
| 469 | " ORDER BY event.mtime DESC", |
| 470 | timeline_query_for_tty(), zType, tagid |
| 471 | ); |
| 472 | db_prepare(&q, "%s", blob_str(&sql)); |
| 473 | blob_reset(&sql); |
| 474 | print_timeline(&q, nFindLimit, 0); |
| 475 | db_finalize(&q); |
| 476 | } |
| 477 | } |
| 478 | }else |
| 479 | |
| 480 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -469,11 +469,11 @@ | |
| 469 | " ORDER BY event.mtime DESC", |
| 470 | timeline_query_for_tty(), zType, tagid |
| 471 | ); |
| 472 | db_prepare(&q, "%s", blob_str(&sql)); |
| 473 | blob_reset(&sql); |
| 474 | print_timeline(&q, nFindLimit, 80, 0); |
| 475 | db_finalize(&q); |
| 476 | } |
| 477 | } |
| 478 | }else |
| 479 | |
| 480 |
+14
-6
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1513,11 +1513,11 @@ | ||
| 1513 | 1513 | ** 4. Number of non-merge children |
| 1514 | 1514 | ** 5. Number of parents |
| 1515 | 1515 | ** 6. mtime |
| 1516 | 1516 | ** 7. branch |
| 1517 | 1517 | */ |
| 1518 | -void print_timeline(Stmt *q, int nLimit, int verboseFlag){ | |
| 1518 | +void print_timeline(Stmt *q, int nLimit, int width, int verboseFlag){ | |
| 1519 | 1519 | int nAbsLimit = (nLimit >= 0) ? nLimit : -nLimit; |
| 1520 | 1520 | int nLine = 0; |
| 1521 | 1521 | int nEntry = 0; |
| 1522 | 1522 | char zPrevDate[20]; |
| 1523 | 1523 | const char *zCurrentUuid=0; |
| @@ -1577,11 +1577,11 @@ | ||
| 1577 | 1577 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1578 | 1578 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1579 | 1579 | n += strlen(zPrefix); |
| 1580 | 1580 | } |
| 1581 | 1581 | zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); |
| 1582 | - nLine += comment_print(zFree, 9, 79); /* record another X lines */ | |
| 1582 | + nLine += comment_print(zFree, 9, width-1); /* record another X lines */ | |
| 1583 | 1583 | sqlite3_free(zFree); |
| 1584 | 1584 | |
| 1585 | 1585 | if(verboseFlag){ |
| 1586 | 1586 | if( !fchngQueryInit ){ |
| 1587 | 1587 | db_prepare(&fchngQuery, |
| @@ -1681,24 +1681,26 @@ | ||
| 1681 | 1681 | ** The DATETIME should be in the ISO8601 format. For |
| 1682 | 1682 | ** examples: "2007-08-18 07:21:21". You can also say "current" |
| 1683 | 1683 | ** for the current version or "now" for the current time. |
| 1684 | 1684 | ** |
| 1685 | 1685 | ** Options: |
| 1686 | -** -n|--limit N Output the first N changes (default 20) | |
| 1686 | +** -n|--limit N Output the first N entries (default 20 lines) | |
| 1687 | 1687 | ** -t|--type TYPE Output items from the given types only, such as: |
| 1688 | 1688 | ** ci = file commits only |
| 1689 | 1689 | ** e = events only |
| 1690 | 1690 | ** t = tickets only |
| 1691 | 1691 | ** w = wiki commits only |
| 1692 | 1692 | ** -v|--verbose Output the list of files changed by each commit |
| 1693 | 1693 | ** and the type of each change (edited, deleted, |
| 1694 | 1694 | ** etc.) after the checkin comment. |
| 1695 | +** -W|--width <num> With of lines (default 80). 0=no limit. | |
| 1695 | 1696 | */ |
| 1696 | 1697 | void timeline_cmd(void){ |
| 1697 | 1698 | Stmt q; |
| 1698 | - int n, k; | |
| 1699 | + int n, k, width; | |
| 1699 | 1700 | const char *zLimit; |
| 1701 | + const char *zWidth; | |
| 1700 | 1702 | const char *zType; |
| 1701 | 1703 | char *zOrigin; |
| 1702 | 1704 | char *zDate; |
| 1703 | 1705 | Blob sql; |
| 1704 | 1706 | int objid = 0; |
| @@ -1709,18 +1711,24 @@ | ||
| 1709 | 1711 | if( !verboseFlag){ |
| 1710 | 1712 | verboseFlag = find_option("showfiles","f", 0)!=0; /* deprecated */ |
| 1711 | 1713 | } |
| 1712 | 1714 | db_find_and_open_repository(0, 0); |
| 1713 | 1715 | zLimit = find_option("limit","n",1); |
| 1716 | + zWidth = find_option("width","W",1); | |
| 1714 | 1717 | zType = find_option("type","t",1); |
| 1715 | 1718 | if ( !zLimit ){ |
| 1716 | 1719 | zLimit = find_option("count",0,1); |
| 1717 | 1720 | } |
| 1718 | 1721 | if( zLimit ){ |
| 1719 | 1722 | n = atoi(zLimit); |
| 1720 | 1723 | }else{ |
| 1721 | 1724 | n = -20; |
| 1725 | + } | |
| 1726 | + if( zWidth ){ | |
| 1727 | + width = atoi(zWidth); | |
| 1728 | + }else{ | |
| 1729 | + width = 80; | |
| 1722 | 1730 | } |
| 1723 | 1731 | if( g.argc>=4 ){ |
| 1724 | 1732 | k = strlen(g.argv[2]); |
| 1725 | 1733 | if( strncmp(g.argv[2],"before",k)==0 ){ |
| 1726 | 1734 | mode = 1; |
| @@ -1733,11 +1741,11 @@ | ||
| 1733 | 1741 | }else if( strncmp(g.argv[2],"ancestors",k)==0 && k>1 ){ |
| 1734 | 1742 | mode = 4; |
| 1735 | 1743 | }else if( strncmp(g.argv[2],"parents",k)==0 ){ |
| 1736 | 1744 | mode = 4; |
| 1737 | 1745 | }else if(!zType && !zLimit){ |
| 1738 | - usage("?WHEN? ?BASELINE|DATETIME? ?-n|--limit N? ?-t|--type TYPE?"); | |
| 1746 | + usage("?WHEN? ?BASELINE|DATETIME? ?-n|--limit N? ?-t|--type TYPE? ?-W|--width WIDTH?"); | |
| 1739 | 1747 | } |
| 1740 | 1748 | if( '-' != *g.argv[3] ){ |
| 1741 | 1749 | zOrigin = g.argv[3]; |
| 1742 | 1750 | }else{ |
| 1743 | 1751 | zOrigin = "now"; |
| @@ -1795,11 +1803,11 @@ | ||
| 1795 | 1803 | blob_appendf(&sql, " AND event.type=%Q ", zType); |
| 1796 | 1804 | } |
| 1797 | 1805 | blob_appendf(&sql, " ORDER BY event.mtime DESC"); |
| 1798 | 1806 | db_prepare(&q, blob_str(&sql)); |
| 1799 | 1807 | blob_reset(&sql); |
| 1800 | - print_timeline(&q, n, verboseFlag); | |
| 1808 | + print_timeline(&q, n, width, verboseFlag); | |
| 1801 | 1809 | db_finalize(&q); |
| 1802 | 1810 | } |
| 1803 | 1811 | |
| 1804 | 1812 | /* |
| 1805 | 1813 | ** This is a version of the "localtime()" function from the standard |
| 1806 | 1814 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1513,11 +1513,11 @@ | |
| 1513 | ** 4. Number of non-merge children |
| 1514 | ** 5. Number of parents |
| 1515 | ** 6. mtime |
| 1516 | ** 7. branch |
| 1517 | */ |
| 1518 | void print_timeline(Stmt *q, int nLimit, int verboseFlag){ |
| 1519 | int nAbsLimit = (nLimit >= 0) ? nLimit : -nLimit; |
| 1520 | int nLine = 0; |
| 1521 | int nEntry = 0; |
| 1522 | char zPrevDate[20]; |
| 1523 | const char *zCurrentUuid=0; |
| @@ -1577,11 +1577,11 @@ | |
| 1577 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1578 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1579 | n += strlen(zPrefix); |
| 1580 | } |
| 1581 | zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); |
| 1582 | nLine += comment_print(zFree, 9, 79); /* record another X lines */ |
| 1583 | sqlite3_free(zFree); |
| 1584 | |
| 1585 | if(verboseFlag){ |
| 1586 | if( !fchngQueryInit ){ |
| 1587 | db_prepare(&fchngQuery, |
| @@ -1681,24 +1681,26 @@ | |
| 1681 | ** The DATETIME should be in the ISO8601 format. For |
| 1682 | ** examples: "2007-08-18 07:21:21". You can also say "current" |
| 1683 | ** for the current version or "now" for the current time. |
| 1684 | ** |
| 1685 | ** Options: |
| 1686 | ** -n|--limit N Output the first N changes (default 20) |
| 1687 | ** -t|--type TYPE Output items from the given types only, such as: |
| 1688 | ** ci = file commits only |
| 1689 | ** e = events only |
| 1690 | ** t = tickets only |
| 1691 | ** w = wiki commits only |
| 1692 | ** -v|--verbose Output the list of files changed by each commit |
| 1693 | ** and the type of each change (edited, deleted, |
| 1694 | ** etc.) after the checkin comment. |
| 1695 | */ |
| 1696 | void timeline_cmd(void){ |
| 1697 | Stmt q; |
| 1698 | int n, k; |
| 1699 | const char *zLimit; |
| 1700 | const char *zType; |
| 1701 | char *zOrigin; |
| 1702 | char *zDate; |
| 1703 | Blob sql; |
| 1704 | int objid = 0; |
| @@ -1709,18 +1711,24 @@ | |
| 1709 | if( !verboseFlag){ |
| 1710 | verboseFlag = find_option("showfiles","f", 0)!=0; /* deprecated */ |
| 1711 | } |
| 1712 | db_find_and_open_repository(0, 0); |
| 1713 | zLimit = find_option("limit","n",1); |
| 1714 | zType = find_option("type","t",1); |
| 1715 | if ( !zLimit ){ |
| 1716 | zLimit = find_option("count",0,1); |
| 1717 | } |
| 1718 | if( zLimit ){ |
| 1719 | n = atoi(zLimit); |
| 1720 | }else{ |
| 1721 | n = -20; |
| 1722 | } |
| 1723 | if( g.argc>=4 ){ |
| 1724 | k = strlen(g.argv[2]); |
| 1725 | if( strncmp(g.argv[2],"before",k)==0 ){ |
| 1726 | mode = 1; |
| @@ -1733,11 +1741,11 @@ | |
| 1733 | }else if( strncmp(g.argv[2],"ancestors",k)==0 && k>1 ){ |
| 1734 | mode = 4; |
| 1735 | }else if( strncmp(g.argv[2],"parents",k)==0 ){ |
| 1736 | mode = 4; |
| 1737 | }else if(!zType && !zLimit){ |
| 1738 | usage("?WHEN? ?BASELINE|DATETIME? ?-n|--limit N? ?-t|--type TYPE?"); |
| 1739 | } |
| 1740 | if( '-' != *g.argv[3] ){ |
| 1741 | zOrigin = g.argv[3]; |
| 1742 | }else{ |
| 1743 | zOrigin = "now"; |
| @@ -1795,11 +1803,11 @@ | |
| 1795 | blob_appendf(&sql, " AND event.type=%Q ", zType); |
| 1796 | } |
| 1797 | blob_appendf(&sql, " ORDER BY event.mtime DESC"); |
| 1798 | db_prepare(&q, blob_str(&sql)); |
| 1799 | blob_reset(&sql); |
| 1800 | print_timeline(&q, n, verboseFlag); |
| 1801 | db_finalize(&q); |
| 1802 | } |
| 1803 | |
| 1804 | /* |
| 1805 | ** This is a version of the "localtime()" function from the standard |
| 1806 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1513,11 +1513,11 @@ | |
| 1513 | ** 4. Number of non-merge children |
| 1514 | ** 5. Number of parents |
| 1515 | ** 6. mtime |
| 1516 | ** 7. branch |
| 1517 | */ |
| 1518 | void print_timeline(Stmt *q, int nLimit, int width, int verboseFlag){ |
| 1519 | int nAbsLimit = (nLimit >= 0) ? nLimit : -nLimit; |
| 1520 | int nLine = 0; |
| 1521 | int nEntry = 0; |
| 1522 | char zPrevDate[20]; |
| 1523 | const char *zCurrentUuid=0; |
| @@ -1577,11 +1577,11 @@ | |
| 1577 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1578 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1579 | n += strlen(zPrefix); |
| 1580 | } |
| 1581 | zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); |
| 1582 | nLine += comment_print(zFree, 9, width-1); /* record another X lines */ |
| 1583 | sqlite3_free(zFree); |
| 1584 | |
| 1585 | if(verboseFlag){ |
| 1586 | if( !fchngQueryInit ){ |
| 1587 | db_prepare(&fchngQuery, |
| @@ -1681,24 +1681,26 @@ | |
| 1681 | ** The DATETIME should be in the ISO8601 format. For |
| 1682 | ** examples: "2007-08-18 07:21:21". You can also say "current" |
| 1683 | ** for the current version or "now" for the current time. |
| 1684 | ** |
| 1685 | ** Options: |
| 1686 | ** -n|--limit N Output the first N entries (default 20 lines) |
| 1687 | ** -t|--type TYPE Output items from the given types only, such as: |
| 1688 | ** ci = file commits only |
| 1689 | ** e = events only |
| 1690 | ** t = tickets only |
| 1691 | ** w = wiki commits only |
| 1692 | ** -v|--verbose Output the list of files changed by each commit |
| 1693 | ** and the type of each change (edited, deleted, |
| 1694 | ** etc.) after the checkin comment. |
| 1695 | ** -W|--width <num> With of lines (default 80). 0=no limit. |
| 1696 | */ |
| 1697 | void timeline_cmd(void){ |
| 1698 | Stmt q; |
| 1699 | int n, k, width; |
| 1700 | const char *zLimit; |
| 1701 | const char *zWidth; |
| 1702 | const char *zType; |
| 1703 | char *zOrigin; |
| 1704 | char *zDate; |
| 1705 | Blob sql; |
| 1706 | int objid = 0; |
| @@ -1709,18 +1711,24 @@ | |
| 1711 | if( !verboseFlag){ |
| 1712 | verboseFlag = find_option("showfiles","f", 0)!=0; /* deprecated */ |
| 1713 | } |
| 1714 | db_find_and_open_repository(0, 0); |
| 1715 | zLimit = find_option("limit","n",1); |
| 1716 | zWidth = find_option("width","W",1); |
| 1717 | zType = find_option("type","t",1); |
| 1718 | if ( !zLimit ){ |
| 1719 | zLimit = find_option("count",0,1); |
| 1720 | } |
| 1721 | if( zLimit ){ |
| 1722 | n = atoi(zLimit); |
| 1723 | }else{ |
| 1724 | n = -20; |
| 1725 | } |
| 1726 | if( zWidth ){ |
| 1727 | width = atoi(zWidth); |
| 1728 | }else{ |
| 1729 | width = 80; |
| 1730 | } |
| 1731 | if( g.argc>=4 ){ |
| 1732 | k = strlen(g.argv[2]); |
| 1733 | if( strncmp(g.argv[2],"before",k)==0 ){ |
| 1734 | mode = 1; |
| @@ -1733,11 +1741,11 @@ | |
| 1741 | }else if( strncmp(g.argv[2],"ancestors",k)==0 && k>1 ){ |
| 1742 | mode = 4; |
| 1743 | }else if( strncmp(g.argv[2],"parents",k)==0 ){ |
| 1744 | mode = 4; |
| 1745 | }else if(!zType && !zLimit){ |
| 1746 | usage("?WHEN? ?BASELINE|DATETIME? ?-n|--limit N? ?-t|--type TYPE? ?-W|--width WIDTH?"); |
| 1747 | } |
| 1748 | if( '-' != *g.argv[3] ){ |
| 1749 | zOrigin = g.argv[3]; |
| 1750 | }else{ |
| 1751 | zOrigin = "now"; |
| @@ -1795,11 +1803,11 @@ | |
| 1803 | blob_appendf(&sql, " AND event.type=%Q ", zType); |
| 1804 | } |
| 1805 | blob_appendf(&sql, " ORDER BY event.mtime DESC"); |
| 1806 | db_prepare(&q, blob_str(&sql)); |
| 1807 | blob_reset(&sql); |
| 1808 | print_timeline(&q, n, width, verboseFlag); |
| 1809 | db_finalize(&q); |
| 1810 | } |
| 1811 | |
| 1812 | /* |
| 1813 | ** This is a version of the "localtime()" function from the standard |
| 1814 |
+14
-6
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1513,11 +1513,11 @@ | ||
| 1513 | 1513 | ** 4. Number of non-merge children |
| 1514 | 1514 | ** 5. Number of parents |
| 1515 | 1515 | ** 6. mtime |
| 1516 | 1516 | ** 7. branch |
| 1517 | 1517 | */ |
| 1518 | -void print_timeline(Stmt *q, int nLimit, int verboseFlag){ | |
| 1518 | +void print_timeline(Stmt *q, int nLimit, int width, int verboseFlag){ | |
| 1519 | 1519 | int nAbsLimit = (nLimit >= 0) ? nLimit : -nLimit; |
| 1520 | 1520 | int nLine = 0; |
| 1521 | 1521 | int nEntry = 0; |
| 1522 | 1522 | char zPrevDate[20]; |
| 1523 | 1523 | const char *zCurrentUuid=0; |
| @@ -1577,11 +1577,11 @@ | ||
| 1577 | 1577 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1578 | 1578 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1579 | 1579 | n += strlen(zPrefix); |
| 1580 | 1580 | } |
| 1581 | 1581 | zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); |
| 1582 | - nLine += comment_print(zFree, 9, 79); /* record another X lines */ | |
| 1582 | + nLine += comment_print(zFree, 9, width-1); /* record another X lines */ | |
| 1583 | 1583 | sqlite3_free(zFree); |
| 1584 | 1584 | |
| 1585 | 1585 | if(verboseFlag){ |
| 1586 | 1586 | if( !fchngQueryInit ){ |
| 1587 | 1587 | db_prepare(&fchngQuery, |
| @@ -1681,24 +1681,26 @@ | ||
| 1681 | 1681 | ** The DATETIME should be in the ISO8601 format. For |
| 1682 | 1682 | ** examples: "2007-08-18 07:21:21". You can also say "current" |
| 1683 | 1683 | ** for the current version or "now" for the current time. |
| 1684 | 1684 | ** |
| 1685 | 1685 | ** Options: |
| 1686 | -** -n|--limit N Output the first N changes (default 20) | |
| 1686 | +** -n|--limit N Output the first N entries (default 20 lines) | |
| 1687 | 1687 | ** -t|--type TYPE Output items from the given types only, such as: |
| 1688 | 1688 | ** ci = file commits only |
| 1689 | 1689 | ** e = events only |
| 1690 | 1690 | ** t = tickets only |
| 1691 | 1691 | ** w = wiki commits only |
| 1692 | 1692 | ** -v|--verbose Output the list of files changed by each commit |
| 1693 | 1693 | ** and the type of each change (edited, deleted, |
| 1694 | 1694 | ** etc.) after the checkin comment. |
| 1695 | +** -W|--width <num> With of lines (default 80). 0=no limit. | |
| 1695 | 1696 | */ |
| 1696 | 1697 | void timeline_cmd(void){ |
| 1697 | 1698 | Stmt q; |
| 1698 | - int n, k; | |
| 1699 | + int n, k, width; | |
| 1699 | 1700 | const char *zLimit; |
| 1701 | + const char *zWidth; | |
| 1700 | 1702 | const char *zType; |
| 1701 | 1703 | char *zOrigin; |
| 1702 | 1704 | char *zDate; |
| 1703 | 1705 | Blob sql; |
| 1704 | 1706 | int objid = 0; |
| @@ -1709,18 +1711,24 @@ | ||
| 1709 | 1711 | if( !verboseFlag){ |
| 1710 | 1712 | verboseFlag = find_option("showfiles","f", 0)!=0; /* deprecated */ |
| 1711 | 1713 | } |
| 1712 | 1714 | db_find_and_open_repository(0, 0); |
| 1713 | 1715 | zLimit = find_option("limit","n",1); |
| 1716 | + zWidth = find_option("width","W",1); | |
| 1714 | 1717 | zType = find_option("type","t",1); |
| 1715 | 1718 | if ( !zLimit ){ |
| 1716 | 1719 | zLimit = find_option("count",0,1); |
| 1717 | 1720 | } |
| 1718 | 1721 | if( zLimit ){ |
| 1719 | 1722 | n = atoi(zLimit); |
| 1720 | 1723 | }else{ |
| 1721 | 1724 | n = -20; |
| 1725 | + } | |
| 1726 | + if( zWidth ){ | |
| 1727 | + width = atoi(zWidth); | |
| 1728 | + }else{ | |
| 1729 | + width = 80; | |
| 1722 | 1730 | } |
| 1723 | 1731 | if( g.argc>=4 ){ |
| 1724 | 1732 | k = strlen(g.argv[2]); |
| 1725 | 1733 | if( strncmp(g.argv[2],"before",k)==0 ){ |
| 1726 | 1734 | mode = 1; |
| @@ -1733,11 +1741,11 @@ | ||
| 1733 | 1741 | }else if( strncmp(g.argv[2],"ancestors",k)==0 && k>1 ){ |
| 1734 | 1742 | mode = 4; |
| 1735 | 1743 | }else if( strncmp(g.argv[2],"parents",k)==0 ){ |
| 1736 | 1744 | mode = 4; |
| 1737 | 1745 | }else if(!zType && !zLimit){ |
| 1738 | - usage("?WHEN? ?BASELINE|DATETIME? ?-n|--limit N? ?-t|--type TYPE?"); | |
| 1746 | + usage("?WHEN? ?BASELINE|DATETIME? ?-n|--limit N? ?-t|--type TYPE? ?-W|--width WIDTH?"); | |
| 1739 | 1747 | } |
| 1740 | 1748 | if( '-' != *g.argv[3] ){ |
| 1741 | 1749 | zOrigin = g.argv[3]; |
| 1742 | 1750 | }else{ |
| 1743 | 1751 | zOrigin = "now"; |
| @@ -1795,11 +1803,11 @@ | ||
| 1795 | 1803 | blob_appendf(&sql, " AND event.type=%Q ", zType); |
| 1796 | 1804 | } |
| 1797 | 1805 | blob_appendf(&sql, " ORDER BY event.mtime DESC"); |
| 1798 | 1806 | db_prepare(&q, blob_str(&sql)); |
| 1799 | 1807 | blob_reset(&sql); |
| 1800 | - print_timeline(&q, n, verboseFlag); | |
| 1808 | + print_timeline(&q, n, width, verboseFlag); | |
| 1801 | 1809 | db_finalize(&q); |
| 1802 | 1810 | } |
| 1803 | 1811 | |
| 1804 | 1812 | /* |
| 1805 | 1813 | ** This is a version of the "localtime()" function from the standard |
| 1806 | 1814 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1513,11 +1513,11 @@ | |
| 1513 | ** 4. Number of non-merge children |
| 1514 | ** 5. Number of parents |
| 1515 | ** 6. mtime |
| 1516 | ** 7. branch |
| 1517 | */ |
| 1518 | void print_timeline(Stmt *q, int nLimit, int verboseFlag){ |
| 1519 | int nAbsLimit = (nLimit >= 0) ? nLimit : -nLimit; |
| 1520 | int nLine = 0; |
| 1521 | int nEntry = 0; |
| 1522 | char zPrevDate[20]; |
| 1523 | const char *zCurrentUuid=0; |
| @@ -1577,11 +1577,11 @@ | |
| 1577 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1578 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1579 | n += strlen(zPrefix); |
| 1580 | } |
| 1581 | zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); |
| 1582 | nLine += comment_print(zFree, 9, 79); /* record another X lines */ |
| 1583 | sqlite3_free(zFree); |
| 1584 | |
| 1585 | if(verboseFlag){ |
| 1586 | if( !fchngQueryInit ){ |
| 1587 | db_prepare(&fchngQuery, |
| @@ -1681,24 +1681,26 @@ | |
| 1681 | ** The DATETIME should be in the ISO8601 format. For |
| 1682 | ** examples: "2007-08-18 07:21:21". You can also say "current" |
| 1683 | ** for the current version or "now" for the current time. |
| 1684 | ** |
| 1685 | ** Options: |
| 1686 | ** -n|--limit N Output the first N changes (default 20) |
| 1687 | ** -t|--type TYPE Output items from the given types only, such as: |
| 1688 | ** ci = file commits only |
| 1689 | ** e = events only |
| 1690 | ** t = tickets only |
| 1691 | ** w = wiki commits only |
| 1692 | ** -v|--verbose Output the list of files changed by each commit |
| 1693 | ** and the type of each change (edited, deleted, |
| 1694 | ** etc.) after the checkin comment. |
| 1695 | */ |
| 1696 | void timeline_cmd(void){ |
| 1697 | Stmt q; |
| 1698 | int n, k; |
| 1699 | const char *zLimit; |
| 1700 | const char *zType; |
| 1701 | char *zOrigin; |
| 1702 | char *zDate; |
| 1703 | Blob sql; |
| 1704 | int objid = 0; |
| @@ -1709,18 +1711,24 @@ | |
| 1709 | if( !verboseFlag){ |
| 1710 | verboseFlag = find_option("showfiles","f", 0)!=0; /* deprecated */ |
| 1711 | } |
| 1712 | db_find_and_open_repository(0, 0); |
| 1713 | zLimit = find_option("limit","n",1); |
| 1714 | zType = find_option("type","t",1); |
| 1715 | if ( !zLimit ){ |
| 1716 | zLimit = find_option("count",0,1); |
| 1717 | } |
| 1718 | if( zLimit ){ |
| 1719 | n = atoi(zLimit); |
| 1720 | }else{ |
| 1721 | n = -20; |
| 1722 | } |
| 1723 | if( g.argc>=4 ){ |
| 1724 | k = strlen(g.argv[2]); |
| 1725 | if( strncmp(g.argv[2],"before",k)==0 ){ |
| 1726 | mode = 1; |
| @@ -1733,11 +1741,11 @@ | |
| 1733 | }else if( strncmp(g.argv[2],"ancestors",k)==0 && k>1 ){ |
| 1734 | mode = 4; |
| 1735 | }else if( strncmp(g.argv[2],"parents",k)==0 ){ |
| 1736 | mode = 4; |
| 1737 | }else if(!zType && !zLimit){ |
| 1738 | usage("?WHEN? ?BASELINE|DATETIME? ?-n|--limit N? ?-t|--type TYPE?"); |
| 1739 | } |
| 1740 | if( '-' != *g.argv[3] ){ |
| 1741 | zOrigin = g.argv[3]; |
| 1742 | }else{ |
| 1743 | zOrigin = "now"; |
| @@ -1795,11 +1803,11 @@ | |
| 1795 | blob_appendf(&sql, " AND event.type=%Q ", zType); |
| 1796 | } |
| 1797 | blob_appendf(&sql, " ORDER BY event.mtime DESC"); |
| 1798 | db_prepare(&q, blob_str(&sql)); |
| 1799 | blob_reset(&sql); |
| 1800 | print_timeline(&q, n, verboseFlag); |
| 1801 | db_finalize(&q); |
| 1802 | } |
| 1803 | |
| 1804 | /* |
| 1805 | ** This is a version of the "localtime()" function from the standard |
| 1806 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1513,11 +1513,11 @@ | |
| 1513 | ** 4. Number of non-merge children |
| 1514 | ** 5. Number of parents |
| 1515 | ** 6. mtime |
| 1516 | ** 7. branch |
| 1517 | */ |
| 1518 | void print_timeline(Stmt *q, int nLimit, int width, int verboseFlag){ |
| 1519 | int nAbsLimit = (nLimit >= 0) ? nLimit : -nLimit; |
| 1520 | int nLine = 0; |
| 1521 | int nEntry = 0; |
| 1522 | char zPrevDate[20]; |
| 1523 | const char *zCurrentUuid=0; |
| @@ -1577,11 +1577,11 @@ | |
| 1577 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1578 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1579 | n += strlen(zPrefix); |
| 1580 | } |
| 1581 | zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); |
| 1582 | nLine += comment_print(zFree, 9, width-1); /* record another X lines */ |
| 1583 | sqlite3_free(zFree); |
| 1584 | |
| 1585 | if(verboseFlag){ |
| 1586 | if( !fchngQueryInit ){ |
| 1587 | db_prepare(&fchngQuery, |
| @@ -1681,24 +1681,26 @@ | |
| 1681 | ** The DATETIME should be in the ISO8601 format. For |
| 1682 | ** examples: "2007-08-18 07:21:21". You can also say "current" |
| 1683 | ** for the current version or "now" for the current time. |
| 1684 | ** |
| 1685 | ** Options: |
| 1686 | ** -n|--limit N Output the first N entries (default 20 lines) |
| 1687 | ** -t|--type TYPE Output items from the given types only, such as: |
| 1688 | ** ci = file commits only |
| 1689 | ** e = events only |
| 1690 | ** t = tickets only |
| 1691 | ** w = wiki commits only |
| 1692 | ** -v|--verbose Output the list of files changed by each commit |
| 1693 | ** and the type of each change (edited, deleted, |
| 1694 | ** etc.) after the checkin comment. |
| 1695 | ** -W|--width <num> With of lines (default 80). 0=no limit. |
| 1696 | */ |
| 1697 | void timeline_cmd(void){ |
| 1698 | Stmt q; |
| 1699 | int n, k, width; |
| 1700 | const char *zLimit; |
| 1701 | const char *zWidth; |
| 1702 | const char *zType; |
| 1703 | char *zOrigin; |
| 1704 | char *zDate; |
| 1705 | Blob sql; |
| 1706 | int objid = 0; |
| @@ -1709,18 +1711,24 @@ | |
| 1711 | if( !verboseFlag){ |
| 1712 | verboseFlag = find_option("showfiles","f", 0)!=0; /* deprecated */ |
| 1713 | } |
| 1714 | db_find_and_open_repository(0, 0); |
| 1715 | zLimit = find_option("limit","n",1); |
| 1716 | zWidth = find_option("width","W",1); |
| 1717 | zType = find_option("type","t",1); |
| 1718 | if ( !zLimit ){ |
| 1719 | zLimit = find_option("count",0,1); |
| 1720 | } |
| 1721 | if( zLimit ){ |
| 1722 | n = atoi(zLimit); |
| 1723 | }else{ |
| 1724 | n = -20; |
| 1725 | } |
| 1726 | if( zWidth ){ |
| 1727 | width = atoi(zWidth); |
| 1728 | }else{ |
| 1729 | width = 80; |
| 1730 | } |
| 1731 | if( g.argc>=4 ){ |
| 1732 | k = strlen(g.argv[2]); |
| 1733 | if( strncmp(g.argv[2],"before",k)==0 ){ |
| 1734 | mode = 1; |
| @@ -1733,11 +1741,11 @@ | |
| 1741 | }else if( strncmp(g.argv[2],"ancestors",k)==0 && k>1 ){ |
| 1742 | mode = 4; |
| 1743 | }else if( strncmp(g.argv[2],"parents",k)==0 ){ |
| 1744 | mode = 4; |
| 1745 | }else if(!zType && !zLimit){ |
| 1746 | usage("?WHEN? ?BASELINE|DATETIME? ?-n|--limit N? ?-t|--type TYPE? ?-W|--width WIDTH?"); |
| 1747 | } |
| 1748 | if( '-' != *g.argv[3] ){ |
| 1749 | zOrigin = g.argv[3]; |
| 1750 | }else{ |
| 1751 | zOrigin = "now"; |
| @@ -1795,11 +1803,11 @@ | |
| 1803 | blob_appendf(&sql, " AND event.type=%Q ", zType); |
| 1804 | } |
| 1805 | blob_appendf(&sql, " ORDER BY event.mtime DESC"); |
| 1806 | db_prepare(&q, blob_str(&sql)); |
| 1807 | blob_reset(&sql); |
| 1808 | print_timeline(&q, n, width, verboseFlag); |
| 1809 | db_finalize(&q); |
| 1810 | } |
| 1811 | |
| 1812 | /* |
| 1813 | ** This is a version of the "localtime()" function from the standard |
| 1814 |
+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, 80, 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, 80, 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
| --- 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, 80, 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, 80, 0); |
| 194 | db_finalize(&q); |
| 195 | fossil_fatal("Multiple descendants"); |
| 196 | } |
| 197 | } |
| 198 | tid = db_int(0, "SELECT rid FROM leaves, event" |
| 199 |