Fossil SCM

Merge latest change from trunk.

mgagnon 2013-10-26 19:17 UTC hide-diff-on-vdiff_page merge
Commit eb1b310fc726649d97fae660226a73ee8a860409
+15 -8
--- src/checkin.c
+++ src/checkin.c
@@ -990,16 +990,18 @@
990990
const char *zColor; /* Modified value of p->zColor */
991991
992992
assert( pBaseline==0 || pBaseline->zBaseline==0 );
993993
assert( pBaseline==0 || zBaselineUuid!=0 );
994994
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
+ }
10011003
}
10021004
if( pBaseline ){
10031005
blob_appendf(pOut, "B %s\n", zBaselineUuid);
10041006
manifest_file_rewind(pBaseline);
10051007
pFile = manifest_file_next(pBaseline, 0);
@@ -1091,11 +1093,11 @@
10911093
nFBcard++;
10921094
}
10931095
if( p->zMimetype && p->zMimetype[0] ){
10941096
blob_appendf(pOut, "N %F\n", p->zMimetype);
10951097
}
1096
- if( zParentUuid ){
1098
+ if( vid ){
10971099
blob_appendf(pOut, "P %s", zParentUuid);
10981100
if( p->verifyDate ) checkin_verify_younger(vid, zParentUuid, zDate);
10991101
free(zParentUuid);
11001102
db_prepare(&q, "SELECT merge FROM vmerge WHERE id=0 OR id<-2");
11011103
while( db_step(&q)==SQLITE_ROW ){
@@ -1610,12 +1612,17 @@
16101612
}
16111613
16121614
/*
16131615
** Do not allow a commit that will cause a fork unless the --allow-fork
16141616
** or --force flags is used, or unless this is a private check-in.
1617
+ ** The initial commit MUST have tags "trunk" and "sym-trunk".
16151618
*/
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
16171624
&& g.markPrivate==0 && !is_a_leaf(vid)
16181625
){
16191626
fossil_fatal("would fork. \"update\" first or use --allow-fork.");
16201627
}
16211628
16221629
--- 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 @@
2626
** Given a comment string zText, format that string for printing
2727
** on a TTY. Assume that the output cursors is indent spaces from
2828
** the left margin and that a single line can contain no more than
2929
** lineLength characters. Indent all subsequent lines by indent.
3030
**
31
-** lineLength must be less than 400.
32
-**
3331
** Return the number of newlines that are output.
3432
*/
3533
int comment_print(const char *zText, int indent, int lineLength){
3634
int tlen = lineLength - indent;
3735
int si, sk, i, k;
3836
int doIndent = 0;
39
- char zBuf[400];
37
+ char *zBuf;
38
+ char zBuffer[400];
4039
int lineCnt = 0;
4140
41
+ if( lineLength > sizeof(zBuffer) ){
42
+ zBuf = fossil_malloc(lineLength);
43
+ }else{
44
+ zBuf = zBuffer;
45
+ }
4246
for(;;){
4347
while( fossil_isspace(zText[0]) ){ zText++; }
4448
if( zText[0]==0 ){
4549
if( doIndent==0 ){
4650
fossil_print("\n");
4751
lineCnt = 1;
4852
}
53
+ if( zBuf!=zBuffer) fossil_free(zBuf);
4954
return lineCnt;
5055
}
5156
for(sk=si=i=k=0; zText[i] && k<tlen; i++){
5257
char c = zText[i];
5358
if( fossil_isspace(c) ){
5459
--- 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 @@
2525
#ifndef _FILE_OFFSET_BITS
2626
# define _FILE_OFFSET_BITS 64
2727
#endif
2828
#define _LARGEFILE_SOURCE 1
2929
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)
3232
# define _USE_32BIT_TIME_T
3333
#endif
3434
3535
#ifdef HAVE_AUTOCONFIG_H
3636
#include "autoconfig.h"
3737
--- 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
--- src/descendants.c
+++ src/descendants.c
@@ -329,11 +329,11 @@
329329
"%s"
330330
" AND event.objid IN (SELECT rid FROM leaves)"
331331
" ORDER BY event.mtime DESC",
332332
timeline_query_for_tty()
333333
);
334
- print_timeline(&q, 20, 0);
334
+ print_timeline(&q, 20, 79, 0);
335335
db_finalize(&q);
336336
}
337337
338338
/*
339339
** COMMAND: leaves*
340340
--- 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 @@
225225
if(nLimit>0){
226226
blob_appendf(&sql, "LIMIT %d", nLimit);
227227
}
228228
db_prepare(&q, blob_str(&sql));
229229
blob_reset(&sql);
230
- print_timeline(&q, 1000, 0);
230
+ print_timeline(&q, 1000, 79, 0);
231231
db_finalize(&q);
232232
}
233233
--- 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 @@
472472
if(nFindLimit>0){
473473
blob_appendf(&sql, " LIMIT %d", nFindLimit);
474474
}
475475
db_prepare(&q, "%s", blob_str(&sql));
476476
blob_reset(&sql);
477
- print_timeline(&q, 2000, 0);
477
+ print_timeline(&q, 2000, 79, 0);
478478
db_finalize(&q);
479479
}
480480
}
481481
}else
482482
483483
--- 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 @@
14991499
15001500
/*
15011501
** The input query q selects various records. Print a human-readable
15021502
** summary of those records.
15031503
**
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.
15051508
**
15061509
** The query should return these columns:
15071510
**
15081511
** 0. rid
15091512
** 1. uuid
@@ -1512,11 +1515,11 @@
15121515
** 4. Number of non-merge children
15131516
** 5. Number of parents
15141517
** 6. mtime
15151518
** 7. branch
15161519
*/
1517
-void print_timeline(Stmt *q, int mxLine, int verboseFlag){
1520
+void print_timeline(Stmt *q, int mxLine, int width, int verboseFlag){
15181521
int nLine = 0;
15191522
char zPrevDate[20];
15201523
const char *zCurrentUuid=0;
15211524
int fchngQueryInit = 0; /* True if fchngQuery is initialized */
15221525
Stmt fchngQuery; /* Query for file changes on check-ins */
@@ -1525,11 +1528,11 @@
15251528
if( g.localOpen ){
15261529
int rid = db_lget_int("checkout", 0);
15271530
zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
15281531
}
15291532
1530
- while( db_step(q)==SQLITE_ROW && nLine<=mxLine ){
1533
+ while( db_step(q)==SQLITE_ROW && (mxLine<=0 || nLine<=mxLine) ){
15311534
int rid = db_column_int(q, 0);
15321535
const char *zId = db_column_text(q, 1);
15331536
const char *zDate = db_column_text(q, 2);
15341537
const char *zCom = db_column_text(q, 3);
15351538
int nChild = db_column_int(q, 4);
@@ -1541,11 +1544,11 @@
15411544
15421545
sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId);
15431546
if( memcmp(zDate, zPrevDate, 10) ){
15441547
fossil_print("=== %.10s ===\n", zDate);
15451548
memcpy(zPrevDate, zDate, 10);
1546
- nLine++;
1549
+ nLine++; /* record another line */
15471550
}
15481551
if( zCom==0 ) zCom = "";
15491552
fossil_print("%.8s ", &zDate[11]);
15501553
zPrefix[0] = 0;
15511554
if( nParent>1 ){
@@ -1565,11 +1568,11 @@
15651568
if( fossil_strcmp(zCurrentUuid,zId)==0 ){
15661569
sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* ");
15671570
n += strlen(zPrefix);
15681571
}
15691572
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 */
15711574
sqlite3_free(zFree);
15721575
15731576
if(verboseFlag){
15741577
if( !fchngQueryInit ){
15751578
db_prepare(&fchngQuery,
@@ -1594,10 +1597,11 @@
15941597
}else if( isDel ){
15951598
fossil_print(" DELETED %s\n",zFilename);
15961599
}else{
15971600
fossil_print(" EDITED %s\n", zFilename);
15981601
}
1602
+ nLine++; /* record another line */
15991603
}
16001604
db_reset(&fchngQuery);
16011605
}
16021606
}
16031607
if( fchngQueryInit ) db_finalize(&fchngQuery);
@@ -1781,11 +1785,11 @@
17811785
blob_appendf(&sql, " AND event.type=%Q ", zType);
17821786
}
17831787
blob_appendf(&sql, " ORDER BY event.mtime DESC");
17841788
db_prepare(&q, blob_str(&sql));
17851789
blob_reset(&sql);
1786
- print_timeline(&q, n, verboseFlag);
1790
+ print_timeline(&q, n, 79, verboseFlag);
17871791
db_finalize(&q);
17881792
}
17891793
17901794
/*
17911795
** This is a version of the "localtime()" function from the standard
17921796
--- 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 @@
14991499
15001500
/*
15011501
** The input query q selects various records. Print a human-readable
15021502
** summary of those records.
15031503
**
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.
15051508
**
15061509
** The query should return these columns:
15071510
**
15081511
** 0. rid
15091512
** 1. uuid
@@ -1512,11 +1515,11 @@
15121515
** 4. Number of non-merge children
15131516
** 5. Number of parents
15141517
** 6. mtime
15151518
** 7. branch
15161519
*/
1517
-void print_timeline(Stmt *q, int mxLine, int verboseFlag){
1520
+void print_timeline(Stmt *q, int mxLine, int width, int verboseFlag){
15181521
int nLine = 0;
15191522
char zPrevDate[20];
15201523
const char *zCurrentUuid=0;
15211524
int fchngQueryInit = 0; /* True if fchngQuery is initialized */
15221525
Stmt fchngQuery; /* Query for file changes on check-ins */
@@ -1525,11 +1528,11 @@
15251528
if( g.localOpen ){
15261529
int rid = db_lget_int("checkout", 0);
15271530
zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
15281531
}
15291532
1530
- while( db_step(q)==SQLITE_ROW && nLine<=mxLine ){
1533
+ while( db_step(q)==SQLITE_ROW && (mxLine<=0 || nLine<=mxLine) ){
15311534
int rid = db_column_int(q, 0);
15321535
const char *zId = db_column_text(q, 1);
15331536
const char *zDate = db_column_text(q, 2);
15341537
const char *zCom = db_column_text(q, 3);
15351538
int nChild = db_column_int(q, 4);
@@ -1541,11 +1544,11 @@
15411544
15421545
sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId);
15431546
if( memcmp(zDate, zPrevDate, 10) ){
15441547
fossil_print("=== %.10s ===\n", zDate);
15451548
memcpy(zPrevDate, zDate, 10);
1546
- nLine++;
1549
+ nLine++; /* record another line */
15471550
}
15481551
if( zCom==0 ) zCom = "";
15491552
fossil_print("%.8s ", &zDate[11]);
15501553
zPrefix[0] = 0;
15511554
if( nParent>1 ){
@@ -1565,11 +1568,11 @@
15651568
if( fossil_strcmp(zCurrentUuid,zId)==0 ){
15661569
sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* ");
15671570
n += strlen(zPrefix);
15681571
}
15691572
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 */
15711574
sqlite3_free(zFree);
15721575
15731576
if(verboseFlag){
15741577
if( !fchngQueryInit ){
15751578
db_prepare(&fchngQuery,
@@ -1594,10 +1597,11 @@
15941597
}else if( isDel ){
15951598
fossil_print(" DELETED %s\n",zFilename);
15961599
}else{
15971600
fossil_print(" EDITED %s\n", zFilename);
15981601
}
1602
+ nLine++; /* record another line */
15991603
}
16001604
db_reset(&fchngQuery);
16011605
}
16021606
}
16031607
if( fchngQueryInit ) db_finalize(&fchngQuery);
@@ -1781,11 +1785,11 @@
17811785
blob_appendf(&sql, " AND event.type=%Q ", zType);
17821786
}
17831787
blob_appendf(&sql, " ORDER BY event.mtime DESC");
17841788
db_prepare(&q, blob_str(&sql));
17851789
blob_reset(&sql);
1786
- print_timeline(&q, n, verboseFlag);
1790
+ print_timeline(&q, n, 79, verboseFlag);
17871791
db_finalize(&q);
17881792
}
17891793
17901794
/*
17911795
** This is a version of the "localtime()" function from the standard
17921796
--- 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 @@
188188
"%s "
189189
" AND event.objid IN leaves"
190190
" ORDER BY event.mtime DESC",
191191
timeline_query_for_tty()
192192
);
193
- print_timeline(&q, 100, 0);
193
+ print_timeline(&q, 100, 79, 0);
194194
db_finalize(&q);
195195
fossil_fatal("Multiple descendants");
196196
}
197197
}
198198
tid = db_int(0, "SELECT rid FROM leaves, event"
199199
--- 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
--- www/concepts.wiki
+++ www/concepts.wiki
@@ -79,11 +79,11 @@
7979
8080
<h3>2.1 Identification Of Artifacts</h3>
8181
8282
A particular version of a particular file is called an "artifact".
8383
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
8585
of that file expressed as 40 characters of lower-case hexadecimal. Such
8686
a hash is referred to as the Artifact Identifier or Artifact ID
8787
for the artifact. The SHA1 algorithm is created with the purpose of
8888
providing a highly forgery-resistant identifier for a file. Given any
8989
file it is simple to find the artifact ID for that file. But given a
9090
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button